If you are running Fedora 7/8, you can just install qemu using yum.
You can skip this section if you are going to use a local loopback device for your root file system. However that may prevent you from using yum to install new packages on your Fedora-ARM guest.
Networking is setup between the host system and the QEMU guest to allow the guest to get its IP address using DHCP.
The networking setup uses host TAP devices to connect to QEMU. In recent kernels, this requires CAP_NET_ADMIN capability. The host system needs to have TUN/TAP networking enabled (CONFIG_TUN=m or CONFIG_TUN=y). You can verify this using:
Also make sure that /dev/net/tun exists. If not, you can make it as follows:
Now, we need to set up a network bridge interface. Install some utilities to configure a ethernet bridge:
Also, create a script qemu-ifup as follows. This will be needed when we boot into QEMU.
Setup Kernel Image
You can either simply use a pre-built kernel image or build your own from source.
Pre-built Kernel Image
You can get one of the following pre-built kernel images for ARM:
1. zImage-versatile-2.6.24-rc7.armv5tel
1. zImage-versatile-2.6.23-rc4
1. zImage-versatile-2.6.22
Build Kernel Image From Source
You will need to have an ARM cross-compiler. If you do not have one, download one from CodeSourcery's web-site, install it and ensure that is it in your path.
export arch=ARM
export CROSS_COMPILE=arm-none-linux-gnueabi-
You can also use the Fedora cross toolchain that we provide.
Download Linux kernel (I have tested it with 2.6.21 and 2.6.22) and build it for ARM Versatile board. But, first you will have to customize the defconfig for it to work correctly.
cp arch/arm/configs/versatile_defconfig .config
make menuconfig
Enable DHCP Support (CONFIG_IP_PNP_DHCP). It is under Networking -> Networking Support -> Networking Options ->
TCP/IP Networking -> IP: Kernel Level autoconfiguration.
Enable Universal Tun/Tap Driver Support (CONFIG_TUN). It is under Device Drivers -> Network Device Support ->
Network Device Support.
Enable ARM EABI Support (CONFIG_AEABI). It is under Kernel Features.
Enable tmpfs support (CONFIG_TMPFS). It is under File Systems -> Pseudo File Systems.
If you will be booting from a file system image (not NFS), then the following steps should also be taken:
Enable PCI support (CONFIG_PCI). It is under Bus Support.
Enable SCSI Device Support. It is under Device Drivers -> SCSI Device Support.
Enable SCSI Disk Support. It is under Device Drivers -> SCSI Device Support.
Enable SYM53C8XX Version 2 SCSI Support. It is under Device Drivers -> SCSI Device Support -> SCSI low-level drivers
Build the kernel.
make
Setup Root File System
Download the root file system tarball . It is approximately 93MB in size.
Root File System On Loopback Device
Create a loopback device -- 4GB is a reasonable size.
dd if=/dev/zero of=rootfs-f8-dev bs=1024k count=4096
Create a file system.
mkfs.ext3 rootfs-f8-dev -L arm
Prepare the root file-system. This assumes that the loopback device is mounted under /mnt/ARM_FS.
mount rootfs-f8-dev /mnt/ARM_FS -o loop
tar -xjf rootfs-f8.tar.bz2 -C /mnt/ARM_FS
mv /mnt/ARM_FS/rootfs-f8/* /mnt/ARM_FS
rm -rf /mnt/ARM_FS/rootfs-f8
umount rootfs-f8-dev
Root File System Over NFS
This assumes that the root file system is in /mnt/ARM_FS. We need to export it through NFS. Add the following in your /etc/exports.
/mnt/ARM_FS/ *(rw,sync,no_root_squash)
Now, restart the NFS service.
/sbin/service nfs restart
Boot into QEMU
Now you are ready to boot into QEMU. Replace <host-ip> with the IP address of the host machine.
qemu-system-arm -M versatilepb -kernel zImage-versatile -append root="/dev/nfs nfsroot=<host-ip>:/mnt/ARM_FS rw ip=dhcp" \
-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=./qemu-ifup