1 Running Etherboot within qemu
2 =============================
4 Michael Brown <mbrown@fensystems.co.uk>
6 To get qemu running is fairly simple:
8 1. Build the utilities in this directory:
11 2. Get the qemu source code:
12 cvs -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/qemu \
14 cvs -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/qemu \
17 2a. Patch the qemu code. There is currently a bug that causes qemu to
18 execute Etherboot incredibly slowly. The bug seems to be related
19 to the relative prioritisation of CPU and I/O operations within
20 qemu. This patch (which I found via Google) isn't a proper fix,
21 but it does work around the problem:
22 patch -p0 < qemu-patch
24 3. Configure qemu with
26 ./configure --enable-system
29 Note that qemu will not compile with gcc4; if your system's
30 default compiler is gcc4 then specify the path to gcc3 using
36 5. As root, set up a TAP virtual network device:
38 chmod o+rw /dev/net/tun
39 ./tunctl -u <username> -t tap0
40 /sbin/ifconfig tap0 up 10.254.254.2 netmask 255.255.255.0
42 6. As root, add the following fragment to /etc/dhcpd.conf:
43 subnet 10.254.254.0 netmask 255.255.255.252 {
44 range dynamic-bootp 10.254.254.1 10.254.254.1;
46 You will also need to add in any of your usual declarations for
47 Etherboot, e.g. 'filename "vmlinuz.ltsp";'. Note that this setup
48 assumes that your DHCP server, TFTP server etc. all live on the
49 machine you are using for running qemu. If not, then you're on
52 7. As root, restart dhcpd
53 /etc/init.d/dhcpd restart
55 8. Build Etherboot floppy disk images and pad to 1.44MB
61 export SDL_VIDEO_X11_DGAMOUSE=0
62 ./qemu/i386-softmmu/qemu -L qemu/pc-bios \
63 -net nic,model=rtl8139 -net tap,ifname=tap0 \
64 -boot a -fda ../../src/bin/rtl8139.pdsk
66 You should see qemu start up, load up Etherboot and attempt to boot
74 You can use the program "serial-console" to obtain a virtual serial
75 console for Etherboot running within qemu. Run "./serial-console" on
76 a spare tty (e.g. a separate xterm window) before starting qemu, and
77 ensure that you have enabled CONSOLE_SERIAL in config.h.
79 When serial-console starts, it will print out the message "Slave pty
80 is /dev/pts/XX", where XX is a number. You need to append the option
84 to the qemu command line.
86 There is a manual page for "serial-console"; use "man
87 ./serial-console.1" to view it.