Hyper V Windows 8 – Internet Access on Hyper-V Private/Internal Networks

Posted: 2012-10-21 in Code and Computers

Its actually quiet simple to get a Windows 8 Hyper V Client internet access.

Just a little long winded.

Step 1 – Create a Hyper V “Internal Network Adapter” called “vNet 10”

Start Hyper V Manager on your Host
Select “Virtual Switch Manager…” -> Click “Internal Network” -> Call it “vNet 10”, select ok.

You have now created a virtual network card, your computer will see this as no different to a real network adapter.

Step 2 – Configure the Hyper V client to use “vNet 10”

This is simple. On your hyper V machine right click and choose settings.

When the setting have opened click on the network adapter, in the main section now choose the virtual lan that you just created (“vNet 10”).

Click areas are yellow highlighted in the below thumbnail.

You can now Exit Hyper V Manager

Set your Hyper V client to use the virtual internal network

Step 3 – Enable RRAS – Internet sharing amongst network adapters

To do you need to enable and start the windows service called “Routing and Remote Access” (RRAS).

Right click on the start button -> chose Run -> enter “compmgmt.msc”

Services and Applications -> Services -> Routing and Remote Access
Enable and start this service

Your need to enable RRAS (routing and remote assistance)

Step 4 – Enable  – Internet sharing

Control Panel->Network and Internet->Network and Sharing->Change adapter settings

You need to identify two network adapters.
The one you use for internet access and the one you created in step 1 “vNet 10”.

Right click on your internet network adapter and select properties.
Select tab Sharing
Tick checkbox “Allow other network users to connect through this computer’s Internet connection”.
Apply and close the properties window.

You all need to allow other network adapters (whether virtual or real) to be able to use your real internet connection

Step 5 – Configure “vNet 10”

You need to give your virtual network adapter a IP address. Technically this will be the client gateway address.

Its rather easy.
Right click on “vNet 10” adapter and select “Properties”.
Scroll down to Ipv4 and select “Properties”
ip address: 10.10.10.1
subnet: 255.255.255.0
Hit ok and close the properties window.

Standard network setup for the host, its pretty well the same steps as if you had inserted a real network card and wanted to bridge the connections

Step 6 – Get your DNS address

Start command prompt and enter
ipconfig /all

Scroll to your network adapter that the host internet runs through (doesn’t matter if it is wireless).
Look for the dns settings for this adapter, in my case it was 192.168.1.1
Write this down somewhere.

Step 7 – Configure you Virtual Client (optional*)

Start your Virtual Windows 8 Client and log into it.
Go to
Control Panel->Network and Internet->Network and Sharing->Change adapter settings
Right click on the Ethernet adapter -> Properties – > Ipv4 -> Properties (same as step 4)

Configure this adapter

IP address: 10.10.10.2
subnet: 255.255.255.0
gateway: 10.10.10.1

Preferred DNS Server: 192.168.1.1 (this is the step 6 address)

Client setup, the only difficult thing here is the dns address.

Hit ok and your DONE!!!!! test using IE or windows update or something. 

*You can actually skip step 7, with internet sharing enabled a mini DHCP server should give your virtual client an address.

Notes:

This is no different to setting up a normal dual NIC machine.
You can usually ping from your host to your client (ping 10.10.10.2) but not the other way around.
On the host you under task manager you will see traffic flowing from your internet to your vNet when your virtual box is using internet.

Happy virtual surfing!!!

Advertisements
Comments
  1. Kevin says:

    What a great guide. Thanks! Would you recommend this setup for a lab with a domain controller? I want to setup a test domain in a lab but I do not want it to interfere with the physical host or the rest of my physical network. This guide solves the main problem of giving the private/internal network access to the internet but wasn’t sure if I would run into other issues with a domain controller running in the hyper-v lab.

    • Choco Smith says:

      I don’t see any reason why it shouldn’t work. in theory since its a bridge connection you could block the domain controller crossing the bridge by simply blocking the port, or the service packages.
      any basic firewall should slide this.
      also if I remember correctly you can instruct domain controllers not to cross subnets.

      it’s also probably one of the safest way to do it followed only by not having any bridge.

  2. Hallelujah! I was digging in this direction myself, but was missing the “Enable RRAS” step! Thank you!

  3. Juan Pablo says:

    There is only one issue with this configuration as per Microsoft KB.
    Media Streaming may not work with Internet Connection Sharing enabled in Windows.
    http://support.microsoft.com/kb/2708755

    • Choco Smith says:

      I did have a bit of trouble streaming using Ps3 Media Server.
      In my case I found the Ps3Media Server had bound to the wrong address. You can find it in settings somewhere.

      It was a simple matter of correcting it to the computers 192.168.x address and not the 10.10.x address.
      I didn’t try stream from or to a Hyper V client though.

      Cheers,
      Lachlan

  4. Denny says:

    Awesome man… I was struggling with this for quite long.. Followed your instructions… got it working in single attempt…. gr8

  5. John says:

    Thank you so much, this guide has helped me get my VM’s hooked up to the internet.

    I would like to install server 2012 as a VM DHCP service for the Windows client VMs. Is this possible? I can’t get the client machines to detect the running DHCP server.

    I created a new scope

    10.10.10.2 > 10.10.10.50 subnet 255.255.255.0

  6. Arnaud says:

    Thank you very much, you helped a lot. Everything works fine. Very interesting guide !

  7. AlexG says:

    What should be done to enable intrenet access to VM(s) that joined to domain in Hyper-V lab?

    Example on Hyper-V I created 3 VM (DC ,HA1 ,HA2) – win2012 server eval. edition

    DC will be domain controler for domain Alex1.com

    I want to join HA1 and HA2 to domain Alex1.com and enable intrernet connection for DC,HA1 and HA2

    Currently my domain setting
    (all servers can communicate, I am able to create cluster ,but have no internet access)

    TCP/IPv4 Seeting on DC
    IP = 192.168.1.8
    subnet = 255.255.255.0
    default getaway = empty
    Prefered DNS server = 192.165.1.8

    TCP/IPv4 Seeting on HA1
    IP = 192.168.1.11
    subnet = 255.255.255.0
    default getaway = 192.168.1.8
    Prefered DNS server = 192.168.1.8

    TCP/IPv4 Seeting on HA2
    IP = 192.168.1.12
    subnet = 255.255.255.0
    default getaway = 192.168.1.8
    Prefered DNS server = 192.168.1.8
    Thank you

    • Arnaud says:

      Your gateway is incorrect. Your gateway IP address must be the IP of your “Internal Network Adapter” and not the DC IP address.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s