10

i would like to emulate BeagleBone Black. It seems that QEMU is the only emulator that supports Linux emulation for ARM. However i m having difficulty in getting the right emulator.

I tried using QEMU build from qemu.org but it seems that the machine "beagle" is not supported (also from the output of "qemu-system-arm -machine help" does not least beagle as supported machine). I found some posts saying that Linaro has a qemu builds with BeagleBone support and that it can be installed using apt-get on Ubuntu. There is also a youtube video with instructions:

https://www.youtube.com/watch?v=__6XmxOrL3o

It seems however that the instructions no longer work. I have Ubuntu 14.04. I tried the following:

1) sudo add-apt-repository ppa:linaro-maintainers/tools

This times out and reports an error wrong PPA format.

2) Then i followed instructions here:

https://wiki.linaro.org/Platform/Systems/Repository

However, after adding these repositories, no qemu was added, so in my apt repository i only had qemu from qemu.org (which does not support beaglebone)

3) Then i found this page:

https://launchpad.net/~linaro-maintainers/+archive/ubuntu/tools

So i tried the following:

sudo add-apt-repository http://ppa.launchpad.net/linaro-maintainers/tools/ubuntu

and then also downloaded and added the public key using "sudo apt-key add" command.

This seemed to work as after doing "sudo apt-get update" and "apt-cache show qemu-system" i get see the following:

Package: qemu-system Source: qemu-linaro Version: 2.2.0~rc3+git8+gdb12451-63linaro+trusty Architecture: amd64 Maintainer: Ubuntu Developers Installed-Size: 133812 Depends: qemu-linaro-keymaps, libasound2 (>= 1.0.16), libbluetooth3 (>= 4.91), libbrlapi0.6, libc6 (>= 2.15), libcurl3-gnutls (>= 7.16.3), libfdt1, libgcc1 (>= 1:4.7), libgl1-mesa-glx | libgl1, libglib2.0-0 (>= 2.24.0), libgnutls26 (>= 2.12.17-0), libncurses5 (>= 5.5-5~), libpixman-1-0 (>= 0.15.16), libpng12-0 (>= 1.2.13-4), libpulse0 (>= 1:0.99.1), libsasl2-2 (>= 2.1.24), libsdl1.2debian (>= 1.2.11), libstdc++6 (>= 4.6), libtinfo5, libuuid1 (>= 2.16), libvdeplug2, libx11-6, zlib1g (>= 1:1.2.0) Suggests: samba Breaks: qemu (<< 0.11.0-2), qemu-kvm-extras (<< 0.13.50-2011.02-0~rc1-0ubuntu1) Replaces: qemu (<< 0.11.0-2), qemu-kvm-extras (<< 0.13.50-2011.02-0~rc1-0ubuntu1) Homepage: https://launchpad.net/qemu-linaro/

(i only pasted the first few lines).

However, after installation of qemu-system (sudo apt-get install qemu-system), it still does not have BeagleBone support (qemu-system-arm -machine help does not show any beagle).

So i m wondering if anybody knows where to install QEMU from on Ubuntu that has BeagleBone support. Is there another repository i should be adding? I m new to Ubuntu, apt and Linaro, so i m out of ideas so far.

Yevgeniy P
  • 1,480
  • 1
  • 15
  • 23

1 Answers1

15

I ran across your question because I was trying to do the same thing all day. I am also using (X)ubuntu 14.04.

The short answer is: there is no QEMU that supports the Beagle Bone out of the box.

You are correct about qemu-linaro having some support for OMAP3, including beagle and beaglexm. These are for the Beagle Board and Beagle Board xM. The Beagle Board series uses the OMAP 3530 while the Beagle Bone series (regular and black, like I have) uses the OMAP 335x.

In addition, I was unable to find a working PPA that contains binary qemu-linaro. An old version of the one you are trying to install used to contain QEMU, but doesn't anymore - even as of trusty (14.04).

According to the package list for Saucy (13.10) qemu-linaro was in that PPA.

But it is gone by Trusty (14.04). I don't know why your apt-cache shows anything at all - I wasn't even able to duplicate that.

You can build a version of QEMU that supports OMAP 3 and Beagle Board:

