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"

About these ads

24 Comments »

  1. [...] 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. More here [...]

    Pingback by Ubuntu-News – Your one stop for news about Ubuntu » Blog Archive » Installing Debian Lenny on virtualized ARM arch (with QEMU) on Ubuntu Karmic Koala — February 6, 2010 @ 7:21 pm

  2. [...] 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. More here [...]

    Pingback by Installing Debian Lenny on virtualized ARM arch (with QEMU) on Ubuntu Karmic Koala | Debian-News.net - Your one stop for news about Debian — February 6, 2010 @ 7:23 pm

  3. [...] 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. More here [...]

    Pingback by Debian Linux: Пособие для гопников » Blog Archive » Installing Debian Lenny on virtualized ARM arch (with QEMU) on Ubuntu Karmic Koala — February 6, 2010 @ 8:01 pm

  4. It hung when trying to retrieve file 708 of 789. I checked only the Desktop package. How long is the install (total time) ?
    At least your steps worked somewhat, I tried to install the Debian Etch and it failed when trying to download file from the mirror no matter what site I picked.

    Comment by anhtien — March 3, 2010 @ 1:05 am

    • I’ve tested only the standard system installation so I can’t give you any hints in why the Desktop system is not being installed correctly. I guess you have checked the disk space, the mirrors, etc.
      I haven’t measured the time though I can tell you is a longer process than the usual installation in PCs.
      With regards to your Debian Etch trial, if I recall correctly Etch doesn’t fully support ARM architecture (specifically little Endian). Just in case you haven’t seen it there’s a web page with information regarding Etch ARM problems [1]. There’s also a guide to installing Lenny for ARM [2]

      Regards
      Francisco

      [1] http://www.debian.org/releases/oldstable/arm/release-notes/ch-information.en.html
      [2] http://www.debian.org/releases/stable/arm/

      Comment by Francisco Benitez Leon — March 3, 2010 @ 10:01 am

      • Thanks, Francisco, I tried again and this time did not check any package such as Desktop, web server etc. and it worked.
        I needed to create /mnt/arm_qemu folder before issuing the mount command.
        Nice work, Francisco, thanks.

        Comment by anhtien — March 3, 2010 @ 5:12 pm

        • I’m glad it worked for you. I’ve updated the post to include the creation of /mnt/arm_qemu.

          Thanks

          Comment by Francisco Benitez Leon — March 3, 2010 @ 7:05 pm

          • For some reason, I tried one more time with the Desktop package and it completed the installation as well. I boosted the hda.img to 10G and did not use the -m 256 flag. So I am not sure why it did not work yesterday.
            However, the xserver failed to start due to some incompatibility issue with my graphic card and revert back to non-graphic mode (there goes my Desktop). I will try it at home and see if I run into the same problem.

            Comment by anhtien — March 3, 2010 @ 10:36 pm

          • Same problem, so the Desktop package was not good. It took about 3 hours to install it. I now use the 1GB standard system created before.

            Comment by anhtien — March 4, 2010 @ 7:57 pm

  5. Hi Francisco,

    I need to change the boot logo. Can you provide some info please. My e-mail is “cstrieder@gmail.com”.

    Comment by Cristiano — January 22, 2011 @ 12:53 am

    • Sorry Cristiano I can’t help you. If I recall correctly this could be achieve modifying the Grub configuration file but since Grub isn’t installed I don’t know how to do it.

      Comment by Francisco Benitez Leon — January 23, 2011 @ 8:31 pm

  6. [...] I am dealing with Splashy to show the client logo at boot time. I have followed this tutorial http://franciscobenitezleon.wordpres…-karmic-koala/ In the point of Splashy, it is necessary to add the word "splash" to the kernel's line [...]

    Pingback by Debian or other distro in an ARM 9 machine — January 22, 2011 @ 6:22 am

  7. hello.After the installation and the following command
    $ 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
    I still can’t run the machine with the last command.
    give me some advice.
    many thanks!

    Comment by yyy — August 20, 2011 @ 7:31 am

  8. Sorry for the delay, I can’t guess what the problem is. Did you install the Desktop system? It seems that it doesn’t work.

    Comment by Francisco Benitez Leon — October 8, 2011 @ 12:57 am

  9. I can’t mount the disk file. I got a “mount: you must specify the filesystem” and I’ve tried with all and it doesn’t work

    I ran the fdisk command and got this:

    Disk /home/ffuentes/hda.img: 1 GB, 1069286400 bytes
    255 heads, 63 sectors/track, 130 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /home/ffuentes/hda.img1 * 1 119 955836 83 Linux
    Warning: Partition 1 does not end on cylinder boundary.
    /home/ffuentes/hda.img2 119 131 96390 5 Extended
    Warning: Partition 2 does not end on cylinder boundary.
    /home/ffuentes/hda.img5 119 131 96390 82 Linux swap
    Warning: Partition 5 does not end on cylinder boundary.
    :(

    Comment by ffuentes (@ffuentes_) — October 16, 2011 @ 3:17 am

  10. The last step (running the machine) gave me a segmentation fault. After a quick google I got this: http://balau82.wordpress.com/2010/05/23/qemu-system-arm-segmentation-fault-in-ubuntu-lucid/

    After adding -m switch with the value of 256 (just likeon the 3rd step), it worked!

    Comment by Csaba — December 18, 2011 @ 1:48 am

  11. [...] of searching turned up instructions on setting up QEMU on MS Windows 7, which, in turn linked to instructions on doing the same thing on Debian which I follow [...]

    Pingback by A QEMU image for Debian armel | N0NB — March 8, 2012 @ 3:27 am

  12. hi, anyone can share the hda.img(after installed) to me?
    my email is : johnw.chrome AT gmail DOT com

    Comment by johnw — March 14, 2012 @ 4:30 pm

    • Sorry John I don’t have the images any more. But the installation process is not difficult, you should try it

      Comment by Francisco Benitez Leon — March 15, 2012 @ 8:58 pm

  13. If you have problems mounting the HD image, see:
    http://jozz.no-ip.org/wiki/qemu/debian/boot/image

    Comment by Ken Larson — September 20, 2012 @ 9:57 pm

  14. [...] arm emulation guide adn this one have a little more detail on how to generate and modify the ondisk image, I might want [...]

    Pingback by A Little Ludwig Goes A Long Way » Grab bag of raspberry pi dev info — October 10, 2012 @ 5:40 am

  15. If some one wishes expert view concerning blogging after that i advise him/her to go to see this web site, Keep up the nice job.

    Comment by Eben Pagan Accelerate Bonus — May 20, 2013 @ 6:55 am

  16. Hello my family member! I want to say that this post is awesome, great written and come with approximately
    all vital infos. I’d like to look more posts like this .

    Comment by Darnell — July 28, 2013 @ 3:05 pm


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

The Silver is the New Black Theme. Create a free website or blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: