Connecting to IISExpress on Parallels from OS X

I develop on a MacBook Pro through Parallels 9. When I am working on web applications I use OS X Chrome for my debugging. The reason that I do this is that OS X renders fonts much closer to Photoshop. The problem is that every time I re-install my development tools I cannot remember how I got it working. Here are the steps so future Matt has an easier life.

001

Parallels

The first thing that needs to be done is setting up Parallels to run on a Bridged Network. This is important so that the virtual machine gets its own IP address.

Go to Parallels -> Configure -> Network.

Change Type to the Default Adapter in Bridged Network (mine was originally shared network).

Now your Parallels instance will be getting its own IP address to which it can do what it pleases.

Windows

Here is where I got tripped up. I could connect to my machine using my ip address, but not my hostname. The only way I could get the configuration to work was to install Bonjour from Apple. After I completed that I found that I could now access the windows machine using machinename.local.

IIS Express

IIS Express uses a configuration file to setup the bindings. Make sure your web project is working like a rock star, and then open the IIS Express host configuration file.

 %USERPROFILE%\Documents\IISExpress\config\applicationhost.config

Find your website section and add another binding under the existing one like the following:

<site name="MyProject" id="3">
   <application path="/" applicationPool="Clr4IntegratedAppPool">
                    <virtualDirectory path="/" physicalPath="C:\Users\AwesomeDude\Projects\MyProject" />
   </application>
   <bindings>
      <binding protocol="http" bindingInformation="*:4480:localhost" />
      <!-- Add the one below -->
      <binding protocol="http" bindingInformation="*:4480:machinename.local" />
   </bindings>
</site>

Perfect. Only a couple steps left.

Windows Firewall

Add the correct port number to the inbound and outbound Windows Firewall so that Windows doesn't eat your packets. The only successful way I have found to do this is to open the inbound port for the application that you are working on. Some people allow the IISExpress.exe application, but I haven't found this successful.

Netsh

Now IIS Express isn't allowed to access the internet. You can give it permission by typing this sneaky little command into your Windows Command Prompt.

netsh http add urlacl url=http://mymachine.local:4480/ user=everyone

Bam! If you did it right, you can right-click on IIS Express and see both bindings under the site that you are running.

Hope this helps.