Testing with IE6, IE7 and IE8 on VirtualBox

I've recently moved from using Parallels for browser testing to Sun's Open Source VirtualBox. Here's a walkthrough on how to get a browser testing suite for free on OSX or Ubuntu.

Microsoft’s Virtual Hard Drives

Microsoft make a series of downloads available for web developers to ensure browser compatibility. Currently you can download IE6-8 on XP and IE7 on Vista. The good news is that they are also free so there is no need to buy a Windows license if all you want to do is browser test. The images generally expire at the end of each quarter but it is fairly trivial to download a new version.

Extracting the .exe

The downloads are available as .exe files so you will need to extract them first. On OSX I use Stuffit which extracts .exe files on the free version. Andrew Odri also has a write up on this and he recommends using The Unarchiver although this didn’t work for me.

On Ubuntu you can use Wine:

sudo apt-get install wine

Once installed you can use Wine to extract the exe:

wine /path/to/yourexe.exe

Get VirtualBox

Next download and install VirtualBox. On OSX you can download a .dmg file. On Ubuntu the following will install it for you:

sudo apt-get install virtualbox

Fixing Microsoft’s duplicate identifiers

The Microsoft images all share the same Hard Disk Identifier which means that VirtualBox will only let you add one of the hard drives to the Media Manager. So we need to fix that. Hat tip to Andrew Odri for documenting this.

For OSX Download Q and then for each vhds we need to convert it to a vdi. This will allow us to test in parallel. On OSX run:

/Applications/Q.app/Contents/MacOS/qemu-img convert -O raw -f vpc yourVHD.vhd RAWimage.raw
VBoxManage convertdd RAWimage.raw NewVDIImage.vdi

For Ubuntu get QEMU:

sudo apt-get install qemu

Once installed on Ubuntu you can then convert the .vhd to a .vdi

qemu-img convert -O raw -f vpc yourVHD.vhd
RAWimage.raw VBoxManage convertdd RAWimage.raw NewVDIImage.vdi

Fixing drivers

Once you have set up your Virtual Machine and booted you will see a blue screen of death. This is because we still need to install some drivers. When booting hold down F8 and boot into Safe Mode with Command Prompt. Cancel any prompts that come up and at the DOS prompt enter

cd \WINDOWS\system32\drivers ren processr.sys processr.old

Restart the machine and then in the VirtualBox menu go to Devices > Install Guest Additions. Follow the prompts and install the additions. On Ubuntu I found I had to manually download the iso from the link supplied, then mount it in the machine settings before booting. Reboot when you are done.

Once rebooted at the DOS prompt type

D:\VBoxWindowsAdditions-x86.exe /extract /D=C:\Drivers

This will extract the VirtualBox drivers

Then within Windows do

All done - repeat this method on the other vhds and you will then have a full IE6-8 testing suite that you can run side-by-side if you wish.

Credits

This article draws on knowledge gained from the following posts and I’m very grateful to the authors

Tags

Can you help make this article better? You can edit it here and send me a pull request.

See Also