Beagleboard Emulator in Ubuntu with Qemu

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.39

Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc08
CPU revision : 3

Hardware : 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:

Qemu BeagleBoard ARM Linux Internet Platform
ALIP for Beagleboard Running in Qemu

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/

Share this:

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX RK3588 mini-ITX motherboard
Subscribe
Notify of
guest
The comment form collects your name, email and content to allow us keep track of the comments placed on the website. Please read and accept our website Terms and Privacy Policy to post a comment.
51 Comments
oldest
newest
Fred
Fred
13 years ago

The overo image is the same as the beagle but it has a built in ethernet port that is emulated.

Peter Maydell
Peter Maydell
13 years ago

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 »

Virgie Puckett
Virgie Puckett
13 years ago

What’s the beagleboard? I’m sorry I’m a newbie about linux

Rob
Rob
13 years ago

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?

Brett
Brett
13 years ago

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?

Gustav
Gustav
12 years ago

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

Gláuber
Gláuber
11 years ago

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
Gláuber
11 years ago


Thank you!

How can I install Angstrom Linux in this QEmu simulation of BB?

Gláuber
Gláuber
11 years ago

Now, after running the “sudo linar-media, bla bla bla

My system noticed that doesnt have any bootloader…

What should I do?

cnxsoft
11 years ago

@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.

Gláuber
Gláuber
11 years ago

No, im getting this error without using Angstrom!

I’m using your image

Gláuber
Gláuber
11 years ago

“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
Gláuber
11 years ago

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’

santhosh
santhosh
11 years ago

sudo qemu-system-arm -M beagle -m 256 -sd ./beagle_sd.img -clock unix -serial stdio

runing this command showa error

Anubhav
Anubhav
11 years ago

I get a black QEMU screen instead of the screen mentioned above when I use ALIP image in qemu for Beagleboard. Please help..!!

Lukas
Lukas
11 years ago

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

Nghia Bui
Nghia Bui
11 years ago

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
Nghia Bui
11 years ago

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

Lukas
Lukas
11 years ago

@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 »

Nghia Bui
Nghia Bui
11 years ago

Sorry, I meant you are sure that it work fines in Ubuntu 11.04, right?. But which env, 32 or 64 bit?

Lukas
Lukas
11 years ago


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.

Nghia Bui
Nghia Bui
11 years ago

It worked. Thank you alot!

RAHUL RAVI
RAHUL RAVI
11 years ago

linaro-media-create: error: argument –hwpack is required

Nermine
Nermine
11 years ago

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
Nermine
11 years ago

Yes I have a ebv beagle Borad , My probleme is when ebv boot in th MMC card, the mouse and keyboard not FUNCTIONAL

Nermine
Nermine
11 years ago

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

Franc
Franc
11 years ago

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?

Hamed
Hamed
10 years ago

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 »

Veeresh
Veeresh
10 years ago

Hi,

Is it possible to run the image generated by Yocto toolchain using qemu-system arm?

Regards,
Veeresh

Veeresh
Veeresh
10 years ago


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…

Debajyoti Majumdar
Debajyoti Majumdar
8 years ago

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
Debajyoti Majumdar
8 years ago


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

mahesh bhome
mahesh bhome
4 years ago

i am not getting linaro- tools for bionic ubuntu ?

Boardcon Rockchip and Allwinner SoM and SBC products