Microsoft

Create a virtual switch in Windows 8 Client Hyper-V

See how to create a virtual switch in Windows 8 Client Hyper-V and examine the virtual switch settings in depth.

In last week's article, Get started with Windows 8 Client Hyper-V the right way, I showed you how to determine if your system is capable of running Windows 8's Client Hyper-V, how to make adjustments in the firmware, and how to install the Client Hyper-V software in Windows 8 Pro and Enterprise.

Once you install Client Hyper-V, the first thing that you'll need to do in preparation for creating a virtual machine is create a virtual switch in order for your virtual machines to connect to your network and the Internet. Once you have a virtual switch in place you can create your virtual machines and in the process connect them to your virtual switch.

This blog post is also available as a TechRepublic Screenshot Gallery.

In general, creating, and configuring a virtual switch is fairly straightforward, but it can be an intimidating procedure for two reasons. First, it is not something a lot of users have experience doing and second, there are a lot of options to weed through. Some of these options are required for a typical Client Hyper-V setup, but many aren't. So it is easy to wind up with an improperly configured virtual switch and not be able to connect to your network or to the Internet.

In this week's article, I'll show you how to create a virtual switch in Windows 8 Client Hyper-V. As I do, I'll examine the virtual switch settings in depth so you know what settings you need to configure and will understand how virtual networking functions in Client Hyper-V.

Quick terminology

As I discuss Client Hyper-V in this article, for simplicity I'll use the terms Host Machine and Virtual Machine. Just for the sake of clarity, Figure A illustrates what I mean by these terms.

Figure A

Host machine verses virtual machine.

The Virtual Switch Manager

In order for a virtual machine created with Client Hyper-V to connect to a network and to the Internet, it must have access to a virtual switch. So the first order of business is to launch the Virtual Switch Manager and create and configure how you want the virtual network connection to work. To begin, launch the Hyper-V Manager using the tile on the Start Screen, navigate to the Actions pane, and select the Virtual Switch Manager action, as shown in Figure B.

Figure B

You'll launch the Virtual Switch Manager to create a virtual network connection.
When you see the Virtual Switch Manager screen, as shown in Figure C, you'll notice that the first thing that you must do is choose what type of virtual switch you want to create. As you can see here are three options: External, Internal, and Private.

Figure C

The Virtual Switch Manager offers you three types of virtual switches to choose from.

Of course, the one you choose will depend on how you want to use your virtual machine and in most cases you'll choose the External option. However, let's take a moment to examine each of these options so that you have a good understanding of what each one does.

  • When you select an External virtual switch, your virtual machine will be able to access all resources available on your physical network including host machine and the Internet.
  • When you select an Internal virtual switch, your virtual machine will only have a network connection with the host machine. In other words, the virtual machine will not be able to access resources on your physical network nor will it have access to the Internet.
  • The only time that you would want to select the Private virtual switch, is if have more than one virtual machine running at one time and you only want a connection between your virtual machines.
Each of these types of virtual switches is illustrated in Figure D.

Figure D

Each type of virtual switch has specific uses.

Before I move on, I just want to point out that you can indeed have more than one virtual switch. For instance, you could have both an External virtual switch and an Internal virtual switch. You could then experiment with virtual machines in different types of network configurations.

Configuring an External virtual switch

As I mentioned, in most cases you'll choose to create an External virtual switch in Windows 8's Client Hyper-V. When you do, the Virtual Switch Manager will present you with the set of options shown in Figure E.

Figure E

You'll use the Virtual Switch Manager to set up your External virtual switch.

Starting from the top, you can assign your virtual switch a name and provide a description in the Notes section. As you can see, I have provided both a name and notes for my example virtual switch.

Moving down to the Connection type section, you'll notice that while the connection type that you selected previously is selected here, in this case External, you could change your mind and select one of the other two types of network switches.

When the Connection type is set to External network, you'll see that your system's network card is shown in the drop down text box and that the Allow management operating system to share this network adapter check box is selected. To simplify what this check box selection means, think of it as saying Allow host machine and virtual machine to use the same network card. In order for both machines to use the same network card to access the physical network, the Virtual Switch Manager actually creates two virtual network cards, one for the host machine and one for the virtual machine, and then connects these to the virtual switch. The virtual switch is then connected to the physical network card which is already connected to the physical network. This configuration is illustrated in Figure F.

Figure F

