In my last post about setting up Windows Server 2008 I mentioned that one issue I had was that you couldn't bind Hyper-V machines to the 802.11 wireless network connection. Today I spent a little time working on this and figured out a nice solution that seems to work well for me.
The solution is to setup an internal virtual network (much like you might do with Virtual Server). Setting this up is actually pretty easy.
- In the Hyper-V Manager, under Actions (right panel), click the Virtual Network Manager.
- In the Virtual Network Manager in the Create virtual network panel, select Internal and click the Add button.
- In the Virtual Network Properties change the Name to something useful (I've named mine Local Network as shown below).
At this point you should now have a new network adapter on your host machine. Note: I recommend you rename this new network adapter to something more meaningful than Local Network Adapter X. I've renamed mine to Virtual Local Network.
Now you can add this network to each of your virtual machines, but at this point, unless you assign an IP address in each connection, you won't be able to do much. This is where ICS comes in. To enable ICS follow these steps:
- Click on the network icon in the tray of your host machine and select Network and Sharing Center.
- From there click Manage network connections.
- Select the network adapter that you use to access the Internet. In my case this is my wireless network adapter. Right click it and select Properties.
- In the properties dialog select the Sharing tab.
- On this tab check the box that says "Allow other network users..." and then set the Home networking connection to be the network adapter that was created above (now you see why I said to rename it to something useful).
Windows will prompt you that it will set the IP address to 192.168.0.1 which should be fine. Now your virtual machines that have this network connection will automatically get an IP address and will be able to connect to the Internet (provided your wireless connection is working).
Because each adapter also gets an automatic you can now share files and folders between your host and your virtual machines which is important since you can't just drag-and-drop files like you can with Virtual PC.
So there you have it. You now have your virtual network setup and can access the Internet via your wireless connection with Hyper-V virtualization.
Update: Ben (the Virtual PC Guy) just posted a great explanation of Networking in Hyper-V which gives you more of what is actually going on.
Update[2]: Ok so Ben just posted again but explains how to use your wireless connection with Hyper-V. He probably does a better job of explaining it so if my post leaves you confused go read his. :)