Although I’ve moved to Ubuntu Linux, it would still be useful to be able to run certain Windows applications. Sometimes Wine doesn’t quite cut it, so I decided to install a new OEM XP Home SP2 into a virtual machine. There are various instructions on the web explaining how to do this, but I’ve had to mix and match. Here is the technique I used, which does include installation of the VMWare tools.

1. Install qemu.

There is an Ubuntu package for this, so just use Synaptic package installer. (Other instructions say to get the Windows version.) [You need at least version 0.7.1. When I did this, the Ubuntu standard was 0.7.0, which doesn’t support writing vmdk files, so I added the following (temporarily) to my /etc/apt/sources.list and then did an apt-get install qemu).

deb-src http://ftp.uk.debian.org/debian testing main contrib non-free

2. Create virtual disk

Change to the directory where you want to create your VM and do

qemu-img create -f vmdk WindowsXPHome.vmdk 4G

This creates a disk that can expand up to 4GB (the initial file is <300K). Specify a smaller maximum size if you’re short of disk space.

3. Create the config file

In the same directory, create the file WindowsXPHome.vmx:

config.version = "8"
virtualHW.version = "3"
ide0:0.present = "TRUE"
ide0:0.filename = "WindowsXPHome.vmdk"
memsize = "768"
MemAllowAutoScaleDown = "FALSE"
ide1:0.present = "TRUE"
ide1:0.fileName = "auto detect"
ide1:0.deviceType = "cdrom-raw"
ide1:0.autodetect = "TRUE"
floppy0.present = "FALSE"
ethernet0.present = "TRUE"
usb.present = "TRUE"
sound.present = "TRUE"
sound.virtualDev = "es1371"
displayName = "Windows XP Home"
guestOS = "winXPHome"
nvram = "WindowsXPHome.nvram"
MemTrimRate = "-1"

ide0:0.redo = ""
ethernet0.addressType = "generated"

# Unique ID for the virtual machine will be created
# Most instructions on the web specify uuid.location and
# uuid.bios explicitly, which must be A Bad Thing.
uuid.action = "create"

ethernet0.generatedAddress = "00:0c:29:7e:06:58"
ethernet0.generatedAddressOffset = "0"

tools.syncTime = "TRUE"
ide1:0.startConnected = "TRUE"

checkpoint.vmState = ""

Set memsize lower unless you’ve got lots of RAM (I’ve got 2GB, so can spare 768MB for the VM). Also remove the bottom line unless you’ve got a machine with two real or virtual CPUs.

You might prefer to use EasyVMX to generate this file.

4. Insert the Windows CD and boot the virtual machine.

[At this stage I got an error about the disk being corrupt. I grabbed a replacement from http://www.blankstare.net/blank.zip instead. I’ve kept the original instructions in place because they should work; presumably it’s a bug in qemu-img and will get fixed in later versions (I used ).

Go through the normal Windows installation procedure.

5. Install VMWare tools

Follow these instructions to install the VMWare tools.

For some reason, although the tool service does start with Windows, the icon in the notification area doesn’t recognise this. Therefore I downloaded the resource kit from Microsoft, and added the following simple script to my desktop:

-- Requires that the Windows resource kit has been installed

sc stop "VMTools"
sleep 5
sc start "VMTools"

Resources used: