In this post I will explain how to install Debian Armel under QEMU.
Well, there are various reasons to you have a ARM Linux distro inside a Virtual Machine. One of them would be to have a test environment to you validate your programs before to release to an embedded linux (ARM).
Debian was choosed because is the most supported ARM distro and you will have an compatible environment with your embedded system (eglibc).
Hey! Ho! Let’s go:
- Download a ARM kernel and a vmlinuz image under debian.org FTP site (I choosed squeeze/testing flavor):
wget http://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/versatile/netboot/vmlinuz-2.6.32-5-versatile wget http://ftp.debian.org/debian/dists/testing/main/installer-armel/current/images/versatile/netboot/initrd.gz
- Create a disk image (please, create a raw disk! It will be useful future):
qemu-img create -f raw debian.img 10G
- Start Debian image using qemu:
qemu-system-arm -m 256 -M versatilepb -kernel vmlinuz-2.6.32-5-versatile -initrd initrd.gz -hda debian.img -append "root=/dev/ram"
- After install Debian in the disk image, we will mount the contents of disk image:
sudo kpartx -av debian.img sudo mount /dev/mapper/loop1p1 ./mnt/ -o loopPS: I installed Debian with one only partition (/dev/sda1 is my root filesystem). Kpartx is needed because my disk image has 2 partitions (root filesystem and swap)
- Copy the initrd image and the kernel to your system (outside of mountpoint). These two files will be used to start our Debian installation:
cp ./mnt/boot/initrd.img . cp ./mnt/boot/vmlinuz-2.6.32-5-versatile .
- Now, we can start Debian image installed in the disk image:
qemu-system-arm -m 256 -M versatilepb -kernel vmlinuz-2.6.32-5-versatile -initrd initrd.img -hda debian.img -append "root=/dev/sda1"
In the next posts I will talk about ARM architecture, toolchains, cross compilers and embedded linux.





Very good, thanks for the information.
Excellent post, congratulations!!!!
You’re welcome
Hi richizo,
, but I am trying to use qemu for cortex-a8 emulation a don’t work with image and kernel debian,
I used your guide and work it
my qemu version is 0.14.
My uname -a:
Linux laptop 2.6.32-31-generic #61-Ubuntu SMP Fri Apr 8 18:24:35 UTC 2011 i686 GNU/Linux
$ qemu-system-arm -m 256 -M versatilepb -cpu cortex-a8 -kernel vmlinuz-2.6.32-5-versatile -initrd initrd.gz -hda debian.img -append “root=/dev/ram”
result in vnc: Just Black screen!
So, I want to do it with Debian, but I couldn’t, I searched with ubuntu, I tried of lot of ways with lucid armel kernel and image in this link:
http://ports.ubuntu.com/ubuntu-ports/dists/lucid/main/installer-armel/current/images/versatile/netboot/
$ qemu-system-arm -m 256 -M versatilepb -cpu cortex-a8 -kernel vmlinuz -initrd initrd.gz -hda ubuntu.img -append “root=/dev/ram”
result in vnc: it seem to begin fine, but later Kernel panic no root filesystem
Can you help me?
Thanks
Kindly read this link
http://people.canonical.com/~ogra/arm/qemu/
Properly wonderful