How to create Hyper-V virtual switch [Step-by-step guide]

Reading time icon 3 min. read


Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team. Read more

Configure Hyper-V Virtual switches

Previously we have shown you how to add network adapter to Windows 10 Hyper-V virtual machine.  In this post, we look at how to create Hyper-V Virtual Switch in Windows virtual machines.

Knowing how to create and manage Hyper-V virtual switches is a critical aspect of managing and maintaining your Hyper-V virtual machines. In this article, we will show you all the methods to configure and deploy Hyper-V virtual switches.

Follow the steps in this article to create Hyper-V virtual switches on Windows computers. There are two ways to do this, and we have listed both of them.

Steps to create Hyper-V virtual switch

1. Create virtual switch using Hyper-V Manager

  1. Creating virtual switches using the Hyper-V virtual manager is easy. Here is how to configure it.
  2. Open Hyper-V Manager on your Windows computer.
    Create-hyper-v-virtual-switch
  3. From the right pane click on “Virtual Switch Manager” under Actions. It will open the Virtual Switch Manager wizard.
  4. In the wizard, choose the “New virtual network switch” option.
    Create-hyper-v-virtual-switch
  5. Next, select the type of virtual switch you want to create. There are three types of the virtual switch which I have explained below.
    Private Virtual Switch – This switch only allows communications between the connected VMs that are connected to the private virtual switch.
    Internal Virtual Switch – This switch only allows communication between virtual adapter connected to connected Virtual Machines and the operating system.
    External Virtual Switch – This switch allows communication outside the host. This is due to the switch being connected to a physical network adapter installed in the Hyper-V.
  6. Select you prefered type of virtual switch and click on Create Virtual Switch button.
  7. Name your new virtual switch.
    Create-hyper-v-virtual-switch
  8. For Connection Type, select “External Network” and select the network connection from the drop-down menu.
  9. Check “Allow management operating system to share this network adapter” box. These options depend on the virtual switch type selected by the user.
  10. There is an option to enable “VLAN ID” for LAN identification. Leave it unchecked, if you don’t know what it does.
  11. Once done, click on Apply and OK to complete new virtual switch configuration.

How to fix the Hyper-V Error applying hard drive changes


2. Create Hyper-V virtual switch using PowerShell

Configure Hyper v virtual switch

  1. One advantage of using PowerShell to create a virtual switch is the automation it offers in the Hyper-V environment. It also expedites the process by creating virtuals switch with a few commands.
  2. Right-click on “Start” and select Windows PowerShell (admin).
  3. In the PowerShell window, enter the following command and hit enter:
  4. This command will show network adapters. Take note of the names.
    Get-NetAdarpte 
  5. External Switch – The following command creates a new External switch. Make sure to replace switch name and network adapter name accordingly.
    New-VMSwitch -name < switch name > -NetAdapterName < network adapter name > -AllowManagementOS $true
  6. Internal Switch – The following command creates a new Internal Switch. Make sure to replace the switch name and network adapter name accordingly.
    New-VMSwitch -name < switch name > -SwitchType Internal
  7. Private Switch – The following command create a new Private Switch. Make sure to change the switch name and network adapter name accordingly.
     New-VMSwitch -name < switch name > -SwitchType Private
  8. Execute any one of the above commands to create Hyper-V virtual switch.

Conclusion

These are the two ways to create Hyper-V virtual switch in Windows virtual environment. Do let us know your thoughts in the comments below.

RELATED STORIES YOU MAY LIKE:

More about the topics: Hyper-V issues, windows 10

User forum

0 messages