Testing a local IIS website with a VM

on Friday, October 7, 2011

I had been putting off updating to IE9 for a while because 9’s “IE8 Mode” didn’t perfectly replicate IE8. Fortunately, a coworker pointed out that you can test out a local website using a VM.

I’m gonna use VirtualBox as the VM host software. I used an old copy of XP that I have lying around and updated it to IE8 (and security updates).

The virtual machine I created uses a NAT network interface. Most of the questions over on StackOverflow suggest using a Bridged interface, but I was having trouble getting that going.

Once you have the virtual machine up, all you have to do is edit your hosts file (C:\Windows\system32\drivers\etc) to map a dns address (eg. vmtest.local.mycomputer.com) to the local IP address of your machine (eg. 192.168.1.X).

image

As long as your local IIS instance uses host names to determine what the processing website is, then it will work.

image

Inside of your VM, you should now be able to type in the address and get a result.

image

With SSL certs it’s a little more tricky. You have to bind an SSL cert with an IP address. In this case, the only way to really do it is to bind the SSL cert either to ‘All Unassigned’ or to the actual IP address of the machine. If you already have a cert bound to ‘All Unassigned’ associated with any website it should just work.

image


Creative Commons License
This site uses Alex Gorbatchev's SyntaxHighlighter, and hosted by herdingcode.com's Jon Galloway.