Running Microsoft's IE Application Compatibility Images in VirtualBox
Update: Unfortunately, as of the September 2009 release, the VPC images from Microsoft have been changed and are now a bit more picky about activation. When you follow this procedure, the images will now fail activation. I've left this page up so that the procedure can be tried on future releases of the images.
Virtualbox is a virtualization product produced by Sun. Available for Windows, Linux, OS X, and Solaris, it not only is fast and full of features, but free! Most of the product is available under the GPL. Some additional features, such as USB and Remote Desktop support, are available free of charge for personal and small-scale commercial use.
Unfortunately, Virtualbox doesn't come with a robust set of tools to convert disk images. While you can convert images between Virtualbox (VDI) and VMWare (VMDK), as well as from straight raw disk images, you can't easily convert images from Microsoft's VirtualPC format. This is an issue when you want to use Microsoft's free VPC images for testing various versions of Internet Explorer. Luckily, with a little bit of help from QEMU, it's possible to convert these images into something usable, all without needing a copy of Windows installed to bootstrap everything.
Download VirtualPC Images
Download the VirtualPC images you require from the Internet Explorer Application Compatibility VPC Image page.
Extract Cabinet or RAR archives
Depending on the image you downloaded, you either have a single cabinet file, or a multi-part RAR archive. The archives are wrapped in self-extracting executables, but most unarchivers can automatically skip the executable part. In this case, I'm using unrar and cabextract from MacPorts; on Linux, the same utilities will be available easily within your package manager. If the archive contains multiple parts, be sure each one is in the same directory. On Windows, you can just run the executables directly.
For a RAR archive:
$ unrar x IE7-VIS1.exe
Or, for a MS Cabinet:
$ cabextract IE8B1-XPSP2_VPC.EXE
After running these commands, there should be a large VHD file in the same directory.
If you are using Linux, obtaining QEMU should be easy. Either install it with your distribution's package manager, or download the source and compile it manually. All we need is the
qemu-image program, so we can convert the VPC image to a VMDK or raw disk image. In this example, I convert to a raw disk image. If you don't need snapshots or other similar features, and are short on disk space, you can convert to a VMDK image. The generated VMDK will be 'sparse', meaning that only sectors with data consume space, whereas a raw image will eventually be equal to the capacity of the virtual drive (though it can be shrunk down after converting to a VDI). This is very helpful for the images Microsoft provides as while they are only a few gigs for each image, the actual disk size is set to 16 gigabytes for XP, and 64 for Vista, which is quite significant on most laptop drives.
If you are using OS X, it's a little more complicated. Unfortunately, gcc 3.3 is required to build QEMU normally. Only gcc 4.0 and greater are supported on Intel Macs, so you can't just download the source and run
./configure && make qemu-image. Luckily, the Q project has precompiled binaries, and includes qemu-image. You don't need to install all of Q; you can just browse the "Q" application bundle and copy
For Windows, you may as well just use VPC itself, since it's a free download from Microsoft. If you don't want to deal with it's poor performance, you can download Windows binaries for QEMU, or use VMWare's free image converter.
To convert to a raw disk image, use the following command. If you get strange errors such as "qemu-img: error while writing", try setting the destination to a disk with lots of free space. While my internal drive should have been able to handle the conversion, I was only able to get a successful conversion by writing the converted image to a network file server.
$ qemu-img convert -f vpc -O raw <path to VPC file> <path to destination raw disk image>
To convert to a VMDK, use:
$ qemu-img convert -f vpc -O vmdk <path to VPC file> <path to destination VMDK image>
There are also patches floating around on the qemu mailing lists adding support directly for VDI images, skipping this intermediate conversion step, so hopefully in the future qemu-img will be able to convert directly from a VHD to a VDI.
If you created raw disk images, now they need to be converted to VDI's using
vboxmanage. Note that on OS X, the commands use upper case titles, so instead run
VBoxManage. For example, for the Vista image, I ran the following command:
$ vboxmanage convertdd Vista\ Business\ with\ IE7.raw Vista\ Business\ with\ IE7.vdi
Finally, shrink the resulting VDI back down to a sparse image. Note that you may have to specify the full path to the file if it's not registered with VirtualBox's disk manager.
$ vboxmanage modifyvdi Vista\ Business\ with\ IE7.vdi compact
Running the Virtual Machine
Now that you have created a VDI or VMDK disk image, it can be added to VirtualBox's disk manager and used like any other disk. I highly recommend creating a snapshot before booting the VM for the first time. On first boot, the VM will redetect some of the hardware, and may require a Windows XP or Vista disk for drivers. Be sure to install the Guest tools as well to improve performance and OS integration.
XP SP3 and Vista Caveats
Service Pack 3
If you are using the older XP SP2 images, snapshot your VM if you intend to upgrade to SP3. While normal XP installations in VirtualBox work fine with SP3, upgrading a converted VM has lead to a blue screen on boot for me every time. Hopefully the next version of these images will be based on SP3 instead.
Microsoft recently updated the provided images to include SP3. This brings an extra few steps for setting up each VM. If you simply boot the images as is, it's likely you'll get DRIVER_UNLOADED_WITHOUT_CANCELLING_PENDING_OPERATIONS in a BSOD. Luckily, this is a known problem with Windows XP, and can be dealt with through a simple registry hack by booting into safe mode. Follow the instructions in the linked article, or if you would rather use the command line, run:
sc config Processor start= disabled
The new SP3 images also ask for updated power management drivers on boot (cmbatt.sys, battc.sys, and compbat.sys). As the VM has been stripped of the SP3 installation files to save space, they need to be supplied from an SP3 cabinet file. The developers who put together these images were a step ahead; a CAB viewer is built into Windows Explorer, so simply mount a CD or network drive with the appropriate files and add them in. Otherwise, just click "cancel" to the two dialog boxes on every restart.
The Vista images seem to be problematic to convert and boot properly. Sometimes they will boot with a blue screen error "0x0000008E", which can indicate disk corruption issues. Usually a reboot will fix the issue. In my experience, once booted successfully, a Vista image will remain stable.