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

5 Answers 5

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.

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.

6
  • 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, 2017 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 8, 2017 at 9:25
  • worked for me: first removed Win X hyper V then ntcfg -d. great hint! Dec 27, 2017 at 22:16
  • Great ... this even preserved my TAP-driver and previous installed VirtualBox-HostOnly interface from deletion.
    – cljk
    Mar 23, 2018 at 6:11
  • +1 Worked like a charm. Got rid of all the leftover networking bits from other virtualization stuff too.
    – Corin
    Apr 5, 2018 at 14:18
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.

3
  • 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, 2018 at 16:59
  • 1
    @Tok' it's probably good point: I had Hyper-V disabled as well, added it to answer.
    – myf
    Jun 12, 2018 at 8: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 3, 2022 at 16:31
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.

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.