Windows Server 2012 Hyper-V VM's and Networking

ComputerBox34

[H]F Junkie
Joined
Nov 12, 2003
Messages
13,763
I've been looking to setup a few VM's on my setup at home so that I will always have a desktop to connect to and "work" once I VPN into my network.

From what I've seen in YouTube videos, the process for setting up a VM in Server 2012 is fairly straight forward but I am somewhat confused on the networking aspect of it.

For example - if my server is at 10.0.1.10, how do I get it to provision another IP such as 10.0.1.11 to a VM that I create so that I can connect to it via RDP or VNC?

The server is pretty much just a ASUS Desktop Board with a i5 3xxx processor. (don't remember exact number) Has 16 gb of RAM and boots of a 128 gb SSD with a 10 TB storage array attached.

Mobo only has 1 NIC - would I need a 2nd? Or would I be forced to provision a port specifically to connect to the Virtual PC such as 10.0.1.10:5000?
 
Your networks dhcp server will assign the VM an IP address. Or you could also set it static.

When you setup hyperv you will need to configure a vswitch and bind it to your nic. When you create the VM you will choose that vswitch.

You will need to configure port forwarding as normal to your vm's IP.
 
Your networks dhcp server will assign the VM an IP address. Or you could also set it static.

When you setup hyperv you will need to configure a vswitch and bind it to your nic. When you create the VM you will choose that vswitch.

You will need to configure port forwarding as normal to your vm's IP.
So something similar to what this guy did towards the end of the article? http://lennytech.wordpress.com/2013/03/29/setting-up-a-virtual-switch-for-a-hyper-v-network/

Next question would be how does this affect MAC addressing?

Right now my gateway/DHCP server assigns IP's by MAC addresses. How would it know the difference between the Host OS (what I would want to reach when I type server.mydomain.com) and the VM's?
 
The Virtual Switch assigns each VM a MAC address, from the predefined pool. You can also set the MAC address static in the NIC settings for the VM. Your router/gateway sees the virtual address just like it sees physical.
 
For example - if my server is at 10.0.1.10, how do I get it to provision another IP such as 10.0.1.11 to a VM that I create so that I can connect to it via RDP or VNC?

I think microsoft does recommend that you have a bunch of extra NICs: at least one for the computer, and one for the virtual machines

setup is easy
 
I'd say this depends a lot on what you're going to be doing with your HV server overall.

First and foremost, the Microsoft recommendation of a dedicated Host NIC is a sensible one; it's meant to keep you from the OH Sh*t scenario when you've accidentally misconfigured something. Also, depending on the rest of your network, you'll do quite a bit of VHDX moving on this nic before all is said and done.

Second, you might want to look at the Intel Desktop Gigabit PCIE nics if you're looking to keep costs down. These run for $25-$30, have many of the features as their big brother server versions, and are so superior to their Realtek counterparts, it's not even worth mentioning them in the same breath.

Lastly, you have several networking options available to you in Hyper-V environments:
1) Private networking -- This equates to vNICS that enable virtuals to talk to one another but not to the physical network. In other words, mostly pointless for anything other than testing and modeling purposes. I'm sure there are some who'll disagree, but if you're planning to talk to the outside world from your virtual, move along and don't even pay attention to this type of network.

2) Internal networking -- Internal Networks are somewhat akin to NAT networks in VMware; you create the internal switch, and "poof" ... suddenly a new virtual nic shows up on the host. That vNIC is your "gateway" to the virtuals, and theirs to the outside world. If you want to talk to your virtuals from other physical machines that are not your host hv box, remember you'll need to add a route.

With 2012 and Powershell networking comes some newness worth playing around with: namely the ability to take a team of physical nics in aggregate, and create multiple virtual switches, carving the bandwidth via qos, acls, etc.and end up with a true virtualized converged network. this may sound complex, and in reality it is a rather dense concept both in theory and form, but damn if it ain't easy to deploy..... seriously. google for hyper-v converged network powershell script and you'll be minutes away from a finished topology.

3) The External Network -- The bread and butter for most Hyper-V server deployments, you dedicate your physical nic to the Hyper-v environment (you don't have to "dedicate" the NIC by the way, you can just share it, but it's generally recommended to avoid allowing pNICS to transport both host and virtual network traffic)

Hope that helps.
h-_
 
Back
Top