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:
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\
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 the Author
dwirch has posted a total of 172 articles.
Comments On This Post
No comments on this post yet!
Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.
Or you can drop a note to the administrators if you're not sure where you should post.