The host machine is actually connected to a virtual network card.
In most cases, you'll leave the default selections for the External network just as they are. However, let's examine how these options work. Let's suppose that your system has two network cards in it: an Ethernet card called NC1 and Wireless card called NC2. If so, you could separate the network connections of your virtual machine and your host machine such that each would use a separate network card. To do so, you would select the network card that you wanted to use for the External network, say NC2, and then clear the Allow management operating system to share this network adapter check box. Then, the host machine would use NC1 to connect to the physical network and the virtual machine would use NC2 to connect to the physical network.

As you can see, by default the Enable virtual LAN identification for management operating system in the VLAN ID section is not selected. Chances are that you won't use this feature in a typical Client Hyper-V configuration. If you had a VLAN, or Virtual Local Area Network, you could use this option to specify an identification number that could be used to isolate network traffic from the host machine.

Other options

There are a two other sets of options that you can configure from within the Virtual Switch Manager and these appear in the left panel. The first one is called Extensions and it appears under your virtual switch. The second one is called MAC Address Range and appears under Global Network Settings. Again, both of these are advanced features and chances are that you won't use them in a typical Client Hyper-V configuration, but they are worth taking a look at, just so you know what they are all about.

Virtual Switch Extensions settings, shown in Figure G, provide you with a way to enable and add third-party extensible plug-ins to the virtual switch. These plug-ins can add enhanced networking and security features to a virtual network switch.

There are two options in the Switch extensions list: Microsoft NDIS Capture and Microsoft Windows Filtering Platform. As you can see, by default the Microsoft Windows Filtering Platform check box is selected while the Microsoft NDIS Capture check box is not. Without getting too technical, Capturing extensions are used to capture and monitor packet traffic while Filtering extensions are used to inspect, drop, or exclude packets. You can learn more about Virtual Switch Extensions here.

Figure G

Virtual Switch Extensions can add enhanced networking and security features to the virtual switch.

As I said, these types of Virtual Switch Extensions won't generally be used in a typical Client Hyper-V configuration, so just leave the default settings as they are.

MAC Address Settings, shown in Figure H, displays the range of MAC addresses that are available to be assigned to the virtual network cards that the Virtual Switch Manager can create. Under normal circumstances, the default range of MAC addresses is sufficient for Client Hyper-V and you won't need to alter it.

Figure H

MAC Address Settings displays the range of MAC addresses that are available to be assigned to virtual network cards.

Completing the configuration

When you are done configuring your External virtual switch, click OK. When you do, you'll see a warning message indicating that during the virtual network connection procedure, the network connection for the host machine may temporarily go offline. When you click Yes, the changes will be applied and you'll see a progress bar. These steps are illustrated in Figure I.

Figure I

When you are done configuring your External virtual switch, click OK.

Checking the connection

Many of the folks that I have spoken to about setting up an External switch find it surprising that the host machine is actually connected to a virtual network card after you set up a virtual switch for your virtual machine. But its true and you can see for yourself by investigating the Network Connections tool or even on the command line with IPConfig.

Figures J and K show before and after screenshots of the Network Connections tool and the results from running the IPConfig command on the host machine.

Figure J

Running the Network Connections tool on the host machine.

Figure K

Running the IPConfig command on the host machine.

What's your take?

Have you attempted to create a Virtual Switch in Windows 8's Client Hyper-V and encountered problems? Does this article help you to better understand how Client Hyper-V connects to a network? As always, if you have comments or information to share about this topic, please take a moment to drop by the TechRepublic Community Forums and let us hear from you.

Also read:

About

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

6 comments
Rohilabaji
Rohilabaji

I think this article it’s so typical for beginner who want to learn this. You should do more explanation and give them some example for comfortable for beginners.

http://www.doneassignment.co.uk/

KeMystery
KeMystery

Thanks for this simple straight-forward article. I was over-complicating things and ended up with no network connection. I had to delete the virtual switch. Read this article and the creation was seamless.

templink
templink

well that explains why my host lost its internet connection, but doesn't help that much in fixing it. I'm going to do a system restore in hopes of restoring internet on my host..

Webminotaur
Webminotaur

Greg,

This step went quite smoothly, too.

On to the next step....

FloridaGeekster
FloridaGeekster

Make sure that if you've made any changes in the VM's Network Adapter settings before you read this you undo any of those including dynamic Mac addressing. The new VM switch will automatically set all these for you after the switch is created.

ShortStock
ShortStock

Great how-to for those of us that older and trying to keep up. Just bought a Surface Pro but still need XP capes.

Editor's Picks