Installing Ubuntu on the BeagleBone Black

May 18, 2013, 7:16 p.m.

In order to install Ubuntu on the BeagleBone Black, essentially two steps need to be taken. The first step is imaging an SD card with Ubuntu because in order to flash the eMMC memory with Ubuntu, you CANNOT be booted to the eMMC, you need to be booted off of an external source (i.e. an SD card).

Install Ubuntu to the SD Card

On your computer (not on the Beaglebone Black) you need to image an SD card with the Ubuntu image. Luckily a man named Robert Nelson has created an amazing shell script that images SD cards for you and makes them bootable. Note: you must use this method to create the Ubuntu image, I tried using Win32DiskImager and flashnul to image my SD card and both did not work.

Now probe your computer to find where the SD card is located (assuming you have plugged in the SD card already) and then run the command to start the setup_sdcard.sh script on the selected SD card (in my case /dev/sdc):

Once the SD card is successfully imaged, you now have a bootable Ubuntu SD card for the Beaglebone Black. Take out the SD card, plug it into the Beaglebone Black's SD card reader and boot the device while holding down the USER/BOOT button (located right next to the SD card reader) to boot to the Beaglebone Black from the SD card.

Installing Ubuntu on the BeagleBone Black's internal eMMC (optional)

Once you have Ubuntu on the SD card, you do not need to image the BeagleBone Black's internal eMMC with the same image, you can just simply use the SD card. I recommend using the eMMC portion because it is much faster than using an SD card.

On the BeagleBone Black:

While booted into the BeagleBone Black on an SD card (NOT on the eMMC!) download the Ubuntu image again:

Now probe your BeagleBone Black to verify that the eMMC is located in /dev/mmcblk1 and then run the command to start the setup_sdcard.sh script on the eMMC portion (if you receive a probe readout after running the setup_sdcard.sh file that means you need to edit the shell file like I had to, see below):

Now when I was running the shell file on the mmcblk1 portion, I was unable to get it to work, it kept giving me a probe readout saying it was unable to find mmcblk1. In order to fix this, I had to edit the shell file. Remove this portion of code from the setup_sdcard.sh file in the check_mmc() function:

Now rerun the same command as before, and now instead of giving you a probe readout, it should begin formatting the eMMC memory. Once that is done, shutdown the BeagleBone Black, unplug the SD card (NOTE: you CANNOT leave an SD card in the BeagleBone Black that contains an .img file, as it will prioritize boot to the SD card!), and boot the device up as normal.

Once the device boots up without the SD card, you should be running Ubuntu now and not Angstrom.

Update: some users have reported some dependencies are needed to complete the install process. Check the comments for more information.

I used this to install ubuntu-13.04-console-armhf-2013-05-29.tar.xz and it worked like charm. I didn't encounter any issues with tar as mentioned above, but did have to remove the "else" clause in the check_mmc function setup_sdcard.sh script.

Dan, glad it worked for you! I am also glad to hear I am not the only one who had problems with the shell script.

wolfrum, that image is fine but you do not have to necessarily use that image. That image is a bit out dated now. You should be able to use the newest Ubuntu-arm image that I supplied in my post. But it really does not matter!

I walked through the tutorial and installed Ubuntu 13.04 on the eMMC on my Beaglebone Black. I even went through and built a 512MB swap file on the eMMC to give me some extra memory to work with. I also uninstalled Apache2 and replaced it with Nginx for a more lightweight web server. I plan on using my BBB for some web app development. I have a nice 32GB class 10 micro SD card that I would like to use as my storage volume. I have seen in the past where folks setup /home on a separate volume but I am not sure if I want to do that. My current plan is to setup a direct on the storage volume for each user and then link to it from their home directory (as an example: the eMMC has /home/voort/Public and I build a symbolic link to /voort/Public on the storage volume). This way each user could develop in their own directory and I can have Nginx point to those Public directories on the storage volume to display web content. My question is, what is the best way to create that storage volume and insure that it is mounted if the BBB gets rebooted? Could you throw together a post that shows that or do have a link to a post that would help with that? Thanks!

So I have gotten ubuntu working with networking, ssh etc, Now I want to clone the image on the BeagleBone Black and use the image on another BBB. What is the best way to do this? I was also wondering what a barebone OS would be need so I could set it up so a BBB to do a PXE boot.

Thank you for the turoria.I want to know if Iboot from ubuntu on the sd card.Can i keep login the new system by use the usb cap on putty on 192.168.7.2:22.I'm not good at english.Hope you can understand me.

Greg, I have never created a clone image of an OS before, so I have no idea. And Ubuntu or Fedora on the non-GUI version is the most "barebone" OS that I am familiar with (there is probably others, but good luck finding good tutorials or docs haha).

Thank you for you reply.This is my problem.I don't have a HDMI cable and a monitor.So I need to access the beaglebone black through USB or ethernet.And use a usb cable is really simple(both power and access).If I access it over ethernet after install the new ubuntu,how can i know the ip address and whether the openssh is up.if not then i can't access it.So how did you access it after install the new OS.Connect a monitor by use a HDMI cable?

Xiaorong, I believe that SSH is initially enabled upon new install, have you tried to connect via SSH yet? Also just for reference, when your beaglebone connects to your router it is assigned an IP address (I would make this a static IP address), so all you need to do is boot up PuTTY, then enter that IP address that your router assigned to the beaglebone and the custom port that you entered when setting up SSH. Then it will prompt you for the root username/password.

MrMaxx, Cloud9 IDE appears to be a fully in-browser IDE, so I think you just go to their website and sign up to use it. It does appear as though you can install it locally after you have logged in. I don't have an account so I can't verify that, but I did find a couple good guides on installing Cloud9 locally:

Thank you very much for your post!I have been fighting for a while and your tutorial finally saved me.I missed just two things along the process that I needed (maybe you want to add them):# apt-get install xz-utils# apt-get install parted