Friday, July 13, 2012

Hyper-V Desktop OS Internet Access Shared Host IP Address

What I Wanted To Do?

I have client-server type deployments and some of the applications only run on Windows XP as a desktop application. Occasionally, I need to run the app while servicing the server at the same time. It is thus a bit more convenient to launch a desktop OS running under Hyper-V from the same server. I really don't care if I cannot access it remotely outside of the server. Obviously, Microsoft thought that this use case is a rare one on servers, but I guess I understand...

Unfortunately, unlike VMware or Virtual Box, Hyper-V does not (seem to) provide a convenient Shared or Bridged configuration which would share the server's (host's) IP address to get out to the network outside. It does, by default, extends the network to the outside so if there is a DHCP server on the network, and if you are permitted, you can run the guest OS.

How I Solved It?

I have found this post from John Paul Cook very comprehensive and usable. Just in case we all lost an access to the post, here is the basic stuff you need to do.
  • Add Network Policy and Access Services Role
  • This will subsequently allows you to add Routing and Remote Access Services. Add Remote Access Service and Routing. Note that you already may have this installed.
  • From your Hyper-V manager, create a new Interface and give it a private IP address like (10.0.0.1) This will become the "router gateway" address for your guest OS.
  • Assign this interface in your Guest OS
  • In the server manager you will now find Routing and Remote Access. Create a Network Address Translation item.
  • Select the Destination (NAT target) as your host's interface that's on the network.
  • Select the Source as the private interface you've just created.
  • Start the Guest OS, configure the new interface with its own IP address in the private subnet and point the gateway address to the address of the interface you've just created (where I said 10.0.0.1) Also add DNS addresses.
  • Turn off Windows Firewall settings for the interface.
  • And test.
Post a Comment