german translation: http://wiki.skolelinux.de/HowTo/TestCDinstallation

How to test Debian Edu CD/DVDs with Qemu

There are three steps required to test the debian edu installation.

The first step can be done using HTTP, FTP or rsync. For repeated testing it is best to use rsync, as it will only transfer the changes between DVD versions instead of the entire DVD. The second step can either be done using a real machine, or in a virtual machine like qemu or vmware, and the last step is fairly straight forward.

Fetching the DVD image

There are a few slightly different DVD/CD images being generated, the sarge and etch images are the ones indented for new releases, and the sarge-test and etch-test images are the ones with new packages to be tested before they are move into the DVD/CDs indended for a new release.

In these examples I use etch-test as the sample image. Replace that string with sarge, sarge-test or etch if you want to use another image.

Using rsync

rsync -vt ftp.skolelinux.no::cd-etch-test-dvd/debian-edu-amd64-i386-powerpc-DVD-1.iso debian-edu-amd64-i386-powerpc-DVD-1.iso

Using HTTP and FTP

wget http://ftp.skolelinux.org/cd-etch-test-dvd/debian-edu-amd64-i386-powerpc-DVD-1.iso
ncftp ftp ftp://ftp.skolelinux.org/cd-etch-test-dvd/debian-edu-amd64-i386-powerpc-DVD-1.iso

There is also netinst CDs available using the cd-etch-test, cd-etch-test-amd64 and cd-etch-test-powerpc directories.

Prepare a test machine

Preparing and booting a qemu machine

First, install a few extra packages. This part need to run as root. The kqemu part is to speed up the qemu execution.

sudo aptitude install qemu


sudo aptitude install kqemu-source kqemu-common
sudo module-assistant prepare
sudo module-assistant build kqemu-source
sudo module-assistant install kqemu-source
# or simply: sudo aptitude install kqemu-modules-2.6-686 kqemu-common

sudo modprobe kqemu && sudo sh -c 'echo kqemu >> /etc/modules'

Then create a 6 GiB virtual disk used to install into.

qemu-img create virtual-hda 6G

Doing the installation

Finally start the qemu instance first booting from the DVD image with 128 MiB of RAM, and next boot from the virtual hard drive.

qemu -m 128 -boot d -cdrom debian-edu-amd64-i386-powerpc-DVD-1.iso -hda virtual-hda

This should be fairly straight forward. Note that a full disk on the machine hosting qemu will appear as failing hardware (broken disk) in qemu.

To enable manual partitioning and the barebone profile option, boot using "linux debian-edu-expert" on the first prompt. To get full manual control over the installation, boot using "expert" on the first prompt.

Running the Machine

After you complete the installation, the machine reboots. But to do this in qemu you basicaly run qemu again using a different boot device.

qemu -m 128 -boot c -cdrom debian-edu-amd64-i386-powerpc-DVD-1.iso -hda virtual-hda

Don't forget to write [:DebianEdu/HowTo/BugReports: bugs] about new issues you discover.

To test an LTSP client on a installed thin client server, there is a script /usr/share/doc/ltsp-server/examples/qemu-ltsp that can be executed within the qemu instance to start a thin client as a virtual machine within the virtual machine.

Setting up a virtual qemu network

Tips on how to do that is available from [http://www.h7.dion.ne.jp/~qemu-win/HowToNetwork-en.html How to use qemu Network]

Test LTSP with two qemu instances

With help from etherboot qemu can do network pxe boots. In order to be able to boot LTSP that way the two qemu instances (one for the terminal-server and one for the thinclient) need to share a network. Qemu has multiple options to do that. The easiest is to use tcp-connections between the instances. For this to work one qemu needs to listen on tcp-sockets and the other one connects to it.

To get the terminal-server qemu provide two network interfaces and listen on tcp sockets, the following network options could be used:

.... -net nic,vlan=10 -net socket,listen=127.0.0.1:4242,vlan=10 -net nic,vlan=20 -net socket,listen=127.0.0.1:4243,vlan=20 

This make eth0 available on port 4242 and eth1 on port 4243.

For the thinclient to boot over network an etherboot image is needed. With the ROM-o-matic.net service they can be generated on the fly. To get an image go to http://rom-o-matic.net/5.4.3/ and select "ns8390:rtl8029 -- [0x10ec,0x8029]" at "1. Choose NIC/ROM type". The easiest way to boot it, is to "ISO bootable image without legacy floppy emulation (.iso)" at "2. Choose ROM output format". Then click on "Get ROM" and save the iso image.

Qemu can then be booted like this:

qemu -cdrom <pathtotheiso> -boot d -m 256 -net nic -net socket,connect=127.0.0.1:4243

This qemu thinclient is a bit slow (no really, it's even slower :), so bring some time with you when you want to do this.

It took > 15 minutes to boot a LTSP client with qemu on a Thinkpad X60s with dual core T2400 processor.