With all modern browsers now embracing automatic upgrades, it won’t be much longer that you have to worry about sites being compatible with old versions of Internet Explorer. However, a significant portion of site owners will continue to support old IE versions. Businesses make their browser support decisions based on the customers they serve – all money is green. In my estimate, old versions of Internet Explorer (particularly IE9) will continue to require support for [at least] the next 3 years.
Virtual Machines are a great way to setup browser testing environments. While I am aware of tools like BrowserStack, nothing matches the experience of running your site in the target browser on your machine. In the case of setting up testing environments for Internet Explorer, Microsoft has done the developer a community a great service with its modern.IE project.
In this post, I’ll configure a virtual machine running IE8 (provided by the modern.IE project) to connect to WAMP – which runs on my physical machine. This will allow me to develop on my local machine while being able to test in the actual browser in a virtualized environment on the same machine.
Before getting started, it’s worth your time to review an excellent reference published by the Tuscon Computer Society about virtual networking with Windows Virtual PC.
Configuring The Virtual Machine
Your browser testing environment
-
Add a new entry in the hosts file on the virtual machine that points to the vhost on the machine running WAMP. The hosts file is located at
C:\Windows\System32\drivers\etc\hosts
.Windows Hosts File Your physical machine running WAMP should be assigned a static IP to avoid IP address changes via DHCP.
-
Update the network settings on your Virtual PC instance so that it uses the network adapter on your physical machine. Doing this puts the virtual machine’s network adapter in bridged mode, making the virtual machine act as if it were a physical machine on your network.
Access Virtual PC Settings
Virtual PC Networking Settings
Virtual PC Network Adapter Settings - Assign a static IP address to your virtual machine.
Configuring The Physical Machine
Your WAMP server host
- As mentioned in the alert message above, ensure that your physical machine running WAMP has been assigned a static IP address.
-
Open the WAMP
httpd-vhosts.conf
configuration file located inC:\wamp\bin\apache\apache#.#.##\conf\extra
and add an exception for your virtual machine’s IP address before the closing</directory>
line.Virtual Host Exception for VM If you are not using virtual hosts in WAMP, you’ll want to edit the
httpd.conf
configuration file instead, located up one directory inC:\wamp\bin\apache\apache#.#.##\conf
. -
Restart all services in WAMP and enjoy dealing with your old Internet Explorer issues.