network adapter - Windows 8 Hyper-V - how to give VM internet access?

04
2013-08
  • Graham Clark

    I've got Windows 8 Pro on my home machine. I want to have a Windows 7 Professional VM running under Hyper-V, and I want the VM to have full internet access. My physical machine has a wireless network adapter I use to connect to a router.

    Here's what I've done so far:

    • In Hyper-V Manager, I've created a new External Virtual Switch, which is connected to my wireless network adapter. If I look in Windows 8's Network Connections page, I can see it's created a virtual ethernet adapter and a network bridge, and my wireless adapter is now bridged.

    • I've created a Windows 7 VM, and in the Hyper-V settings I've set it to use the virtual switch.

    When I log into the VM, I have a network, but it's "unidentified" and has no internet access. What am I missing? Is it something to do with the "VLAN identification" settings? I'm not quite sure what these are about.


    This question was a Super User Question of the Week.
    Read the blog entry for more details or contribute to the blog yourself

  • Answers
  • KronoS

    In order to get the VM connected to the internet you have to tie it to the Ethernet/Wireless NIC Card. In order to do this you have to create a "Virtual Switch".

    1. Open your Hyper-V Manager
    2. Select Action --> Virtual Switch Manager

      Accessing the VM Switch Manager

    3. Select External and then Create Virtual Switch

      Virtual Switch Manager

    4. Give the Switch a Name and then select the External Controller you use to connect to the internet (Ethernet, or Wireless NIC, etc,.)

      VM Switch Properties

    5. Select Apply and then OK

    6. Right click on the Virtual Machine you want to connect and select Settings

      VM Settings

    7. Under the Network Adapter Setting select the newly created Virtual Switch

    Connecting the Switch to the VM

    This should enable the connection you use to connect to the internet to be accessible to the VM

  • Canadian Luke

    I had to disable and then re-enable the Allow management operating system to share this network adapter under the Virtual Switch Manager.

    If this isn't checked the host machine will not be able to use the chosen adapter. It had been checked in my case, for some reason I had to flip it back and forth again.

  • Mike Walsh

    Another trick as detailed in this question Windows 8 Hyper-V network not working on host is that this may not work over wireless... re did the setting several times nothing - set up an ethernet adapter - worked straight away. [quick edit to say of course I'd set up separate virtual switches for the two physical adapters...]

  • random

    In my case, while the VM was running I changed the virtual Switch settings to “Not Connected” and then back to my newly created virtual switch. Worked.


  • Related Question

    virtualization - Why does my Windows 8 Pro Hyper-V guest have no internet?
  • Perplexed

    Trying to get this working on my Windows 8 Pro machine. I created an External Switch

    Assigned the newly available adapter to a Guest machine with Win 2008 os. My host has internet connection. Host can ping Guest, Guest cannot ping Host.

    Guest has no internet connection. Pasting the IP of both host and guest.

    HOST
    ==========================
    Ethernet adapter vEthernet (EXTSW01):
    Connection-specific DNS Suffix  . : 
    Description . . . . . . . . . . . : Hyper-V Virtual Ethernet Adapter #2
    Physical Address. . . . . . . . . : 9C-B7-0F-0F-D7-D0
    DHCP Enabled. . . . . . . . . . . : Yes
    Autoconfiguration Enabled . . . . : Yes
    Link-local IPv6 Address . . . . . : fe80::5434:a9fd:8611:d207%54(Preferred) 
    IPv4 Address. . . . . . . . . . . : 192.168.0.15(Preferred) 
    Subnet Mask . . . . . . . . . . . : 255.255.255.0
    Lease Obtained. . . . . . . . . . : Saturday, September 8, 2012 12:34:44 PM
    Lease Expires . . . . . . . . . . : Saturday, September 15, 2012 12:34:44 PM
    Default Gateway . . . . . . . . . : 192.168.0.1
    DHCP Server . . . . . . . . . . . : 192.168.0.1
    DHCPv6 IAID . . . . . . . . . . . : 916240141
    DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-17-DC-C9-2C-9C-B7-0D-0D-D7-D0
    DNS Servers . . . . . . . . . . . : 64.71.255.999
    NetBIOS over Tcpip. . . . . . . . : Enabled
    

    GUEST
    ==========================
    Ethernet adapter Local Area Connection:
    
       Connection-specific DNS Suffix  . : 
       Description . . . . . . . . . . . : Microsoft Virtual Machine Bus Network Adapter
       Physical Address. . . . . . . . . : 00-15-5D-3F-0F-00
       DHCP Enabled. . . . . . . . . . . : No
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::953f:ec5c:5d84:1b50%11(Preferred) 
       IPv4 Address. . . . . . . . . . . : 192.168.0.20(Preferred) 
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . : 0.0.0.0
       DHCPv6 IAID . . . . . . . . . . . : 234886493
       DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-17-DD-2F-29-0F-15-5E-00-0F-00
       DNS Servers . . . . . . . . . . . : ::1
       127.0.0.1
       NetBIOS over Tcpip. . . . . . . . : Enabled
    

  • Related Answers
  • James T

    I had issues similar to this. It seemed to be caused by having other virtualization software (Virtualbox) installed along with Hyper-V. You could check the properties -> sharing tab of the vEthernet adapter and try setting it to share internet. I still had intermittent internet issues with this setup though.

    I ended up uninstalling Virtualbox to get Hyper-V working solid.

    Edit: https://forums.virtualbox.org/viewtopic.php?f=6&t=48044

  • Willm

    Dont forget to activate the Virtual LAN ID which you can find in the Guest settings of the Hyper-V-Manager! http://i.stack.imgur.com/jrnm5.png