Win XP Virtual Machine with Fedora 7 and KVM

By | September 28, 2007

I’ve been completely Microsoft Windows free at home once again for quite a while since the death of yet another hard drive in a Dell computer with a pre-installed copy of Windows XP Home. This time it was a Dell Inspiron 8600 laptop. There have been a couple of times over the last few months where it would have been convenient to have a Windows install at home so I could test some code to make sure it ran fine on Windows or to run some odd program that is available only on Windows. After upgrading my laptop to 1.5 GB of RAM, I decided to set up a Windows XP virtual machine using the Windows XP reinstallation CD that came with my Dell. For no particularly compelling reason, I decided to use KVM instead of Xen or VMWare. The Fedora project website has a great overview of virtualization options built into Fedora 7, though most of the focus is on Xen.

Setting up the Windows XP VM using KVM and a management tool called virt-manager was amazingly easy. I also benefited from a KVM and Fedora 7 tutorial at Phoronix, which is also home to great info for Linux users like me who have laptops with ATI video cards, but it would have been easy enough to figure out just by running virt-manager.

First, you may need to install a couple of packages:

$ sudo yum -y install kvm qemu virt-manager

If you had to install kvm, you should reboot to load the kvm modules. Once you restart, launch Virtual Machine Manager from the System Tools section of the Applications menu.

One problem I ran into with virt-manager was that it wouldn’t let me browse to the reinstallation CD. I ended up having to copy it to the hard drive into an iso disk image file, but that was easy enough.

$ cat /dev/cdrom > /tmp/winxphome.iso

Also, because the 2004-era Intel CPU in my laptop doesn’t have the Intel VT enhancements that support hardware acceleration of VMs, I had to configure my VM for full virtualization. It’s definitely slower than running native, but it’s still quite usable. I wouldn’t try running Halo in the VM, though.

I was worried when a popup window appeared about thirty minutes into the Windows XP install asking me to insert a CD that contained Service Pack 2. That was baffling, because the XP reinstallation CD claimed to include Service Pack 2. After canceling out of that dialog and stopping and restarting the VM a couple of times, the install continued. After a couple of hours of the installer grinding away with 98% CPU usage, I had a functioning Windows XP VM.

The biggest problem I’ve run into is with the mouse cursor. Frequently, it behaves like it has hit the bottom or the top of the screen, even when it is far from the edge. Perhaps Windows is getting confused about the size of its display window, which appears to be 800×600. The easiest way to work around it is to move the mouse all the way to the edge of the window in the opposite direction. This seems to temporarily help Windows calibrate the screen size. I ran into a similar problem years ago with VMWare, but was able to get past it by installing VMWare Tools. I’m not sure/doubtful there is an equivalent for KVM for Windows guest operating systems.

I haven’t set up a new Windows install for a couple of years, so I forgot how painfully slow it is to install all the anti-virus and anti-malware software, disable the naive user settings that Explorer and other Microsoft apps set up by default, enable the power user settings, and install all the apps and utilities like Firefox that make Windows usable. Setting up a new Linux install is so much easier for me and takes a small fraction of the time. When comparing the time to set up Windows versus Linux (especially for a software developer), you have to keep in mind that Windows comes with only a very basic set of useful tools and applications when compared to a good Linux distribution. The Yum (RedHat/Fedora) and apt (Debian/Ubuntu) packaging tools also make it far easier to install additional applications on a Linux system than on a Windows system. Keeping software up to date on Windows is generally a nightmare compared to Linux.

Leave a Reply

Your email address will not be published. Required fields are marked *