If you are a web developer like me then you most likely must test your web pages in at least three incarnations of the evil Internet Explorer. And if you are a linux user like me then you will most likely not use native windows installations to do this. And if you are a Microsoft hater like me then you may have no Windows installation CDs at all. So how are you going to test your stuff in Internet Explorer?
Fortunately Microsoft is so kind to provide some Virtual Machine Images for testing purposes. Unfortunately they are only available for Virtual PC but with some work they can be used in Virtual Box as well. In this article I will describe how to get these images running on Ubuntu Linux 9.04.
This article is about installing some Virtual PC images in VirtualBox so first of all you need VirtualBox itself. Simply install it with
sudo apt-get install virtualbox.
Now you need the Virtual PC images from Microsoft. Download the files you will need for testing here.
As usual Microsoft annoys us by providing the images as self-extractor EXE files instead of using an archive format directly. So to unpack them we need Wine. Install it with
sudo apt-get install wine. Double-click the EXE to start it with Wine (Or Right-Click it and select Open with "Wine Windows Program Loader" if EXE files are not handled by Wine by default). When extract is complete then you will have the Virtual PC harddisk file (*.vhd) and a README which contains the admin password of the Windows installation (You might need it for example if you accidentally lock the virtual machine).
Creating the virtual machine
Copy the *.vhd file into the folder ~/.VirtualBox/HardDisks (Create this folder if does not yet exist). Then start up VirtualBox, create a new Virtual Machine and select the corresponding *.vhd file as hard disk for this new virtual machine. You may want to give the virtual machine at least 512 MB RAM or it may get pretty slow.
Now start the virtual machine. If Windows boots without problems then you are lucky. I wasn't. I got multiple problems for which I'm going to give some solutions in the next section of this article. I hope I covered all problems you may encounter.
Windows crashes with a blue screen
If you get a blue screen saying DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS caused by the file processr.sys then you must start Windows in Safe-Mode (Hit F8 during startup and then select it) and type the following command on the command-line:
sc config processor start= disabled
If you get the same bluescreen when shutting down windows but this time caused by the file intelppm.sys then type this command instead:
sc config intelppm start= disabled
Then reboot Windows and the problem should be fixed. I needed to enter both commands because I encountered both blue screens.
It's likely that the Virtual PC image you downloaded from Microsoft doesn't has a driver for any of the network cards which can be emulated by VirtualBox. If you have a Windows XP install CD at hand then simply insert it and let Windows install the needed driver on it's own. If you don't have a Windows install CD then stick with the default network card (PCnet-FAST III) and install the driver from the Guest Additions CD image of VirtualBox. For some unknown reason this is pretty complicated. Mount the Guest Additions CD of VirtualBox in your virtual machine and then execute this command on the command-line:
Now you have the necessary files in the directory C:\Program Files\Sun\xVM VirtualBox Guest Additions\x86\Network\AMD. So point the hardware detection to this directory and it will install the driver.
CmBatt.sys and compbatt.sys is missing
Download the Service Pack 3 installer. Mount the image in your virtual machine and start the installation. After it has extracted its files don't continue the process and instead simply leave it at this state. Now you can continue the hardware detection and you will find the neccessary files in a folder like c:\a819b0059e04c1755\i386 (The directory name may be differrent). After these two files are installed you can cancel the installation of Service Pack 3. This will also clean-up the extracted files from the hard disk.
Unable to use mutliple VHD files because they have the same UUID
If you just need a single VHD File (For example the Win XP IE6 file) then you will not encounter this problem. But if you need two virtual machines (One for IE6 and one for IE7 for example) then you may notice that you can't register both VHD files to VirtualBox because they have the same UUID. The only solution I found for this so far is a little bit time-consuming: Converting the VHD files to VDI files by using these two commands:
qemu-img convert -O raw -f vpc ie6winxp.vhd ie6winxp.raw VBoxManage convertdd ie6winxp.raw ie6winxp.vdi
VBoxManage is part of Virtual Box so you must already have it installed. qemu-img is part of qemu so you can install it with the command sudo apt-get install qemu.
After the conversion you can remove the VHD and the RAW files and use the VDI files in Virtual Box. These will now have different UUIDs so they will no longer produce a conflict.
Windows was working fine but now it no longer boots
You thought Microsoft gives you a free version of Windows you can use indefinitely? Nope, it's just some kind of demo version which will expire after some months. If it does so you have to download new images and repeat all the above stuff to get it running in Virtual Box again.
This whole article is bullshit because the described solution doesn't work!
You are right. Thanks to Microsoft this procedure no longer works with the latest VirtualPC images. When used in VirtualBox Windows complains about significantly changed hardware and refuses to work without activation. I'm really pissed off! I thought I had finally found a legal solution to test my web pages in all these crappy Microsoft browsers. Thanks Microsoft! Thanks for nothing!