logo
background
 Home and Links
 Your PC and Security
 Server NAS
 Wargames
 Astronomy
 PhotoStory
 DVD making
 Raspberry Pi
 PIC projects
 Other projects
 Next >>

Preparing your scripts using QEMU

Preparing your scripts using QEMU

It's about 10x faster and a lot easier to develop and test software on a PC than on the Pi. To test Pi software, we have to 'emulate' the Pi on the PC. That means running a 'Virtualisation' system, such as QEMU.

As with most emulations, the whole thing is a REAL PAIN to get running, however once it's working you will never look back ..
 
There are lots of useful on-line guides - however it's a 'good idea' to read more than one (even those bloggers who have actually 'done it for real' somethimes leave out vital steps = and more than one author forgets to mention that they are running on QEMU over Umbuto (or even some version of Mac OS) rather than the "so common it's always assumed" Windows (althoug when they explain how to install/launch QEMU using 'command-line' syntax it's usually a dead give-away :-) )
 
I started with this one (althouh the author appears to be hosting QEMU on Umbuto :-) )
 
Although out-dated, I also found this PCsteps guide was very useful
 
I even found this guide from Microsoft !, although, again, it's rather out-of-date
 
Be aware that, as usual for anything Linux, there are very few 'working combinations' of the 3 main components (QEMU, ARM kernel, Jessie). If you depart from a 'known working set', you will be in for days (or weeks) of painful 'experimentation' with various different version of all 3 until you manage to hit on another 'needle in a haystack' working combination<

The last version of QEMU for Windows XP (and SDL) was 2016-10-16 = earlier versions are reported to have problems 'booting' Jessie, so this is one we have to start with.

Dowload 'qemu-system-arm' for the Pi = qemu-w32-setup-20161016.exe.
 
Decide which version of Raspbian you are ging to use, and download it eg. Jessie '2016-05-27-raspbian-jessie-lite.img'
 
Get the latest QEMU 'kernal' (or at least one that supports whatever version of Jessie you plan to use) from https://github.com/dhruvvyas90/qemu-rpi-kernel
 

Filesystem image This step is optional, but recommended When you download the Raspbian image it will be in the raw format, a plain disk image (generally with an .img extension). A more efficient option is to convert this to a qcow2 image first. Use the qemu-img command to do this: qemu-img convert -f raw -O qcow2 2017-08-16-raspbian-stretch-lite.zip raspbian-stretch-lite.qcow Now we can also easily expand the image: qemu-img resize raspbian-stretch-lite.qcow +6G You can check on your image using the qemu-img info command

Next subject :- Pi Zero gamer keyboard

[top]