Using Microsoft's Browser Test VMs in Virtual Box

Friday, June 12. 2009

Using Microsoft's Browser Test VMs in Virtual Box

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.

Required software

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.

Problems
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.

No network

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:

d:\vboxwindowsadditions-x86.exe /extract

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!

Posted in HTML/CSS | Comments (6)
Ronny at 2009-08-05 10:04
Thanks a lot for your explanations. Those were really helpful and I can now test websites in all IE versions.
Klaus Reimer at 2009-09-04 14:55
It no longer works with the latest Microsoft Browser Test Images. See last section of the article...
Nicolas Grilly at 2010-10-26 10:56
I've managed to install and activate my copy. It looks like you just have to activate over the Internet or over the phone without registering and it works.
Chuckvdl at 2011-10-17 23:41
The current images specifically tell you (on the download page) that the product keys are deactivated. You refuse the activation, and the image is good for 30 days, and there's a command line trick to extend it for another 30 days which can be used 2 times total.. So the max an image is good for is 90 days.

If you are running VPC (e.g. on windows, not a mac or *nix box) then you can just always shut the system down discarding changes and it's good forever as long as you NEVER ever persist a change to the VM. (in theory anyway) Since you normally have to alter a few things, and would want to install the guest additions, that tactic is pretty much a non-starter if you are not using VPC..

given all the hassle of re-doing stuff every 90 days or less, if you are going to have to test or support IE etc, then it might be cheaper to just get the base level MSDN license and then you can run as many installs of any of the MS OS's for testing/dev (provided you get one MSDN subscription for each person that would be using the systems.
Greg at 2012-06-16 10:55
Check out this github project. Seems to simplify things a log.
https://github.com/xdissent/ievms#readme
Pratt G at 2013-01-24 07:13
If I convert into .vhd file format using qemu command :
qemu-img convert source.vmdk -O vpc target.vhd

So will this target.vhd file format will boot on Hyper-V and xen hypervisors?

Here souce.vmdk is ubuntu OS(11.10)

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.