I've been playing with QEMU for 47 days now. QEMU is an processor and system emulator written by Fabrice Bellard and released under the GPL(for binaries)/LGPL(for shared objects) licenses. I installed QEMU 0.8.0 on my AMD64/Fedora Core 4 Linux machine and created several guest images and installed different OSes on them, including several flavors of Linux and Windows.
By far the most challenging and the most fun OS to install and work with is MS Windows 3.1:
QEMU emulates a whole PC system with a Pentium II processor, PCI bus, a CirrusLogic graphics card, SoundBlaster 16 sound card, floppy drive, IDE hard drive, CD-ROM, and an Ethernet card. QEMU also provide the emulated system with a DHCP server and a SMB server.
The QEMU download for Linux is only 2.6MB in size, not as overwhelming as VMWare Server's 207MB total download. The QEMU documentation is extremely clear and helpful. The QEMU Users Forum is also a good source of information. (The MacOSX group is very active.)
To get started with the Windows 3.1 installation, all I have to do is:
QEMU will create the hard drive image, and start booting from the floppy drive. From that point on, everything proceeds exactly as if I'm building a new machine, with one exception—QEMU can't detect floppy disk or CD-ROM disk changes. In addition to the physical act, I have to switch to the QEMU console (Ctrl-Alt-2) and issue commands to tell QEMU that the floppy disk has been changed:
QEMU 0.8.0 monitor - type 'help' for more information
(qemu) eject fda
(qemu) change fda /dev/fd0
My choice of MS Windows 3.1 as the guest OS is part pragmatism and part nostalgic. Pragmatic because it's small—MS-DOS 6.22 comes in three floppies, and MS Windows 3.1 in six. Nostalgic because I spent considerable amount of time there and I haven't seen it for a long time.
I'll spare you with the boring details of setting up a Windows 3.1 box except for noting how primitive it was and how compact it was. Both CD-ROM support and TCP/IP networking are add-ons to the OS. But it runs fine on 8MB of memory. Thanks to the internet, I'm able to find all the hardware drivers and a few applications.
Oh, and finally, for the other six people on earth who also are trying to run Windows 3.1 in either QEMU or VMWare, I have solved the CPU usage reduction problem by writing my own VxD. This is a 32-bit virtual device driver that hooks the Windows primary scheduler's idle event and issues the privileged (ring 0) HLT instruction. It's similar to AMNHLT and DOSIDLE. I'm calling it WQGHLT and am making it available here.
This blog entry is composed in part in Netscape 4.08 for Windows 3.1 over Trumpet WinSock 3.0.