fortypoundhead.com

Remove Ghosted NIC from a Windows VM

Posted On 2014-08-20 by dwirch
Keywords:
Tags: HyperV Tip Tutorial Windows
Views: 1684


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 the Author

dwirch has posted a total of 180 articles.

You can find more information from dwirch by visiting http://www.derekwirch.com.


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.


Your IP address is:54.81.131.189

Before you can post, you need to prove you are human. If you log in, this test goes away.




Recent Forum Posts

Advanced search added
dwirch posted on September 23, 2017 at about 13:44 in Site News

Job Spammer: Gaurav Mehta - AgreeYa Solutions
dwirch posted on September 22, 2017 at about 10:35 in Spammers

Job Spammer: Prutha Siri - Javelin Systems
dwirch posted on September 10, 2017 at about 6:15 in Spammers

New security implemented
dwirch posted on September 7, 2017 at about 7:16 in Site News

Malicious IP Checker Companion Tool
dwirch posted on August 12, 2017 at about 20:24 in Site News

Job Spammer: Steve Adams
dwirch posted on August 8, 2017 at about 7:44 in Spammers