Blogs on Windows Server By MSFT WebCast
Hyper-V

How to Create and Configure a Virtual Switch with Hyper-V

Microsoft Hyper-V enables the deployment of virtual infrastructure by allowing the creation of virtual machines (VMs). In environments with multiple VMs, administrators use Hyper-V virtual switches to facilitate communication between the VMs, the host system, and external networks. This guide walks you through creating and configuring a virtual switch to connect your VMs to external, internal, or private networks.

What is a Virtual Switch in Hyper-V?

A Virtual Switch in Hyper-V acts like a traditional network switch but operates in a virtualized environment. It allows virtual machines to communicate with each other and with external networks based on how the switch is configured.

Hyper-V provides three types of virtual switches: External, which connects VMs to the physical network; Internal, which allows communication between VMs and the host only; and Private, which restricts communication to just the VMs on the same host.

Prerequisites

Before creating and configuring a virtual switch, ensure your computer meets the following requirements:

How to Create and Configure a Virtual Switch with Hyper-V

Creating an External Virtual Switch with Hyper-V Manager

After meeting all the prerequisites, you can proceed with creating your virtual switch. You can create Hyper-V standard virtual switches using either the Hyper-V Manager GUI or PowerShell commands.

To create a virtual switch in Hyper-V, launch Hyper-V Manager and follow these steps:

Open Hyper-V Manager.

From the Actions pane, select Virtual Switch Manager.

Select the type of virtual switch you want to create.

In this example, select External Virtual Switch as the switch type, then click Create Virtual Switch.

Note: SR-IOV cannot be enabled on an existing virtual switch. It must be configured when the virtual switch is created.

Click on Apply.

A warning will appear, notifying you that the change may disrupt your network connectivity. If you’re okay with this, select Yes to proceed.

Check that the external virtual switch named External-vSwitch01 has been created successfully. Click Ok to close the Virtual Switch Manager. You now have an external virtual switch that can be used to enable network communication for virtual machines, allowing them to connect to external networks.

The process of creating internal and private virtual switches is similar to that of an external switch. However, certain settings, such as network sharing and SR-IOV, will be unavailable (grayed out) due to the specific characteristics of these switches.

Creating an Internal Virtual Switch with Hyper-V Manager

Click on Virtual Switch Manager.

Select the Internal virtual switch type, then click Create Virtual Switch.

Enter a meaningful name for the virtual switch.

Select the Internal Network type, as you are creating an Internal Virtual Switch.

Click Apply and then OK to save and create the Internal Virtual Switch on Hyper-V.

Create a Private Virtual Switch using Hyper-V Manager

Click on New Virtual Network Switch.

Select the Private virtual switch type, then click Create Virtual Switch.

Connect VM to External Network using the Hyper-V Virtual Switch

In Hyper-V Manager, right-click your virtual machine and choose Settings… from the context menu.

Optionally, configure VLAN ID if your network uses VLAN tagging. Click Apply, then OK to save the changes.

Conclusion

Creating and configuring a virtual switch in Hyper-V is a simple yet effective way to manage network connectivity for virtual machines. Whether you’re setting up isolated test environments or production VMs with external access, the flexibility of Hyper-V’s virtual switch options makes it an essential tool for any system administrator.

Related posts

How to Install Hyper-V Role on Windows Server 2025

Manhar Rakholiya
3 weeks ago

How to Create a Hyper-V VM with PowerShell

Manhar Rakholiya
3 weeks ago

How to Enable Hyper-V on Windows 11

Manhar Rakholiya
2 weeks ago
Exit mobile version