Mar 16, 2013

Hyper-V on Windows 8: External virtual switches do not work - Howto connect a virtual host to the internet

First thing you have to do after enabling Hyper-V is to set up your network for your virtual machines. This is not so easy, because some things do not work...
So let's start: Open the Virtual Switch Manager
There you have three options:

  1. external (connectivity to the internet)
  2. internal (connectivity between virtual machines on this Hyper-V and the host)
  3. private (only connectivity between virtual machines on this Hyper-V)
Sounds like 1 is the option, which should be used, but this option does not work (you can find many postings via google, from guys, which chose this option and did not get any connectivity to anywhere...). On my laptop i was not able to get connectivity from the virtual host to the internet. Even worse: After configuring an external virtual switch my Windows 8 had no connectivity to the internet, too.
But there is a workaround:
  1. Create a internal virtual switch and call it "VSwitchExternal"
  2. Open network adapters (via control panel->network) and select your network adapter (Wifi) and the new vEthernet adapter (via CRTL and click them):
  3. Now do a right click and choose "add to network brigde"
Now this vEthernet adapter VSwitchExternal will work and your laptop is still connected to the internet.
But you should be aware, that the virtual machine now needs its own ip on your external network. How to configure NAT for your virtual machine, so that you use the same address like your laptop, is explained in  this posting.

1 comment: