[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ next ]

Using qemu syscall emulation with Debian.
Chapter 3 - Setting up an environment


3.1 Prerequisite

To setup the environment the way I describe, you will need a directory with around 150Mb of free space. However, once you are more experienced with the process you can use much less disk space. On my box, this directory is /scratch/qemu. I install a arm environment in /scratch/qemu/ARM by running the command below in the /scratch/qemu directory. I use the mirrror http://ftp.fr.debian.org/debian. Be sure to pick a mirror that include arm binaries (If you do not specify a mirror, it will use http://ftp.debian.org/debian which do not include the arm binaries) To bootstrap the environment, you can use either debootstrap or cdebootstrap, they are very similar.


3.2 Using debootstrap

The command is

     fakeroot /usr/sbin/debootstrap --arch arm sid ARM http://ftp.fr.debian.org/debian

This will download arm debs and unpack them. This should fail with

     W: Failure trying to run: chroot /scratch/qemu/ARM mount -t proc proc /proc

because you are not root. (If you are root this will fail anyway since you cannot execute the binaries).

Now, finish to unpack the debs

     for pkg in ARM/var/cache/apt/archives/*.deb; do \
     echo "Extracting $pkg..."; dpkg-deb -x $pkg ARM; done

3.3 Using cdebootstrap

The command is

     fakeroot cdebootstrap --flavour=standard --arch arm sid ARM http://ftp.fr.debian.org/debian

This will download arm debs and unpack them. This should fail with

     E: can't mount proc

because you are not root. (If you are root this will fail anyway since you cannot execute the binaries).

Now, finish to unpack the debs

     for pkg in ARM/var/cache/bootstrap/*.deb; do \
     echo "Extracting $pkg..."; dpkg-deb -x $pkg ARM; done

3.4 Testing your qemu installation

Now you can try qemu with

     qemu-arm -L /scratch/qemu/ARM ARM/bin/ls

The -L option cause qemu to use an alternative root for finding the dynamic loader and the C library. It requires an absolute pathname.

You can also try

     qemu-arm -L /scratch/qemu/ARM ARM/bin/sh

Programs you launch from that shell will be native programs unless you run them through qemu-arm itself.

You can check network access with

     qemu-arm -L /scratch/qemu/ARM ARM/usr/bin/wget www.debian.org

[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ next ]

Using qemu syscall emulation with Debian.

version 0.2, 20 avril 2006
Bill Allombert ballombe@debian.org