Picture of the BeagleBone Black

Chapter 3: Exploring Embedded Linux Systems

Chapter 3: Exploring Embedded Linux Systems

/Chapter 3: Exploring Embedded Linux Systems
Chapter 3: Exploring Embedded Linux Systems2019-01-22T23:00:54+00:00

Introduction

This is the chapter web page to support the content in Chapter 3 of the book: Exploring BeagleBone – Tools and Techniques for Building with Embedded Linux. The summary introduction to the chapter is as follows:

This chapter exposes you to the core concepts, commands, and tools required to effectively manage the Beagle-based embedded Linux system. The first part of the chapter is descriptive; it explains the basics of embedded Linux and the Linux boot process. After that, you learn step by step how to manage Linux systems. For this exercise, you are strongly encouraged to open a terminal connection to your board and follow along. Next, the chapter describes the Git source code management system. This topic is an important one because the source code examples in this book are distributed via GitHub. Desktop virtualization is also described; it is useful for cross-platform development in later chapters. The chapter finishes by describing how you can download the source code examples for this book.

Learning Outcomes

After completing this chapter, you should be able to:

  • Describe the basic concept of an embedded Linux system.
  • Describe how embedded Linux devices, such as the Beagle boards, boot the Linux OS.
  • Describe important Linux concepts, such as kernel space, user space, and system initialization using systemd.
  • Perform Linux system administration tasks on the Beagle boards.
  • Use the Linux file system effectively.
  • Use a range of Linux commands for file and process management.
  • Manage your own software development projects using Git.
  • Install a Linux distribution on your desktop computer host OS using desktop virtualization tools, such as VirtualBox.
  • Download the source code for this book using Git.

Further Materials

The tree utility

An additional utility that is not described in Chapter 3 is the tree program. It allows you to obtain a visual display of the directory tree using only the Linux terminal. The command is not installed by default, so begin with:

Once the tree program is installed, you can test it on a directory of your choice, for example:

You can also use options (use man tree to see the full list) such as: -a display all files including hidden files, -l follows symbolic links, -u displays the owner, -C turns on colorization, -L 2 displays only the first two levels, and -d displays only directories. So, for example:

displays only the first level of directories in the exploringBB directory.

VirtualBox: Installing a Linux Guest Under a Windows Host

Here are some tips on installing a Linux guest VirtualBox VM under a Windows host:

  • Enable VT-x/AMD-V in the system BIOS settings of your physical computer in order to run a 64-bit guest OS.
  • Install VirtualBox (virtualbox.org) on your host OS.
  • Download your favourite Linux distribution as an ISO file. In this book 64-bit Debian is used. Download the Net debian-jessie-DI-rc1-amd64-netinst.iso or equivalent from the page www.debian.org/releases/. Do not use the ia64 branch unless you are using a high-end Itanium-based server. Important: see note at the top of the page about Debian Wheezy.
  • Start Oracle VM VirtualBox Manager and choose New. If available, give the installation 2GB+ memory. Create a virtual hard drive (VDI format, dynamic allocated) and make the size much greater than the 8GB it recommends. Choose the location on your computer to store the disk and use a minimum of 25–30GB! It is difficult to resize a disk after the fact. If you choose “dynamically allocated”, it will only occupy real disk space when you fill the Linux disk, so feel free to choose a large disk size.
  • You now have a new VM that is powered off. Select it and click on settings. Under storage you should see your VDI (under SATA) and an “Empty” entry (under IDE). Select the “Empty” entry and click the disk icon under Attributes. Find and select the Linux ISO file that you downloaded, as shown in the figure below.

Figure 2-A1: The VirtualBox VM configuration pane

  • Start your VM and install Linux by booting off the virtual drive. If you see a message “No Boot Device,” go to Settings System and disable the floppy drive.
  • Once your guest OS is running, choose Devices Install Guest Additions from the menu bar of your VirtualBox window. If all goes well, you will now be able to resize the window and cut-and-paste text between the host and guest OSs (by enabling Devices ⇒ Shared ⇒ Clipboard Bidirectional).
  • Choose “Devices”->”Insert Guest Additions CD image…”
  • If the guest additions do not install automatically, follow these steps (for Debian desktop — tested on Wheezy and Jessie images) in a terminal window:

  •  With your network settings set as NAT on Adapter 1 (default setting) you should now be able to ping 192.168.7.2 (your BBB when using Internet-over-USB), or its equivalent network IP address (if connected by regular Ethernet).

 If you go to the VirtualBox System ⇒ Processor settings, you will see the number of cores that can be allocated to the guest OS. On an Intel i7 processor you will see either 16 or 24 as the upper limit, depending on your exact processor. On a 4-core processor, you will see one core per thread, so 8 “real” cores, and you will also see that number again in “virtual” cores. Do not use virtual cores, as they will be provided through time slicing and your machine may slow down considerably. The maximum number of cores you should allocate to your guest OS is the total number of real cores minus one.

Useful tools – Cairo Dock

The latest windowing interface for Debian Jessie contains some very nice features, but it is quite lean. One tool that is useful and will be familiar to Mac OS X users is the Cairo Dock. It is illustrated in Figure 2-A2 below. You can install it using the following step:

cairo-dock-capture
Figure 2-A2: The Cairo Dock in action under Debian 8 (Jessie)

Debian 8 Jessie uses Gnome 3. To start up this dock automatically on boot you can perform the following steps:

And then click “Startup Applications” on the left-hand menu. On the right-hand pane click on the “+” icon and add Cairo-Dock to the list.

External Resources

Important Documents

External Web Sites

Pro Git by Scott Chacon and Ben Straub

Pro Git book (free online)

BeagleBone Black System Reference Manual

The BeagleBone Black System Reference Manual (SRM)

Recommended Books on the Content in this Chapter

       

Errata

  • None as yet in Revision 2

64 Comments

  1. TB December 14, 2014 at 2:50 pm - Reply

    Loc 2171, in the first sentence in paragraph on the three bootloader-related files:

    “These steps create three important files:u-boot.img (~360 KB), MLO (~100KB), and uEnv.txt (1<1KB)."

    1) The size of uEnv.txt lists "1<1KB" (Should it be "~ < 1KB" ?)
    2) Maybe need a space between "files" and "u-boot.img" ( "…important files: u-boot.img")

    • Derek December 14, 2014 at 7:32 pm - Reply

      Very strange. In my text that is “u-boot.img(~360KB), MLO(~100KB), and uEnv.txt(<1KB)". There must be a minor font problem in the conversion to the Kindle version there. Apologies about that.

      • TB December 14, 2014 at 7:51 pm - Reply

        No sweat. I am reading it on an iPad, with their Kindle viewer. It will be interesting to hear what others find with different platforms.

  2. TB December 14, 2014 at 4:08 pm - Reply

    Loc 2272, in the “System V init (SysVinit)” section:
    The text indicates that the systemd process is used in Debian, and indeed I can find it in my system…

    tb@beaglebone:/media/BBBdata$ which systemd
    /bin/systemd

    However, then a couple paragraphs later (“The runlevel defines the state…”), the text says this:
    “For example, under Debian, which uses SystemV init, there are…”

    I can find references to both SysVinit and systemd (for Debian) online. However the text seems to be contradicting itself here, and I was hoping you might be able to clarify this for me?

    • TB December 14, 2014 at 4:38 pm - Reply

      A little more research (personal conversation a Debian friend) indicates that the current Debian *desktop* stable version seems to still be using SysVinit, but with the next release it will be systemd. The Ubuntu 12.04 system in my laptop is indeed still using SysVinit, but on my BBB with the latest Debian eMMC image from the BeagleBoard.org download site, I seem to have systemd:

      tb@beaglebone:~$ ps -p 1
      PID TTY TIME CMD
      1 ? 00:00:03 systemd

      So I think I’ve probably answered my own question–the desktop Debian stuff appears to still be using SysVinit, while the BBB Debian stuff is now using systemd.

  3. TB December 14, 2014 at 11:53 pm - Reply

    Loc 3208: In your demo of the “watch” utility, you used the command “watch ps a” to show a one-second incremented watch output. Here on Debian (BBB) and Ubuntu 12.04LTS (laptop), it gives me a default of 2 seconds. In order to get a 1-second update period, I had to use this:

    # watch -n1 ps

    Also, “man watch” tells me that watch executes every two seconds by default, so I can’t explain why your output is as listed on that page.

    • Derek December 15, 2014 at 12:35 pm - Reply

      That is correct. There is an editing mistake there, the command should be “watch -n 1 ps a”. Thanks, Derek.

  4. DD January 17, 2015 at 5:53 pm - Reply

    Well, I messed it up. When trying to set up a 32GB card, I did umount on mmcblk0p1 instead of 1p1. And then of course moved same to /media/store. Believe that means I just moved my boot to a folder and BBB will not boot now. I put the Debian boot card in and tried to boot holding the s2 boot button but none of the user led’s are lighting up indicate it is doing anything. Did I destroy it or is there a way to save it? Thanks for any advise.

    • Derek January 17, 2015 at 9:35 pm - Reply

      Hi there. Bad luck. I’m not exactly sure what happened, but if you do not have much personal data on the BeagleBone then it might be a good time to flash the BeagleBone with a new image. You should be able to boot the BeagleBone with the SD card regardless. Check that the image on the SD card hasn’t been damaged (maybe re-image it) and then try to boot the BBB again. Remove power from the board completely and with the re-imaged SD card in the slot, hold the boot button and apply power. Don’t let go of the boot button until the LEDs light. If you had the USB-Serial-TTL cable you would be able see exactly what is going wrong. Good luck! Derek.

  5. DD January 17, 2015 at 10:53 pm - Reply

    Yeah, afraid it won’t boot at all. I reformatted the SD card and have tried it with both the eMMC version and the non-eMMC version. Then, just to be sure, used a new SD card as well for each image. Placed card in there, held down boot button and applied power. I don’t get anything except the power light to come on. I’ll get a USB-Serial-TTL cable and see if I can figure it out from there. Thanks

    • Derek January 17, 2015 at 11:08 pm - Reply

      That doesn’t sound good I’m afraid. See what happens with the cable — if you are getting nothing with it then you might have to look in to an RMA… That cable is well worth purchasing as it can be used for many applications (I use it later in the book for programming a low-cost 3.3V Arduino Pro).

  6. SD January 20, 2015 at 3:41 am - Reply

    Minor correction in the echo and cat section, p 87:
    “The exit status for date is 0 for a successful call and 2 for a directory that does not exist.”
    Given the context of the previous shell commands, I think you meant “The exit status for ls …”

    • Derek January 21, 2015 at 1:30 am - Reply

      Thanks for that. Errors like this amaze me… I read that page many times and I did not spot that. Added to errata list. Thanks, Derek.

  7. DD January 23, 2015 at 7:54 pm - Reply

    Finally got the USB-TTL-Serial cable and all it shows when I boot it is a series of C’s printed slowly across the terminal. It does this whether I hold down S2 or not. I bought another BBB at the same time and confirmed I’m hooking everything up right, as it shows a full boot process on the terminal. Sounds like it is dead?

    Thanks for your help. Really enjoying your book! Bought it a few days ago as a Nook book from Barnes and Noble.

    • Derek January 23, 2015 at 9:05 pm - Reply

      Hi there. The good news is that it is not completely dead or you would see nothing — The CCCCCCC means that the processor is searching for a bootable image and has not found one. Can you try a brand new SD card with a brand new downloaded image from beagleboard.org? Also, check that the tiny pins haven’t been damaged and that they are making good contact with the SD card (maybe clean the SD card contacts and put some gentle pressure on the pins). With the brand new SD card in the slot, plug in the power while holding the boot button and watch the serial output. Good luck! Derek.

  8. Trevor January 29, 2015 at 6:44 pm - Reply

    On pages 77 – 78 the book has the eMMC as being shown as mmcblk1boot0 when the lsblk command is used but when I use that command I get 0s where the book says I should have 1s. I get mmcblk0boot0. Is this a problem, or is ok? Amazing book by the way!

    • Derek January 29, 2015 at 9:06 pm - Reply

      Thanks Trevor. If there is an SD card in the slot then you can get a different device name output. In fact, at the top of this web page I complete the example on pages 80-81 to mount the device using its UUID to avoid the problems that can arise with shifting block device names. I think everything is fine, but just be careful with the commands that are issued using the device names. Derek.

  9. Karl February 4, 2015 at 3:43 am - Reply

    Hi Derek,

    Thanks for the nice book!

    I added a new user into the system with adduser. When I “mkdir abc” in the home folder of that new user, an error told me “no space left on device”. But the root user or “sudo mkdir abc” can do the job. When I use “df -T”, I found the rootfs is 100% used. Is that normal? How can I fix that?

    Thanks so much!
    Karl

    • Derek February 4, 2015 at 10:32 pm - Reply

      Hi Karl. Thanks. You are in trouble if your rootfs gets to 100%. If you are using a revision B of the board with the 2GB eMMC then this is a common problem. If you are using the revision C board with the 4GB eMMC then this is less common. Start by clearing out the log files — see the note on Page 77. Then have a look at the note on Page 164. Kind regards, Derek.

      • Karl February 4, 2015 at 11:37 pm - Reply

        Thanks so much for your help Derek!

        I didn’t find which files are too big. But if it’s normal that’s fine. I reinstalled the OS into an SD card and now everything is alright.

        Cheers,
        Karl

  10. Hyusein Gyulyustan February 4, 2015 at 9:21 pm - Reply

    Hi Derek,
    Page 61, Section “Reading memory values directly (Advanced)”, In sentence “The IP address matches the memory values, …”, perhaps you mean Ethernet MAC address.

    • Derek February 4, 2015 at 10:23 pm - Reply

      Thanks Hyusein. Yes, that is a mistake. I will add it to the list of errata. Derek.

  11. David February 7, 2015 at 11:06 am - Reply

    Hi Derek,

    Thank you for the very gentle and informative book.

    Firstly, one editing error I spot on page 80, mounting place /media/6462-3062 and /media/9016-4EF8 have been mixed together.

    Besides others, I followed your information to try out Virtualbox on my PC and Machinekit on BBB, really nice!

    I have a 2GB eMMC BBB, after upgrading to Debian, the free disk space is getting really low. Currently I just use a 16GB SD to host my whole system, so the 2GB eMMC is not used. With your configuration to boot from eMMC and to mount SD as extra storage, that is nice. But will I run into problem when /home is running out of space? In such case, I suppose I should use soft link to link a directory to the extra space on SD? Is there anyway that user can get the extra space without knowing anything happened in the background? For example, when a company ran into the space issue, what did the administrator do? Did they buy a larger storage and copy everything from the smaller storage over?

    • Derek February 7, 2015 at 11:54 pm - Reply

      Thanks David — I updated the example when the book was going to press, but introduced a continuity error! I’ll add it to the list of errata. Great work too — Yes, the 2GB eMMC is very tight. I think that people were happy to pay the extra for the 4GB revision. Your discussion on the process is spot on. You can copy the /home directory to the SD card (e.g., /media/home) and then you can edit the /etc/fstab file to add an entry that places /media/home as /home. Derek.

  12. mg February 8, 2015 at 12:26 pm - Reply

    Hi Derek,
    Great book so far! I’ve encountered a problem when attempting to follow Step 5 here. After finishing the steps in order and typing everything exactly right, my BBB would not boot up. Here is what I did differently, I have been using vim to edit files up to this point but do not see how that would affect anything, and when I decided to see how my fstab editing went, I used “init 6″ to reboot. First off, I guess shutdown is a much better approach, but is init 6 actually a bad approach? After rebooting, i could not connect with putty at all, and the bbb will not do a soft shutdown. I got out the usb to ttl and amazingly enough am able to connect via serial. I removed the line that was added to fstab (after verifying everything was in fact correct), and then used “shutdown -h now” … nothing. The bbb now refuses to power down, and will not open a usb internet connection. Any suggestions on what has happened here? I am using a 32gb class 10 Samsung “evo” card, I am going to attempt to reflash the emmc, but am wondering if the same thing is going to happen upon step 5…

    again, thanks for all your hard work. This book is truly amazing and the amount of time you must have invested really shows

    • Derek February 8, 2015 at 12:39 pm - Reply

      Hi, thanks for the feedback! That is an odd problem and it sounds like an error has been introduced into the fstab file. Editing with vim wouldn’t make any difference. I’m assuming that you are running shutdown as root so I’m not sure why it won’t shutdown — maybe try a sudo halt now. Are you certain that you didn’t edit any of the other entries in the fstab file? Just for reference, here is my fstab file. The last line is for the SD card and can be removed.

      • mg February 8, 2015 at 9:00 pm - Reply

        Unfortunately I did not further diagnose the fstab after removing the last line and am back up and running into chapter 5 now with a newly flashed emmc. The extra practice of reinstalling packages, setting .profile and such was probably good to solidify the concepts anyways. My closest guess is that maybe I had rebooted after seeing the sdcard on mmcblk1p1, and when pulling the UUID upon reboot foolishly pulled that one again instead of the proper mmcblk0p1? Maybe using the cp command would be a good idea to create a backup file before altering fstab. In practice, one could usb-ttl in and revert to the old file and should fix any errors, would this be correct? I would’ve thought removing that line should’ve fixed the error though, and had no luck, so maybe your intuition on possibly altering another line while navigating down to the last line in fstab could have happened. I am still perplexed by the shutdown issue, it would hang for five minutes until Ctrl-c to cancel shutdown. I tried every variation of the command as root, with sudo, pressing the power button on the board to no avail. I guess we’ll never know…

  13. Hyusein Gyulyustan February 9, 2015 at 10:33 pm - Reply

    Hi Derek,
    In page 97: “The shortcut git commit -a will commit modified files directly to the staging area, …”. Do you mean “local repository” instead of “staging area”?

    • Derek February 10, 2015 at 1:00 am - Reply

      Thanks Hyusein, yes indeed — I will add that to the list of errata. It is important to note that it only commits modified files and not new files that are untracked. Kind regards, Derek.

  14. Yake March 14, 2015 at 2:05 pm - Reply

    Hi, Derek
    I found on page 97 git config -global user.name and the next line, the “-global” maybe use “–global”, double dashes, or it will return an error.
    Really enjoy your book, Thank you very much. O(∩_∩)O~

    • Derek March 14, 2015 at 3:56 pm - Reply

      Thanks for that. I have added it to the list of errata. Kind regards, Derek.

  15. pratap March 16, 2015 at 3:59 pm - Reply

    Hi Derek,
    Does beaglebone have the capability to detect the bootloader from the micron emmc boot partitions?? I had burned the MLO and u-boot.img to the boot partitions (Both tried RAW and VFAT), but still could not able to crack the nut.

    Thanks,
    pratap

  16. nobody March 16, 2015 at 8:17 pm - Reply

    Hi Derek,
    Love the book but I have two questions.
    1) p90 middle of the page – should “more HelloWorldSleep.c” be “nano HelloWorldSleep.c”
    and
    2) when I try to compile the program on that page, I get “fatal error: stdio: No such file or directory”
    Any suggestions?
    Thank you for the great book.

    • nobody March 16, 2015 at 9:29 pm - Reply

      I got number 2. Sorry for the trouble.

    • Derek March 16, 2015 at 10:21 pm - Reply

      Hi there, you are welcome — thanks for your support! Just on 1) Yes, the code has to be entered using nano, but I’m just showing the file using more as I have no real way of indicating that I am entering code at the command line. Hope that makes sense, Derek.

  17. Will March 23, 2015 at 2:06 pm - Reply

    Hi Derek,

    The book is great, as expected!

    I get the following error when I try to clone the test repository.

    root@beaglebone:~# git clone https://github.com/derekmolloy/test.git
    Cloning into test…
    error: while accessing https://github.com/derekmolloy/test.git/info/refs

    fatal: HTTP request failed

    This succeeds from my Ubuntu desktop but not from my beaglebone white running Angstrom. What could this be? Thanks.

  18. Jordi March 26, 2015 at 9:42 am - Reply

    Here in this page under Important notes section, where it says “the typical installation is the arm64 netinst for readers who have an Intel x86 64-bit machine” should be amd64 nor arm64 I believe.
    Cheers

    • Derek March 26, 2015 at 10:12 am - Reply

      Thanks Jordi, I have fixed it. Derek.

  19. Robert P. J. Day April 10, 2015 at 7:53 pm - Reply

    p. 73, command table suggests “chmod u+s myexe” sets *both* setuid and setgid; that’s not right, is it?

    rday

    • Derek April 10, 2015 at 8:08 pm - Reply

      Hi Robert, Correct. That command only sets the setuid bit. The description on the right describes both, but the example that is provided is for the setuid bit only. I probably should have given both examples on the left-hand side. Thanks, Derek.

  20. Jaime April 13, 2015 at 7:00 pm - Reply

    On the Errata p97, should it be “git config –global“ instead of “git commit –global“? -Thanks

    • Derek April 13, 2015 at 7:08 pm - Reply

      Hi there, oops! thanks for that. Fixed. Fortunately I can edit the errata and I don’t need to publish an errata for the errata! Thanks, Derek.

  21. Robert P. J. Day April 14, 2015 at 6:20 pm - Reply

    p. 61, 3rd bullet point, reference to absolute pathname “/dtbs/am335x-boneblack.dtb”, should that be relative to /boot if we’re talking about that file in the root filesystem?

    • Derek April 15, 2015 at 6:40 pm - Reply

      Hi Robert, It is /dtbs on the VFAT partition on the bone50 image that this book was written for, but it is /boot/dtbs/ on the Linux partition for the bone70 image update. Derek.

  22. Michael April 28, 2015 at 1:42 pm - Reply

    Hi Derek,
    I am loving the book! I am a Linux newbie, so I am working my way through the book at a pretty slow rate, trying commands on my BBB as I go! I notice that on pages 77-78 you have the eMMC referred to as mmcblk1, yet when I try the command on my BBB, it is referred to as mmcblk0 as per below. Not sure if this is a typo or not, but thought it was worth mentioning.
    Thanks for the great book,
    Regards
    Michael

    root@beaglebone:/# lsblk
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
    mmcblk0boot0 179:8 0 2M 1 disk
    mmcblk0boot1 179:16 0 2M 1 disk
    mmcblk0 179:0 0 3.6G 0 disk
    |-mmcblk0p1 179:1 0 96M 0 part /boot/uboot
    `-mmcblk0p2 179:2 0 3.5G 0 part /
    root@beaglebone:/#

    • Derek April 28, 2015 at 8:48 pm - Reply

      Thanks Michael. Yes, the block id of the devices can change and you have to be very careful about that fact. In fact, if you plug in a SD card into the slot it can result in the devices switching IDs. To deal with this on the chapter web page for exploringbeaglebone.com/chapter3/ in the section “Mounting the SD Card Automatically” I use the UUID of the device to ensure that the correct device is mounted. Kind regards, Derek.

      • Michael May 1, 2015 at 3:20 pm - Reply

        Thanks Derek for your quick response! Linux is indeed an OS where one must pay attention and is definitely not a hobby for people with fat fingers and small keyboards! I’ll certainly be careful when it comes to the details and will be trying the exercises on your website as I go! Thanks again, Michael

  23. Jinting Guo May 18, 2015 at 7:09 pm - Reply

    Hi Derek,

    As you suggested I installed Cairo-Dock followed your instructions. However when I login with Cairo-Dock option, a warning message pops up as below:
    Xsession:Unable to launch “gnome-session –session=cairo-dock” X session —“gnome-session –session=cairo-dock” not found; falling back to default session.
    The Cairo-Dock is just installed after a fresh Debian Jessie installation, could you point me what the problem is, how to fix the problem.
    Thanks in advance,

    • Derek May 19, 2015 at 9:41 pm - Reply

      Hi there. It looks like cairo-dock is not installed properly. Maybe try the installation again and execute it directly before adding it to the startup properties. Derek.

  24. Michael May 19, 2015 at 4:11 pm - Reply

    Hey Derek,
    I am still loving the book and am experimenting with every example as I work my way through the pages. I just wanted to let you know that in Chapter 3 on page 94 in the Note section that http://www.gitlab.org/ is now a dead link. I appears that http://www.getgitorious.com/ is still up and running!
    Thanks again,
    Michael

  25. Mitchell June 5, 2015 at 1:41 am - Reply

    I know this isn’t a VirtualBox help site, but I am growing frustrated searching the net for a way to increase the size (resolution) of the Debian desktop after installing VirtualBox and Debian 8 as instructed here. The largest I can get is 1024×768, which is OK for now but it would be so much nicer to increase that as I get farther into the book and on to larger cross platform programming projects.

    What do I have to do to get the Settings | Displays app in Debian to give me choices other than 800×600 and 1024×768?

    Thanks,

    Mitchell

    • Derek June 5, 2015 at 1:55 am - Reply

      Hi Mitchell, if you follow the steps on the web page (after Figure 2-A1) to install the Oracle VirtualBox Additions then you can re-size the window dynamically to whatever resolution you require by dragging the corner of the VirtualBox window frame (Linux then changes the desktop resolution to match). Kind regards, Derek.

  26. Mitchell June 5, 2015 at 3:10 pm - Reply

    Thanks for the quick reply – I think there is a problem with my installation then. I did follow your directions originally but something must have gone wrong. When I selected “Devices | Install Guest Additions” nothing appeared to happen except the menu item changed to “Devices | Insert Guest Additions CD image…”. After some Internet searching I found the “VBoxGuestAdditions.iso” file in the base VirtualBox install folder but when I try to load it VirtualBox reports “Unable to insert the virtual optical disk C:\…” Unless you have another idea I guess I will try uninstalling and reinstalling VirtualBox and try again.

    • Mitchell June 5, 2015 at 4:45 pm - Reply

      First, thinking the ISO might be corrupt; I downloaded the Guest Additions ISO from the Oracle VirtualBox website. While this turned out to most likely be unnecessary, it’s nice to know it’s an option to not have to reinstall everything.

      As reported in my earlier post VB would not accept the ISO file; it also rejected the fresh copy I downloaded. However, I found that if I manually un-mounted / ejected the virtual CD using the Disks utility on the Debian desktop running on the VM, I could then successfully “insert” the virtual CD from the VB “Devices” menu. The installation then tried to autorun, but failed, with Debian complaining that it “could not find the program”. I found two ways around this:

      1. Run the installer manually by navigating to the /media/cdrom directory and executing sudo sh VBoxLinuxAdditions.run.
      2. Edit the /etc/fstab file replacing “noauto” with “exec” on the line for the cdrom, which is /dev/sr0 on my setup.

      Both worked (after restarting the VM).

    • Mitchell June 5, 2015 at 4:56 pm - Reply

      I just realized that Dr. Molloy included how to manually start the installer in his instructions on this page. This worked for me as advertised, but only after I un-mounted and reinserted the ISO (for whatever reason).

      Just wanted to post my experience, including the fix for autorun, in case anyone else reading and following along with this fine book runs into similar issues.

      • Derek June 5, 2015 at 11:20 pm - Reply

        Thanks Mitchell, very useful feedback, Derek.

  27. Stephan July 22, 2015 at 5:57 am - Reply

    I could not run the “sh ./VBoxLinuxAdditions.run” command, it would say ‘Can’t open ./VBox…’, I found the solution here:

    http://superuser.com/questions/261643/cant-install-guest-additions-using-virtualbox-ubuntu-guest-os-win7-host-os

    Apparently one has to mount the “VBoxGuestAdditions.iso” file under Windows, which is in the

    “C:\Program Files\Oracle\VirtualBox” directory!

    Following the instructions in the above link by Sathya, it then installed fine.

    • Derek August 5, 2015 at 12:43 am - Reply

      Hi Stephan, yes, the ISO has to be mounted — I have updated the guide on the page. Thanks for that, Derek.

  28. Harpreet May 18, 2016 at 1:51 pm - Reply

    Hello Derek,
    I am using VMware and debian 8 Jessie, I also installed mkudevrule.sh for Beaglebone. But still not able to connect with Beaglebone through SSH. In windows with putty its working flawlessly. Could you please guide me for this.

  29. ben nguyen June 11, 2016 at 5:49 pm - Reply

    Everything up to installing the armhf toolchain works fine (vm image debian 8.5), but installing the toolchain fails.. seemingly due to incompatible packages?

    root@bbbdebian:/home/bbbguest# apt-get install crossbuild-essential-armhf
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

    The following packages have unmet dependencies:
    crossbuild-essential-armhf : Depends: libc6-dev:armhf but it is not going to be installed
    Depends: gcc-arm-linux-gnueabihf (>= 4.9.1-1) but it is not going to be installed
    Depends: g++-arm-linux-gnueabihf (>= 4.9.1-1) but it is not going to be installed
    Depends: dpkg-cross but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
    root@bbbdebian:/home/bbbguest#

    Is there some known incompatibility? What version of jessie 8.? is this known to work with?

Leave A Comment

Exploring BeagleBone

This is the companion site for the book “Exploring BeagleBone: Tools and Techniques for Building with Embedded Linux” by Derek Molloy. The site structures and contains all of the digital media that is described in the book. Each chapter in the book links to an individual web page, which can be accessed using the menu on the top right-hand side of this page when you close this menu. For details of the book itself, click here.

Recent Works

Latest from Derek Molloy YouTube Channel

Oops, something went wrong.