Fix: Can’t create Hyper-V 2019 Virtual Switch (Error 0x80070002)

Every virtual machine that is hosted on Hyper-V 2019 probably requires a virtual network card in order to communicate with the rest of the network. In order to do so, we would need to create a virtual switch and assign it to the virtual machine. There are three different virtual switches on the Hyper-V including private, internal and external. The private network switch provides only communication between virtual machines that are hosted on a physical server. Next to that, the internal switch provides communication between virtual machines and Hyper-V host. The last, but not the least one is the external switch. An external switch is bound to the physical network card and provide communication with the entire network. After we create a virtual switch, the next step would be to assign a virtual switch to the virtual machine. Which switch will we assign? It depends on the virtual machine’s use case.

Some IT Admin is experiencing problems when creating virtual switches on the Hyper-V, regardless if they are trying to create it via GUI or Powershell. One of the error is known as “Error applying virtual switch properties changes. Failed while adding virtual ethernet switch connections.”  The details show the GUID of the adapter, with the final text, “The system cannot find the file specified. (0x80070002). The same issue occurs not only on Hyper-V 2019 but also on Hyper-V 2016 and Hyper-V 2012.

There are a few reasons why this problem occurs, but many of them are pointing to a problem with the network card. We will focus on two of them and walk you through solutions that have helped IT admins to solve a problem. It includes updating the network card, deleting NIC references and re-adding Hyper-V role. So, let’s start. If solution 1 doesn’t solve your problem, please try with solution 2.

Solution 1: Update network card drivers

In our case, we are using physical server HPE ProLiant ML350 Gen10 Server. In order to update the driver for the network card, we would need to access the manufacturer website and download an official driver for the network card. As this server uses Intel’s network card, we can also download it on Intel’s website.

Solution 2: Reinstall Hyper-V role and reset NIC references

  1. Log in or connect to Windows Server 2019 where you installed Hyper-V role
  2. Open Server Manager
  3. Click on Manage and then choose Remove Roles and Features
  4. Click on Next under Before you begin
  5. Select the destination server and click Next
  6. Deselect Hyper-V under Remove server roles and then click Remove Features
  7. Click Next
  8. Click Next under Remove features
  9. Select Restart the destination server automatically if required
  10. Click Yes to confirm and then click Windows will automatically restart.
  11. Log in or connect to Windows Server 2019 where you installed Hyper-V role
  12. Right click on Start Menu and click Windows Powershell (Admin)
  13. Type netcfg -d and press Enter. This will delete all the NIC references, so be sure that you physical access to the server or have a good iLO or other management connection.
  14. Restart Windows Server 2019
  15. Log in or connect to Windows Server 2019 where you installed Hyper-V role
  16. Open Server Manager and install Hyper-V by following the same procedure as we use for removing the role. You will only need to select Hyper-V role.
  17. Left click on Start Menu and search for Hyper-V Manager
  18. Open Hyper-V Manager
  19. Navigate and open Virtual Switch Manager on the right side of the Hyper-V Manager window
  20. Select External under What type of virtual switch do you want to create and then click Create Virtual Switch
  21. Type the name of the external switch
  22. Choose network card under External network
  23. Click Apply and then OK
  24. Navigate to the virtual machine where you would like to assign a new virtual switch
  25. Right click on the virtual machine and click Settings
  26. Click on Network Adapter
  27. Choose the External virtual switch under Virtual Switch
  28. Click Apply and then OK
  29. Add IP address (if you are not using DHCP)
  30. Enjoy working with Hyper-V and virtual machines
ABOUT THE AUTHOR

Jasmin Kahriman


Jasmin is a tech-savvy Systems Engineer with over 15 years of experience in IT infrastructure, holding multiple IT certifications including CNIP, MTA, MCP, MCSA, MCT, Server+, and Network+.