This article was sponsored by modern.ie. Thank you for supporting the sponsors who make SitePoint possible!
Internet Explorer remains the world’s second most-used browser with almost one in four users on the desktop. A high proportion of those are from large businesses and government agencies yet, despite the commercial opportunities, few of us devote enough time to testing IE until it’s too late. The solution is to test early and test often — especially the older browsers.
Testing IE poses a challenge; it’s available only on Windows and, even then, you can install only one version at a time. Emulators and IE’s own document modes can help but you should never trust them for anything more than basic layout checks.
A few years ago it would have been necessary to install and maintain a suite of PCs with various combinations of Windows and IE. Fortunately, we can do the same without hardware using Virtual Machines.
What are Virtual Machines?
You’ve possibly seen emulators that run old operating systems such as Amiga OS, games consoles, or arcade machines on Windows, Mac, or Linux. In essence, these are Virtual Machines (VMs) that make the original OS and software think it’s running on real hardware. In reality, it’s all happening within the host PC’s memory.
We’re not limited to old OSs — we can emulate a real PC and run any platform we desire. For example, we can run Windows XP in a VM application on Windows 8.1 so we can retain older, incompatible software. Because it’s handled as a data file, we can start, stop move or restore XP anytime we choose.
Virtual Machines therefore provide a mechanism to run any edition of Internet Explorer from a Windows, Mac or Linux host. There’s little excuse — you probably have the software already and Microsoft provide a range of free Windows/IE VMs at modern.ie.
Virtual Machine Host Software
The most popular VM hosts are:
- VirtualBox (open source — Windows, Mac, Linux)
- VMware (commercial — Windows, Mac, Linux)
- Hyper-V (free — add-on for Windows 8 and Server 2012)
- Virtual PC (free — add-on for Windows 7)
- Parallels (commercial — Mac only)
For the purposes of this article, we’ll use VirtualBox running on a Mac. It’s available on all platforms, is easy to install, fast, and it’s free. Head over to virtualbox.org then download and install the application for your OS.
The other VM hosts have similar processes — full instructions are available at modern.ie.
Installing a Virtual Machine
Visit modern.ie and follow the Test your site using free virtual machines link:
Now select your host OS and virtual host platform — we’re using VirtualBox running on a Mac:
Various Windows and IE VMs are presented. At the time of writing, the following combinations are available:
- Windows XP + IE6
- Windows Vista + IE7
- Windows XP + IE8
- Windows 7 + IE8
- Windows 7 + IE9
- Windows 7 + IE10
- Windows 8 + IE10
- Windows 7 + IE11
- Windows 8.1 + IE11
These are fully-installed images of the whole operating system: the downloads are several gigabytes in size — be prepared for a long wait on slower connections.
That said, you’re unlikely to require all the VMs. For the average site, IE6 and IE7 are dead. IE9 and 10 are normally well behaved and have mostly been superseded by IE11. I would therefore suggest IE8 on XP and IE11 on Windows 8.1 as a minimum but you should analyze your own site’s traffic to ensure you’re testing appropriate combinations.
Having chosen an image, download all the files. The Mac VirtualBox images have a number of RAR files and a single SFX file. Assuming you’ve downloaded to your “Downloads” folder, open a command terminal and enter:
cd ~Downloads chmod +x filename.sfx ./filename.sfx
where filename.sfx is the full name of the .SFX file. This will expand your files into a single OVA file.
Next, start VirtualBox and choose Virtual Machines > Import from the main menu:
Select the OVA file, click Continue and import the VM. It will shortly appear in the list in the left-hand pane. Click once to select it, then hit Start to launch the Virtual Machine. After a few seconds, you’ll be booted into Windows and can run Internet Explorer:
VirtualBox provides a special IP address at http://10.0.2.2/ which loops back to the host’s IP address so you can test pages on your local server. The VM is also added to your network so you can enter your host PC’s IP address as an alternative. However, remember that
http://127.0.0.1/ are the local addresses of the new VM — they cannot be used for testing unless you update the VM’s host file.
Windows Licensing Restrictions
All modern.ie VMs are full editions of Windows — you can install and use any software you like including other browsers.
To prevent anyone using these images to run unlicensed copies of Windows indefinitely, they expire after 30 days (unless you enter an activation key). At that point, the OS will randomly reboot and become mostly unusable. You can, however, retain a copy of the downloaded files (or the VirtualBox OVA) and import the VM again.
Fortunately, there is a way to extend Windows expiration. When you start receiving activation messages, run a command prompt as an administrator inside the VM. This is achieved by right-clicking the shortcut and choosing Run as administrator.
Then, for XP VMs, enter:
or, for Windows Vista, 7 or 8.1 enter:
This can be done twice so, in effect, your license is extended to 90 days.
Virtual Machines are the best way to test your site on IE and other Windows browsers. Modern.ie makes the process much easier and free. What are you waiting for?
Craig is a freelance UK web consultant who built his first page for IE2.0 in 1995. Since that time he's been advocating standards, accessibility, and best-practice HTML5 techniques. He's created enterprise specifications, websites and online applications for companies and organisations including the UK Parliament, the European Parliament, the Department of Energy & Climate Change, Microsoft, and more. He's written more than 1,000 articles for SitePoint and you can find him @craigbuckler.