So what I did was to clone the git repo and compile qemu-linaro. This was straightforward, you might just need to add a few -dev packages for library dependencies. My machine already has most of what was required.

This version provides the -M beagle or -M beaglexm options.

I then spent all day trying to figure out why my Beagle Bone MDL and U-Boot kept crashing before figuring out that Bone != Board. Gah... They have slightly different memory maps and are not the same thing.

So for now I rebuilt my test images for the Beagle Board instead of Bone and it actually boots with the latest qemu-linaro!

It is unfortunate that OMAP 3 is not yet upstreamed into the main QEMU. There was some mailing list traffic about it a year ago, but it doesn't seem to have gone anywhere. It does not appear that it would be very difficult to add a Beagle Bone Black machine type, but that hasn't happened yet either.

Anders
  • 2,270
  • 11
  • 19
  • Thank you for the answer. I m ok to try to emulate BeagleBoard or BeagleBoardXM instead of BeagleBone. Can i install Saucy qemu package on my Ubuntu version? How would i go about it? (Sorry i m new to this). What URL should i provide to apt-add-repository? – Yevgeniy P Feb 24 '16 at 09:00
  • Also from your answer it seems like you were able to build the images. I also had problems with that. I posted these at http://stackoverflow.com/questions/35447773/building-beaglebone-image-with-linaro-media-tools. Do you have any pointers on how to do this the right way? – Yevgeniy P Feb 24 '16 at 09:03
  • Also, regarding building qemu instead of installing it, i tried to follow instructions at http://stackoverflow.com/questions/28564692/set-up-beagleboard-emulator-with-qemu-in-ubuntu, however my machine is behind the proxy and i couldn't get git working with the proxy. That is i could get it working with http protocol but not git protocol, and some of those instructions require git protocol. Can this be done without git? – Yevgeniy P Feb 24 '16 at 09:10
  • Regarding building qemu-linaro from source on Ubuntu 14.04, I did basically the same thing as in the answer you linked, except I did *not* do the steps requiring git submodule for pixman and dtc. I had to run configure a couple times and if it failed for a lacking dependency, I used apt-get install to add it. For example, I had to apt-get install libpixman-1-dev and libftd-dev for the build dependencies. If you download a qemu-linaro tarball, then yes I think it could be done without the git network protocol. – Anders Feb 26 '16 at 17:08
  • You can often also change the git clone address to use http or ssh protocols. For example, if I was stuck behind a http firewall, you could also use the url `http://anongit.freedesktop.org/git/pixman.git` instead (see https://cgit.freedesktop.org/pixman/). To change it, edit .gitmodules file and run `git submodules sync`. Then proceed as before. – Anders Feb 26 '16 at 18:03
  • 1
    I saw the linaro devpack stuff and concluded it was a tangent I didn't want to delve into. I was mostly interested in playing with Yocto (https://www.yoctoproject.org/) and getting U-Boot running in the emulator (which works!). I followed the steps in the very comprehensive yocto documentation, and this includes adding the meta-ti layer that adds support for the beagle. And there is quite a dearth of documentation of how to format a SD card image for beagle let alone boot it in qemu. This more involved than can be explained in comments. – Anders Feb 26 '16 at 18:11
  • 1
    I would definitely say that building and bringing up a working Linux on one of these embedded boards is an "advanced" task. It is an *excellent* way to learn, but expect it to be slow and make sure you understand each step, experiment if necessary. If you get really stuck, ask new specific questions and hopefully you can find help. If you have a new question that isn't getting attention, you can reply to this with a link, maybe I'll have a clue but I do have limited time on SO. – Anders Feb 26 '16 at 18:22
  • 3
    Since it's been almost 4 years since this answer, I'm wondering if anything has changed. I'd like to emulate a Beagle*Bone* Black. Has anyone had success with this? – Andrew Nov 10 '19 at 19:14
  • @Andrew did you find anything? – Mumphus Jan 17 '20 at 17:30
  • Unfortunately no. – Andrew Jan 18 '20 at 19:03
  • I found the closer you can get to a beagleBONE emulator is to run a generic armhf qemu emulator with the standard debian kernel, as described here: https://github.com/GroupOfRobots/RysROS2/wiki/Virtual-machine-setup – Nahuel Greco Sep 30 '21 at 23:22