If you just want to try a program on Beagleboard, but do not want (or have the means) to purchase a board, you may be able to use qemu to emulate the Beagleboard or BeableBoard-xM. I’ll details the instructions to run the Nano build (minimal kernel) and the ARM Linux Internet Platform (ALIP) distribution for Beagleboard on qemu. Please read the full post before starting the installation before there are currently some issues such as no Ethernet support.
First, install or update linaro-media-create:
sudo add-apt-repository ppa:linaro-maintainers/tools
sudo apt-get update
sudo apt-get install linaro-image-tools
Then download the nano image and omap3 hardware pack:
wget http://releases.linaro.org/platform/linaro-n/nano/11.08/nano-n-tar-20110823-1.tar.gz
wget http://releases.linaro.org/platform/linaro-n/nano/11.08/hwpack_linaro-omap3_20110823-0_armel_supported.tar.gz
Generate the image for qemu:
sudo linaro-media-create --image_file beagle_sd.img --dev beagle --binary nano-n-tar-20110823-1.tar.gz --hwpack hwpack_linaro-omap3_20110823-0_armel_supported.tar.gz
If you don’t have it already, get the latest qemu-linaro package from Linaro Maintainers PPA:
sudo apt-get install qemu-system
Check the version is correct:
qemu-system-arm -version
QEMU emulator version 0.15.50 (Debian 0.15.50-2011.08-0ubuntu2~ppa10.04.1), Copyright (c) 2003-2008 Fabrice Bellard
Finally run the nano image in qemu for Beagleboard:
sudo qemu-system-arm -M beagle -m 256 -sd ./beagle_sd.img -clock unix -serial stdio
For Beagleboard-xM use the following command line:
sudo qemu-system-arm -M beaglexm -m 512 -sd ./beagle_sd.img -clock unix -serial stdio
After a few minutes, you should be able to access the command line in the emulator and check the CPU info:
root@linaro-nano:~# cat /proc/cpuinfo
Processor : ARMv7 Processor rev 3 (v7l)
processor : 0
BogoMIPS : 81.39Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc08
CPU revision : 3Hardware : OMAP3 Beagle Board
Revision : 0000
Serial : 0000000000000000
root@linaro-nano:~#
Currently you can not access Ethernet, since this is not implemented, but this will be added to the October 2011 release of qemu-linaro. This is an issue because if you want to copy a program or other files to the emulator, you’ll have to create a qemu image each time. If you have another solution let me know. Following comments by readers, you can use the overo hardware pack to use Ethernet.
The next thing we can try is to run the ARM Linux Internet Platform ( ALIP) in the emulator.
First download the ALIP image and hardware pack for OMAP3 and X11:
wget http://releases.linaro.org/platform/linaro-n/alip/11.08/alip-n-tar-20110823-1.tar.gz
wget http://releases.linaro.org/platform/linaro-n/alip/11.08/hwpack_linaro-omap3-x11-base_20110823-0_armel_supported.tar.gz
Then create a qemu image with those 2 files:
sudo linaro-media-create --image_file beagle_sd_alip_x11.img --dev beagle --binary alip-n-tar-20110823-1.tar.gz --hwpack hwpack_linaro-omap3-x11-base_20110823-0_armel_supported.tar.gz
and run the ALIP image in qemu for Beagleboard:
sudo qemu-system-arm -M beagle -m 256 -drive file=./beagle_sd_alip_x11.img,if=sd,cache=writeback -clock unix -serial stdio -device usb-kbd -device usb-mouse
After a few minutes, you should be able to see the desktop:
The screenshot above shows the ALIP desktop in the background and the terminal window which started qemu.
Update: Thanks to Peter Maydell for explaining me I initially did not add the USB keyboard and mouse options in the command line above. Once I add -device usb-kbd -device usb-mouse, the mouse and keyboard works fine. I’ll leave the old version of the post below for reference.
However, there is a rather annoying issue: Once you get in the desktop, the mouse and keyboard do not respond. However, it is supposed to work: “USB keyboard and mouse are supported starting with qemu-linaro 2011.06, for Linaro images of the 11.05 release or later. “, so I must have missed a step.
I’ve also tried to compile the latest Git version of qemu-linaro (20 September 2011), but it did not fix the issue. I still document the steps I followed below:
git clone git://git.linaro.org/qemu/qemu-linaro.git
cd qemu-linaro
sudo apt-get install zlib1g-dev
sudo apt-get install libglib2.0-dev
./configure --prefix=/usr
make
sudo make install
I had to install zlib1g-dev and libglib-2.0-dev due to the following errors during the configure script:
Error: zlib check failed
Make sure to have the zlib libs and headers installed.glib-2.0 required to compile QEMU
Sources:
https://wiki.linaro.org/Platform/DevPlatform/Ubuntu/ImageInstallation
http://www.linaro.org/downloads/
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
The overo image is the same as the beagle but it has a built in ethernet port that is emulated.
For keyboard and mouse you need to add the qemu command line options to say “plug in a USB mouse and keyboard” — that’s the ‘-device usb-kbd -device usb-mouse’ part on the wiki page you link to. Otherwise it’s like running a real beagle board with no mouse plugged in! You will also find that your SD card performance is much better if you use ‘-drive file=./beagle_sd_all_x11.img,if=sd,cache=writeback’ instead of ‘-sd ./beagle_sd_ali_x11.img’. Finally, while you’re waiting for the next qemu-linaro release you can use the ‘overo’ model instead — this is another OMAP3 board like the beagle, but it has working… Read more »
@Peter Maydell
Thanks Peter and Fred. I’ve updated the blog post based on your comments.
What’s the beagleboard? I’m sorry I’m a newbie about linux
Hi Virgie,
The Beagleboard is a low cost single board computer based on Texas Instrument OMAP3 processor.
It’s used by developers and hobbyist.
For details http://beagleboard.org/.
Thanks for the tutorial! The mouse and keyboard worked just fine for me, without having to compile from source. Do you know how to run a similar emulator with android releases?
@Rob
I haven’t tried, but if you go to http://www.linaro.org/downloads/ at the bottom there is an Android build for Beagleboard. So it should also be possible to create a qemu image for that.
Thanks for this great tutorial! I’m trying to simulate a Beagleboard xM to see if it fits my needs before I purchase. Do you know how to get networking setup either with the ALIP version or the 11.09 linaro release?
Hi Brett, Networking is not enabled for Beagleboard-xM, you’ll have to wait for October release of qemu or you can simply run qemu for overo (this is similar): http://www.cnx-software.com/2011/09/20/emulate-gumstix-overo-com-with-qemu-and-linaro-nano-image/. This post shows how to do with nano but you can use alip instead. I use overo emulating for now, until the next release of qemu. They have fixed it yesterday (https://bugs.launchpad.net/qemu-linaro/+bug/656530): This is now fixed for the beagle model in qemu-linaro 2011.10. To enable USB networking, run the model with extra command line arguments “-usb -device usb-net,netdev=mynet -netdev user,id=mynet”. This should cause the kernel to automatically load the cdc_ether module.… Read more »
Finally, Linaro QEMU 2011.11 has just been released and ethernet can be enabled in beagleboard qemu by adding “-usb -device usb-net,netdev=mynet -netdev user,id=mynet” to qemu-system-arm command line.
http://www.linaro.org/linaro-blog/2011/10/13/linaro-qemu-2011-10-released/
Hello! Following this tutorial I got this:
sudo qemu-system-arm -M beagle -m 256 -sd ./beagle_sd.img -clock unix -serial stdio
Could not initialize SDL(No available video device) – exiting
Any ideas? I don’t need graphics, just the CLI.
Running in a ubuntu server in vbox on mac
@Gustav
You may want to add -nographic to the command line.
Hey!
I just can’t create the linaro imagem 🙁 i’m using “sudo linaro-media-create –image_file beagle_sd.img –dev beagle –binary nano-n-tar-20110823-1.tar.gz –hwpack hwpack_linaro-omap3_20110823-0_armel_supported.tar.gz”
And the linaro returns me: “linaro-media-create: error: argument –hwpack is required”
What can I do?
@Gláuber
Sorry, there was a problem with formatting in this post, and double dash, where converted to single dash. I’ve corrected it, so the line is actually:
@Jean-Luc Aufranc (CNXSoft)
Thank you!
How can I install Angstrom Linux in this QEmu simulation of BB?
@Gláuber
Not sure, I suppose you could try to find angstrom rootfs and use it instead of alip-n-tar-20110823-1.tar.gz to create the SD card image with linaro-media-create.
@Jean-Luc Aufranc (CNXSoft)
Now, after running the “sudo linar-media, bla bla bla
My system noticed that doesnt have any bootloader…
What should I do?
@Gláuber
Sorry, I don’t know enough details about Angstrom and the linaro-media-create tools… You’ll need to find out what’s inside alip-n-tar-20110823-1.tar.gz, and try to reproduce something similar with Angstrom, this may require some reading on Linaro website.
No, im getting this error without using Angstrom!
I’m using your image
“qemu: hardware error: no boot device found
CPU #0:
R00=00000000 R01=00000000 R02=00000000 R03=00000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=00000000 R14=00000000 R15=400140a4
PSR=400001d3 -Z– A svc32
“
@Gláuber
Ah ok. Those instructions are a bit old, so I’m not sure they still work.
Does it say anything before the log you showed me?
No, but when I install all packages i get this log:
if cls.bootloader_copy_files is None:
AttributeError: type object ‘BeagleConfig’ has no attribute ‘bootloader_copy_files’
sudo qemu-system-arm -M beagle -m 256 -sd ./beagle_sd.img -clock unix -serial stdio
runing this command showa error
I get a black QEMU screen instead of the screen mentioned above when I use ALIP image in qemu for Beagleboard. Please help..!!
It doesn’t work on Ubuntu 12. I have tried to find linaro for ubuntu 12 (http://releases.linaro.org/platform/linaro-n/ubuntu-desktop) but there are version from 11.04-11.09. unfortunately these ubuntu version are not downloadable. is there any solution to run this on ubuntu 12 or older ubuntu (11.04 for example – http://old-releases.ubuntu.com/releases/11.04/)?
Thank
@Lukas
It should be possible to run the command by separating the kernel and rootfs like I’ve done for the Raspberry Pi http://www.cnx-software.com/2011/10/18/raspberry-pi-emulator-in-ubuntu-with-qemu/ (Skip the kernel build and debootstrap part).
You can just extract the kernel in the 11.08 image, and download Ubuntu 12 armhf rootfs from Linaro.
Hi supporter, I have run the command and received this error message. Please give me the instruction udo qemu-system-arm -M beagle -m 256 -sd ./beagle_sd.img -clock unix -serial stdio VNC server running on `127.0.0.1:5901′ qemu: hardware error: no boot device found CPU #0: R00=00000000 R01=00000000 R02=00000000 R03=00000000 R04=00000000 R05=00000000 R06=00000000 R07=00000000 R08=00000000 R09=00000000 R10=00000000 R11=00000000 R12=00000000 R13=00000000 R14=00000000 R15=400140a4 PSR=400001d3 -Z– A svc32 s00=00000000 s01=00000000 d00=0000000000000000 s02=00000000 s03=00000000 d01=0000000000000000 s04=00000000 s05=00000000 d02=0000000000000000 s06=00000000 s07=00000000 d03=0000000000000000 s08=00000000 s09=00000000 d04=0000000000000000 s10=00000000 s11=00000000 d05=0000000000000000 s12=00000000 s13=00000000 d06=0000000000000000 s14=00000000 s15=00000000 d07=0000000000000000 s16=00000000 s17=00000000 d08=0000000000000000 s18=00000000 s19=00000000 d09=0000000000000000 s20=00000000 s21=00000000 d10=0000000000000000 s22=00000000 s23=00000000 d11=0000000000000000 s24=00000000… Read more »
@Nghia Bui
Try it in Ubuntu 11.04.
Thanks for your reply. Will it work with ubuntu 12.04? and in 32 bit or 64 bit version??
And will new ubuntu will fix the error message:
“qemu: hardware error: no boot device found
CPU #0:
R00=00000000 R01=00000000 R02=00000000 R03=00000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=00000000 R14=00000000 R15=400140a4
PSR=400001d3 -Z– A svc32
Thanks
@Nghia Bui
The honest is answer is “I don’t know, you have to try”.
@Jean-Luc Aufranc (CNXSoft) Thank for reply, but where to download Ubuntu 12 armhf rootfs from Linaro? And what does means “You can just extract the kernel in the 11.08 image”? Sorry for stupid questions I am lost in it. I did steps described above in Ubuntu 12 32bit, qemu seems to work but during linaro-media-create some errors occured (error with /bin/df) and then there were some problems with image(disk) geometry (?) at the end. Ubuntu 12 show even crash of linaro-media-create. beagle_sd.img was created but I think it is not useable – i will got same error as Nghia Bui… Read more »
Sorry, I meant you are sure that it work fines in Ubuntu 11.04, right?. But which env, 32 or 64 bit?
@Lukas
For the rootfs download: http://www.linaro.org/downloads/
The kernel must be in hwpack_linaro-omap3-x11-base_20110823-0_armel_supported.tar.gz.
@Nghia Bui
I guess it should. I used Ubuntu 11.04 32-bit at the time.
@Jean-Luc Aufranc (CNXSoft)
I have still problems to create img file. Is it possible to do it for qemu running under Ubuntu 12? There are some problems with packages dependencies (cpp-4.5 : Depends: gcc-4.5-base (= 4.5.2-8ubuntu4) but 4.5.3-9ubuntu1 is to be installed ….). I got same error with Ubuntu 11.10.
I downloaded these packages:
hwpack_linaro-omap3-x11-base_20110823-0_armel_supported.tar.gz
http://releases.linaro.org/12.03/ubuntu/oneiric-images/nano/linaro-o-nano-tar-20120327-1.tar.gz
I am not sure second package is right for me.
It worked. Thank you alot!
linaro-media-create: error: argument –hwpack is required
Good Morning
I created the image beagle_sd_alip_x11.img and I tried to turn it on ebv beagle board.
I have a small probleme the keyboard and mouse are not not FUNCTIONAL and when i rebbot the ebv beagle board i get console mode not graphic mode like the first boot
I need your help for this probleme and thank you
@Nermine
I’m a little confused. Do you actually have a board? Those instructions are for people not owning a board. I don’t own a Beagleboard myself.
@Jean-Luc Aufranc (CNXSoft)
Yes I have a ebv beagle Borad , My probleme is when ebv boot in th MMC card, the mouse and keyboard not FUNCTIONAL
@Jean-Luc Aufranc (CNXSoft)
and i use this instruction for generation of the MMC card :
zcat ./beagle_sd_alip_x11.img.gz |sudo dd bs=4M of=/dev/sde ; sudo sync
I tried adding “-usb -device usb-net,netdev=mynet -netdev user,id=mynet” to qemu-system-arm command line, but QEMU start and it crashes right away. I also tried usb_add net:vlan on monitor after adding -net tap at the qemu-system-arm command line but QEMU crashes everytime it tries to connect the vlan to the usb-net device.
Have you any idea waht could be going wrong?
Hi, I am trying to create a n image using following command: sudo linaro-media-create –image_file beagle_sd.img –image-size 128M –dev beagle –binary nano-n-tar-20110823-1.tar.gz –hwpack hwpack_linaro-omap3_20110823-0_armel_supported.tar.gz But I got an error message: Cleaning up …Done proc umounted Traceback (most recent call last): File “/usr/bin/linaro-media-create”, line 206, in verified_files, extract_kpkgs, *hwpacks) File “/usr/lib/pymodules/python2.7/linaro_image_tools/media_create/chroot_utils.py”, line 89, in install_hwpacks hwpack_force_yes or hwpack_verified) File “/usr/lib/pymodules/python2.7/linaro_image_tools/media_create/chroot_utils.py”, line 129, in install_hwpack cmd_runner.run(args, as_root=True, chroot=chroot_dir).wait() File “/usr/lib/pymodules/python2.7/linaro_image_tools/cmd_runner.py”, line 100, in wait raise SubcommandNonZeroReturnValue(self._my_args, returncode) linaro_image_tools.cmd_runner.SubcommandNonZeroReturnValue: Sub process “[‘chroot’, ‘/tmp/tmphZZUgU/rootfs/binary’, ‘linaro-hwpack-install’, ‘–hwpack-version’, ‘20110823-0’, ‘–hwpack-arch’, ‘armel’, ‘–hwpack-name’, ‘linaro-omap3’, ‘/hwpack_linaro-omap3_20110823-0_armel_supported.tar.gz’]” returned a non-zero value: 100 Could someone please let me know how… Read more »
Hi,
Is it possible to run the image generated by Yocto toolchain using qemu-system arm?
Regards,
Veeresh
@Veeresh
You can generate a qemu image with Yocto.
If you want to run a Yocto image built for an ARM platform supported by QEMU, it may also work
You can do something similar to what I’ve done in the post below, except with newer version and selecting an ARM platform instead of x86
http://www.cnx-software.com/2012/02/09/yocto-project-quick-start-guide-for-ubuntu/
@Jean-Luc Aufranc (CNXSoft)
I have already tested the qemu images generated with yocto… Now I have built a beaglebone image (core-image-minimal) using yocto… My question is if i can run this beagle bone image on qemu? I am sure it cant be done directly.. but since linaro guys have developed some tools like linaro-image-create, is it possible to run this tool on the yocto generated image and format it as qemu requires?
Sorry for not being clear enough earlier…
@Veeresh
I’d assume it could run directly. Have you tried? Otherwise you could pass the kernel and rootfs files in the command line.
Not sure how to do though. It’s been a while I haven’t used qemu (directly) with all these low cost boards on the market now.
When i execute the following command:
sudo qemu-system-arm -M beaglexm -m 512 -sd ./bbxm_boot_sdcard.img -clock unix -serial stdio
I get an error : qemu-system-arm: -M beaglexm: Unsupported machine type
Use -machine help to list supported machines!
beaglexm is not present in the list of supported machines.
What do i do?
@Debajyoti Majumdar
The instructions are a bit old. It’s quite possible Linaro does not include Beagleboard-xM supports in their qemu fork anymore. Somebody provided instructions to build it yourself. See last answer @ http://stackoverflow.com/questions/28564692/set-up-beagleboard-emulator-with-qemu-in-ubuntu
@Jean-Luc Aufranc (CNXSoft)
hey thanks!
Another doubt: I am trying to run RTEMS on qemu, and bbxm_boot_sdcard is the RTEMS image, but when i execute the following command am I just invoking the linaro or am I running RTEMS as well?
sudo qemu-system-arm -M beaglexm -m 512 -sd ./bbxm_boot_sdcard.img -clock unix -serial stdio
i am not getting linaro- tools for bionic ubuntu ?
Those instructions are close to 9 years old, and they may still work, but the PPA has last been updated 186 weeks ago.
What kind of error do you get?