A Virtual switch helps in communication between different virtual machines and it forwards the traffic on the Internet. We can configure Private, Internal, and External Virtual Switches as per the requirement in Hyper-V. Sometimes due to problems on the host, accessing or installing a Network Switch is not possible. Some users faced a problem with the list of virtual switches in Hyper-V. In this article, we will learn what to do when you see An error occurred while trying to retrieve a list of virtual switches in Hyper-V.
An error occurred while trying to retrieve a list of virtual switches. The operation on computer failed: Generic failure.
An error occurred while trying to retrieve a list of virtual switches
To fix An error occurred while trying to retrieve a list of virtual switches message, follow the solutions mentioned below:
- Enable Protocol in Hyper-V Extensible Virtual Switch
- Create a Virtual Switch by using PowerShell
- Reinstall the Hyper-V
- Reinstall Network Adapter
Let’s get started.
1] Enable Protocol in Hyper-V Extensible Virtual Switch
In this solution, we are going to enable protocol in a Hyper-V extensible virtual switch. The physical network card of our computer can access the Hyper-V Extensible Virtual Switch. The virtual machine can communicate with physical network interfaces through an external switch. We have to select the network adapter that will be used by that particular switch. Follow the below steps to do the same.
- Press Windows + R key to the open run dialog box.
- Type ncpa.cpl and press enter button.
- Right-click on the network card used for creating an external switch and then click Properties.
- Tick Hyper-V Extensible Virtual Switch and then click Install.
- Select Protocol and then click Add
- Select Reliable Multicast Protocol and then click OK
- Click the Close button.
Now, open Virtual Switch Manager in Hyper-V and try to create an external network switch.
2] Create a Virtual Switch by using PowerShell
Some users had successfully created an External switch using PowerShell because this problem only occurs when using a GUI. Here we will learn to create an External Switch through PowerShell which will help to communicate with virtual machines and external networks. Now, in order to do the same, follow the guide mentioned below.
Press the Windows key and type PowerShell. Right-click on PowerShell and then select Run as Administrator. Click on the Yes button when prompted by UAC.
To create a new External virtual switch type the following command.
New-VMSwitch -name ExternalSwitch -NetAdapterName Ethernet -AllowManagementOS $true
-name: Using this command we can create a new virtual switch with the name vEthernet.
-NetAdapterName: This command is used to specify the physical network adapter to bind.
-AllowManagementOS parameter with a $true: This parameter of the command will allow the host OS to share the virtual switch and physical NIC with the VMs.
Finally, open Virtual Switch Manager in Hyper-V and check whether an external switch is visible in the list or not.
3] Reinstall the Hyper-V
If none of the above solutions work in your case, disable Hyper-V and then enable it, this way the problem can be solved. While disabling or enabling Hyper-V does not harm the virtual machine. It will be kept in Hyper-V Manager. Follow the prescribed steps to restart or reinstall Hyper-V on a Windows computer.
- Launch Control Panel from the Start Menu.
- Go to Programs > Programs & Features.
- Click on Turn Windows features on or off.
- Look for Hyper-V.
- Untick it and click Ok. You should ideally restart your computer before enabling the feature again.
After restarting, enable Hyper-V from the same panel and see if the issue persists.
- In order to do the same, follow the steps below.
- Open Device Manager from the Start Menu.
- Expand Network Adapters.
- Right-click on your network driver and then click on Uninstall device.
- After uninstalling the device, reboot your system and then check if the driver is installed.
- You can also download the network driver from the manufacturer’s website.
After installing a fresh driver, create your Virtual Switch and it will hopefully work.
Also Read: How to configure the Virtual Switch in Hyper-V.
What are the 3 types of connections to a virtual switch?
There are three types of Virtual Switches, External, Internal, and Private. Internal switches allow the Virtual Machine to communicate with the host, External switches enable communication between the VM and the network adapter, and a Private switch is there to communicate between VMs hosted on a single host computer.