How to set up networking for your Hyper-V (TFS) machine

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 !!

image

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.

image

Create a new virtual network switch and call this something like [My Internal Network]

image

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 !!

image

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)].

image

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.

image

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.

image

image

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.

image

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.

image

Last checks

Make sure your firewall is configured to let through Remote Desktop connections and you’re good to go!

Hope this helps !

Advertisements

Comments are closed.

%d bloggers like this: