Skip to main content

Unable to create / edit a virtual switch in Hyper V (win x64)

Symptoms​

When using Hyper V on a 64-bit Win 10/11 you may see errors when attempting to create, delete or modify a virtual network switch. Examples include:

  • Failed while adding virtual Ethernet switch connections.
  • Unable to bind to interface.

Cause​

According to Microsoft ([https://docs.microsoft.com/en-us/troubleshoot/windows-client/virtualization/cannot-create-hyper-v-virtual-switch](https://docs.microsoft.com/en-us/troubleshoot/windows-client/virtualization/cannot-create-hyper-v-virtual-switch)): This problem occurs because a new network setup functionality introduced in Windows 10 doesn't completely delete all objects from the previous vSwitch installation. `This problem is scheduled to be fixed in the next Windows 10 update. Note that several Windows updates later, including in Windows 11, the issue still exists.

Resolution​

The Microsoft article above recommends using an [Easy fix wizard](https://aka.ms/easyfix20159) which seems to clear down network objects that should have been deleted.

Additional resolution notes​

Solution works (both Win 10 and Win 11) for the actual creation of the new object from a powershell (admin) prompt you can use the [New-VMSwitch](https://docs.microsoft.com/en-us/powershell/module/hyper-v/new-vmswitch) command:

\${NL}New-VMSwitch -name ExternalVirtualSwitch -NetAdapterName WiFi -AllowManagementOS $true \${NL}

When this command runs it will show a 'progress bar' on screen. Progress jumps quickly to ~80%, at which point you should disable, then re-enable, the WiFi or whichever network adapter you are connecting to. `Make sure that you have the network connections window up ready - you only have a couple of seconds to disable/enable the network adapter.