Francisco Benitez Leon's Blog

February 5, 2010

Installing Debian Lenny on virtualized ARM arch (with QEMU) on Ubuntu Karmic Koala

Filed under: ARM, Virtualization — Tags: , — Francisco Benitez Leon @ 11:42 pm

Yesterday I played with QEMU in order to run a Debian Lenny distro on a virtualized ARM arch.  The Debian installation was easy thanks to this post of Chris Dew. I just wanted to point out what I did to get the virtual machine running after installing the distro.

First, I’ll summarize his post because I changed one of his steps.

  1. Download the ARMEL kernel image and installer (initrd image) from a Debian Lenny repository.

    $ wget http://ftp.de.debian.org/debian/dists/lenny/main/installer-armel/current/images/versatile/netboot/initrd.gz
    $ wget http://ftp.de.debian.org/debian/dists/lenny/main/installer-armel/current/images/versatile/netboot/vmlinuz-2.6.26-2-versatile
  2. Create a disk image but use the raw format so you could mount it on your system after the installation process has finished.

    $ qemu-img create -f raw hda.img 1G
  3. Start QEMU and follow the usual Debian installation instructions.

    $ qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.26-2-versatile \
    -hda hda.img -initrd initrd.gz -append "root=/dev/ram" -m 256

At the end of the installation process you will get a message pointing that Grub hasn’t been installed but don’t worry because QEMU is capable of loading the kernel and initrd images so the machine could boot up.

After the installation has ended you will need another initrd to run the machine, remember that the one previously used contains the Debian installer. You can get that from the installed distro. So, mount the created disk on your system (that’s why you needed to create it in raw format) and copy the image from the boot directory.

$ sudo mkdir -p /mnt/arm_qemu
$ sudo mount -o loop,offset=32256 hda.img /mnt/arm_qemu
$ sudo cp /mnt/arm_qemu/boot/initrd.img-2.6.26-2-versatile .
$ sudo umount /mnt/arm_qemu

You can run the machine with the following command.

$ qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.26-2-versatile \
-initrd initrd.img-2.6.26-2-versatile -hda hda.img -append "root=/dev/sda1"

Create a free website or blog at WordPress.com.