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:
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 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
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:
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
sudo apt-get install zlib1g-dev
sudo apt-get install libglib2.0-dev
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