Windows 8 Hyper-V - how to give VM internet access?
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".
- Open your Hyper-V Manager
Select
Action
-->Virtual Switch Manager
Select
External
and thenCreate Virtual Switch
Give the Switch a Name and then select the External Controller you use to connect to the internet (Ethernet, or Wireless NIC, etc,.)
Note: You must select the way that you are actually connecting to the internet. IE, if your computer is set up to use Wifi or Ethernet, but is currently using Ethernet, you must use Ethernet - the Wifi connection will not work because the host machine isn't currently using it.
Select
Apply
and thenOK
Right click on the Virtual Machine you want to connect and select
Settings
Under the
Network Adapter
Setting select the newly created Virtual Switch
This should enable the connection you use to connect to the internet to be accessible to the VM
Note: you may have to do a ipconfig /release
and ipconfig /renew
(Windows) or a sudo dhclient -v -r
and sudo dhclient -v
(Linux) on the remote machine to get it to renew its DHCP settings and retrieve an IP address.
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.
Without rebooting I managed to get it working with a wireless adapter, which otherwise was doing nothing.
Open the network connections control panel
You'll see the virtual adapter setting has created a network bridge.
Right click on your Wi-Fi adapter (the one with the signal strength icon) and select Connect/Disconnect
Then you have to click the On
switch that comes up in the sidebar and select your network. For some reason it was Off
even though I was online before.
Everything then magically lit up and I was able to access the internet from within my Win XP VM immediately.