Monday, October 15, 2012

Windows 8: Internet Access For VMs Using Wi-Fi Network Adapter

I know, this isn’t a Windows 8 blog and yet I want to share something nice about it.

When running Windows 8 and using the Hyper-V version 3 feature (which rocks BIG time) wouldn’t it be nice to use the Wi-Fi connection as internet access point for your VMs?

After some testing by myself and searching on the internet, I found the solution. The link provided earlier is a blog posting written for Windows Server 2008 R2 Hyper-V, but works on Windows 8 as well.

Since I like to visualize as much as possible I have made a small graphical representation of what is needed in order to make it work:
image

On the bottom of the picture you have the three key-items:

  1. On the most left side there are the VMs (yellow);
  2. In the middle you’ve got the hyper visor (green);
  3. On the most right side there is Windows 8, in this case running on a laptop (blue) .

The grey arrow runs right through these three key-items from left to right, depicting the dependencies: the VMs depend on the hyper visor which depends on Windows 8 running on the laptop hardware.

Every single key-items needs some configuration in order to make it work:

  1. Hyper visor (green)
    This is where the first configuration step is set: In the Virtual Switch Manager only an Internal Virtual Switch is created with the default settings, as depicted in the green pillar above this key-item.

  2. Windows 8 (blue)
    This side requires a bit more configuration but is easy as well:
    A: When Step 1 is finalized, a new NIC will be created, named vEthernet (Internal). This Adapter requires an IP address, but only an IP address and a subnet mask. Nothing more!

    Since this IP address will become the Gateway address for the IP configuration of all your VMs, give it an IP address like x.y.z.1 or x.y.z.254. Also use an IP address from the internal range of IPv4 addresses.

    B: Now share the internet connection of the Wi-Fi adapter with the vEthernet (Internal) NIC. Now this NIC will use the Wi-Fi internet connection for accessing the internet.

    In the blue pillar above this key-item the necessary configuration steps are depicted.

  3. VMs
    Create as many VMs as needed and the notebook allows for Glimlach. Per VM add a Network Adapter and use the Internal one for it. When the VM is fully installed and operational, configure the NIC in such a manner that the IP address will be in the same range as used for the vEthernet (Internal). Use a Gateway IP address the same address as defined for the vEthernet (Internal).
  4. In the yellow pillar above this key-item the necessary configuration steps are depicted.

And that’s it!

Now the VM will connect to its gateway which is the vEthernet (Internal) adapter as present in Windows 8. When you have a Wi-Fi connection to the internet, the Wi-Fi adapter will share this internetconnection with vEthernet (Internal) adapter, resulting in internet access for your VMs!

One last word…
Be careful though for the big bad internet: run anti-virus software on your VMs and keep the firewalls up since they face the same threats now as any other device connected to the internet!

No comments: