Since a few months I am the happy owner of a great laptop with SSD. Because I am running Windows 8 I can have the possibility to use Hyper-V on my local machine and that’s….Let’s say….GREAT !!
Now that I have this possibility, I run my TFS demo machine on my Hyper-V host. Because I copy-paste a lot between my host and TFS Machine, and want full screen demo’s, it is important for me to have the networking between the two working seamlessly.
When I use this, the first reaction of my audience is most of the times, How did you set this up?? So…In this blog post I describe how to set up connections between your host and virtual (TFS) machine so you can easily use Remote Desktop, use the internet on your host system and (if necessary) use internet on your virtual machine as well.
Create your network configuration on Hyper-V
Open Hyper-V Manager on your host system and navigate to Virtual Switch Manager.
Create a new virtual network switch and call this something like [My Internal Network]
Choose as Connection type [Internal network]
Create another network switch and call this [My External Network] and choose [External Network] as Connection Type. Point this one to your WiFi or Wired Network card. If you have both you can create two external network switches. One for WiFi and one for Wired. Make sure you leave the checkbox [Allow management operating system to share this network adapter] checked !!
Configure Host Network
Now that your Virtual networks have been set up, navigate to Network Connections in the Control Panel (on Windows 8 press WIN-W and type view network connections).
Hyper-V created a Network bridge and created a network icon for every network you added. Choose properties of your [vEthernet (My Internal Network)].
In the properties screen, choose IPv4 Settings, and configure a fixed IP for this internal network. Use an internal IP (e.g. 172.16.1.1) for this card. This way we make sure it is always the same regardless of the network you are currently connected to.
Configure Guest Virtual Machine
Open Hyper-V Manager. Make sure you have a virtual machine set up. Open the settings of the virtual machine and make sure you add 2 network cards.
Point the first network card to the virtual switch [My Internal Network]. If you like you can directly point the second network card to your external network, but you can change this when running the virtual machine as well.
Personally I never have internet connection on my virtual except when doing updates etc.
Configure networking on Virtual Machine
Now start up your Virtual machine and navigate to [View Network Connections].
Open properties for the network that is connected to [My Internal Network] and set the IP Address of the IPv4 connection to 172.16.1.2. If you use another range, use that range instead of course. Use the same range as you set on the host machine and only change the last number.
Make sure your firewall is configured to let through Remote Desktop connections and you’re good to go!
Hope this helps !