Search Tools Links Login

Remove Ghosted NIC from a Windows VM


After performing a V2V, P2V or a clone operation in which the VHD/VHDX file is copied to a new VM, a new NIC is installed in the virtual machine.  This is evidenced by the need to once again set the IP configuration of the NIC.

Failing to remove this NIC can cause problems with some monitoring software, not to mention you'll get a popup error (if you are configuring the NIC with the same IP address) like this:

​"The IP address x.x.x.x you have entered for this network adapter is already assigned to another adapter."

Removing the ghost NIC is a simple process, but requires you to set an environment variable prior to running device manager.  The entire process is described below.

First, fire up an elevated command prompt by pressing the Windows key on your keyboard, typing the letters CMD.  The command prompt will float to the top of the search list on the right.  Right click the command prompt entry, and select Run as administrator.

Next, type the following in the command prompt:

set devmgr_show_nonpresent_devices=1
start devmgmt.msc

You'll be presented with the trusty device manager.  If you expand the Network Adapters branch now, you won't see your ghosted NIC.  You need to enable the viewing of hidden devices first.  Click on View on the top line menu bar, then select Show hidden devices.

Note that if you are running Active Directory, you can push out the following registry modification to bypass this "devmode" part of the procedure.

System Key: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\
Environment]
Value Name: DEVMGR_SHOW_NONPRESENT_DEVICES
Data Type: REG_SZ (String Value)
Value Data: (1 = show all hidden devices)

Now, if you expand the Network Adapters branch in the tree, you'll see the extra network adapter.  Pay attention to the icons on the left of the names.  The grayed out one is the one that is a ghost.  Right-click the NIC, and select Uninstall.

Click OK on the confirmation dialog, and your ghosted NIC will be removed.

Take note: This problem is not specific to HyperV.  It happens in VMware ESX as well.

About this post

Posted: 2014-08-20
By: dwirch
Viewed: 2,325 times

Categories

Tip

Tutorials

Hyper-V

Windows

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.