QEMU in Netkit4TIC

The live-{CD,USB} contains the QEMU debian package with accelerator module. Load it:

realHost$ sudo modprobe kqemu; \
          dmesg | tail -n 2
QEMU Accelerator Module version 1.3.0, Copyright (c) 2005-2007 Fabrice Bellard
KQEMU installed, max_locked_mem=639352kB.

In our laboratory experiences we assume that the virtual network where the virtual machine is born is attached to the real machine through a tun/tap device with 192.168.76.1 IP address. So we have modified the qemu startup script as follows:

#!/bin/sh
# /etc/qemu-ifup 
sudo -p "Password for $0:" /sbin/ifconfig $1 192.168.76.1

QEMU use

The process of how to build a QEMU image of the Operating System to virtualize is well documented in the QEMU site and in QEMU forum. We suggest to force the image itself in read only:

realHost# chmod a=r XPPSP2.img; \
          chattr +i XPPSP2.img

Now make a "delta" and than use it:

realHost$ qemu-img create -b XPPSP2.img -f qcow delta-XPPSP2.img; \
            export QEMU_SW="-usb -usbdevice tablet -kernel-kqemu"; \
            export QEMU_NET="-net nic -net tap,ifname=tap0"; \
            qemu -m 140 -hda delta-XPPSP2.img $QEMU_SW $QEMU_NET

We suggest to use tmpfs to speedup QEMU with:

# umount /dev/shm
# mount -t tmpfs -o size=140m none /dev/shm

or adding the following line to /etc/fstab:

# /etc/fstab
[...]
tmpfs   /dev/shm   tmpfs  defaults,size=140m   0   0

QEMU for the free VMware Player

Qemu can be used to create the virtual disk for the free VMware player:

realHost$ qemu-img create -f vmdk Debian.vmdk 2G
Formatting 'Debian.vmdk', fmt=vmdk, size=2097152
Creative Commons License FREE THE MOUSE Valid HTML! Sandro Doro (email me)
Ultima modifica: $Date: 2007-02-10 08:07:17 $