Previously, we have discussed installation of various Raspberry Pi‘s Operating System. All have been done on the actual board. But what if we are in situation where we can’t afford the board? Emulation sure is the way to experiment and QEMU open the possibility.
Although emulation can make our life easy, you can’t always rely on emulation. Remember that emulation trying to imitate the real hardware, but can’t be the one.
In this article, we will discuss about how to emulate Raspberry Pi board using QEMU. For this purpose I use:
- Windows 8 64-bit as host system
- QEMU 1.4.0
- Soft-Float Debian Wheezy with version 2013-05-29.
For Linux machine, you can go to this article instead.
Obtain the Material
Make sure you have QEMU installed. On Windows, you can follow this article.
Next, download the images. As stated above, we will use Soft Float Debian Wheezy. You can download it from Raspberry Pi’s official download page. The version I use is the 2013-05-29 or latest version per August 24th 2013 and can be downloaded here.
We also require linux kernel for QEMU. Download it from here.
Download and install OpenVPN. This will add a TAP 32 network adapter.
The Hardware – Overview
Before we go to next section, it is always a good idea to understand what system we want to work with. In this case, raspberry Pi. You can see the Architecture of Raspberry Pi for detail.
For the system we will create in using QEMU:
- ARM1176JZF-S, see the datasheet here
Note that QEMU cannot emulate GPIO and GPU.
Also, to encapsulate network we need TAP network for full networking support. See next section.
Preparing the environment
Create a working directory. In this case, qemu-raspberry.
Extract the disk image and kernel image we have downloaded on previous section.
Now open “Network and Sharing Center” and click “Change Adapter Settings” in the left menu.
Rename the TAP 32 network adapter to just TA32 and double click the adapter. Do the settings like this (adjust with your setting):
Now bridge the adaptor with an active connection with the TAP32 adapter.
Next create a file raspberry.bat and fill with following:
qemu-system-arm.exe -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot \ -serial stdio -append "root=/dev/sda2 panic=1" -hda 2013-05-29-wheezy-raspbian.img \ -net nic -net tap,ifname=TAP32
Booting the disc image
Just double click the rasperry.bat and if you did correctly, you will get similar to this: