Run old versions of Internet Explorer in Windows 7 using Virtual PC
From time to time, you'll be required to do some web browser testing to ensure websites appear consistantly in all browsers, including old browsers like Internet Explorer 6, 7 and 8.
Whilst there are software solutions which can quite accurately render like IE6, IE7 or IE8, there are still subtle differences, meaning that not all bugs can be spotted with these software solutions.
Therefore, as I use Windows 7 and have plenty of RAM, my prefered option is to use Virtual PC with Windows XP Mode. This give additional benefits as it allows you to have just the IE browser window open, rather than the whole virtual machine window open. As a result you can have a couple of different versions of IE browsers open at the same time, which is excellent for browser testing.
Download and Install Virtual PC and Windows XP Mode
Download Virtual PC and Windows XP Mode files. If you haven't updated to Windows 7 SP1 you will be required to download an additional update.
Install Virtual PC, followed by Windows XP Mode. In the setup wizard for XP Mode ensure you don't allow automatic updates (you don't want IE6 updated to IE8 in error do you!?).
Run the Windows XP Mode virtual machine and run Windows Update. Take care not to update to Internet Explorer 8 by unticking the appropriate update. By updating Windows XP now, it avoids having to run it for the 3 Virtual Machines we are about to create.
Before moving on to the next step, ensure you shutdown (and not hibernate) your virtual machine. Also, make the hard disk file read only so that the disks created in the next steps do not become corrupt.
Creating Virtual Machines using difference disks
Click 'Create Virtual Machine' from the Virtual PC folder. Name this virtual machine IE6, IE7 or IE8 (depending on the virtual machine you are setting up). Select the location of the Virtual Machine files.
Select a minimum of 512MB for the RAM.
On the 'Add virtual hard disk' page, ensure you select 'Create a virtual hard disk using advanced options'. Then select differencing on the next page.
Select the location of the virtual hard disk you will be writing to.
Then select the location of the Windows XP Mode disk created earlier whilst installing and updating the Windows XP Mode virtual machine, this will be called 'Windows XP Mode.vhd'.
This will create your virtual machine, which can now be run. If you just created a virtual machine called IE6 then, you can run your Virtual Machine by selecting the file 'IE6.vmcx' from the virtual machine listing.
Repeat this 3 times so that you have 3 Virtual Machines.
Open the Virtual Machine for the first time. Enable the integration features.
Install any required software, such as a the appropriate version of Internet Explorer or the IE developer toolbar.
Once installations and updates are complete, restart the Virtual Machine, at least once.
Finally log off, and then put the Virtual Machine in hibernation mode. This will allow for Internet Explorer to be run, without the full Virtual Machine loading up.
IE6 / IE7 developer toolbar: http://www.microsoft.com/download/en/details.aspx?id=18359
To download Internet Explorer 7, visit: http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=2
This solution isn't without a few drawbacks.
For example you'll need to have plenty of RAM otherwise your machine will slow down to a crawl as swap memory will be used. I think 4GB is probably a minimum, if running one or 2 Virtual Machines along with all your other development tools.
With Windows XP Mode you are limited to IE6, IE7 and IE8 as IE9 will not install on Windows XP. If you want to install IE9 in a Virtual Machine you will require an additional Vista or Windows 7 license to install these Operating systems.
For now we can use IE9 natively in Windows 7 and hope that when IE10 comes along, it accurately renders IE9.