22

How to clean that hyper-v mess?

I just want to delete all of them.

And yes, right click -> uninstall does nothing :(

enter image description here

I tried deleting the regedit entries and got a permission denied.

I tried to set permissions to the entries and got a access is denied:

C:\> subinacl.exe /subkeyreg HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\ROOT\VMS_VSMP\0002 /grant=administrators=F

SYSTEM\ControlSet001\Enum\ROOT\VMS_VSMP\0002 : new ace for builtin\administrators
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\ROOT\VMS_VSMP\0002 - RegSetKeySecurity Error : 5 Access is denied.


SYSTEM\ControlSet001\Enum\ROOT\VMS_VSMP\0002\Device Parameters : delete Perm. ACE 2 builtin\administrators
SYSTEM\ControlSet001\Enum\ROOT\VMS_VSMP\0002\Device Parameters : new ace for builtin\administrators
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\ROOT\VMS_VSMP\0002\Device Parameters : 2 change(s)
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\ROOT\VMS_VSMP\0002\Properties - AddAce error : 87 The parameter is incorrect.


HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Enum\ROOT\VMS_VSMP\0002\Properties: 5 : Unable to enumerate subkeys
Christopher_G_Lewis
  • 3,647
  • 21
  • 27
Andre Carlucci
  • 371
  • 2
  • 4
  • 11

5 Answers5

19

The nuclear option that works with Windows Core is using netcfg to wipe out all your networking settings and re-initialize the network card drivers.

#WARNING! DANGER! THIS WILL DELETE ALL YOUR NETWORKING SETTINGS!
netcfg -d

That seems to work better than nvspbind.exe or various other PowerShell commands when I really screw up my Hyper-V VMSwitch or LBFOTeam networking settings.

Greg Bray
  • 5,530
  • 5
  • 33
  • 52
  • 2
    Incredibly, your command only deleted the virtual adapters and left the real ones untouched. That's as good as it gets. – andreszs Sep 19 '17 at 22:22
  • 1
    Works on Windows 10 to clean up vEthernet adapters left after Hyper-V uninstalling. Physical cards are up after reboot. – Maris B. Nov 08 '17 at 09:25
  • worked for me: first removed Win X hyper V then `ntcfg -d`. great hint! – Joe Platano Dec 27 '17 at 22:16
  • Great ... this even preserved my TAP-driver and previous installed VirtualBox-HostOnly interface from deletion. – cljk Mar 23 '18 at 06:11
  • +1 Worked like a charm. Got rid of all the leftover networking bits from other virtualization stuff too. – Corin Apr 05 '18 at 14:18
  • for me all is removed but not hyper-v "Skipping the removal of "Hyper-V-Adapter - virtuelles Ethernet" – dermoritz Oct 21 '20 at 15:36
10

Following directions from the article Removing "Stale" Network Adapters in Hyper-V VM by Jeremy Jameson:

  1. Start an administrator command prompt;
  2. Run
    1. set devmgr_show_nonpresent_devices=1
    2. start devmgmt.msc
  3. In newly opened Device Manager "Uninstall" option in context menus worked for me (Win10 Pro).

Must say I tried the netcfg -d prior to this, but it had no observable effect. Also I had Hyper-V disabled at the time of this process.

myf
  • 101
  • 1
  • 5
  • 1
    Accepted answer was not available (it seems like Hyper-V has to be enable) for me but this one did the job while Hyper-V is disabled. – Tok' Jun 11 '18 at 16:59
  • 1
    @Tok' it's probably good point: I had Hyper-V disabled as well, added it to answer. – myf Jun 12 '18 at 08:44
  • I had VPN configuration on my company laptop and could not risk to loose that using `netcfg -d`. Manual deletion of Hyper-V vEthernet adapters worked perfectly. – VisorZ Feb 03 '22 at 16:31
5

You want the "remove-vmnetworkadapter" cmdlet in PowerShell. Merely looking at Device Manager will only allow you to add or remove device drivers from "devices" in the machine, where in this case the device is virtual.

If you want a list of the virtual NICs that are exposed to the management OS (which is what you're showing above) you can use this command:

Get-VMNetworkAdapter -ManagementOS

Then you can find the ones that you don't want and delete them with remove-vmnetworkadapter. Once the virtual switch stops reporting them as NICs in the machine, they'll disappear from Device Manager.

Jake Oshins
  • 5,116
  • 17
  • 15
2

I solved this by:

In PowerShell type: netcfg -d

This WILL DELETE all network adapters AND network SETTINGS! Physical adapters will NOT be LOST. Then i restored my network settings and created new External Virtual Switches. This worked for me fine and fast.

Windows 10 64bit there.

Dzintars
  • 181
  • 1
  • 1
  • 7
0

if that doesn't work. right click on the adapter, properties. Click on Configure at the top, on the 3rd tab on Driver. Uninstall the driver and close the mask. the problem should be solved after pressing F5.