fortypoundhead.com

Remove Ghosted NIC from a Windows VM

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


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 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.


Your IP address is:23.20.157.174

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


Beat With A Stick List Returns: By request, BWASL has returned to the site. Free your rage by telling the world about something that really grinds your gears. Add your beating.



Recent Forum Posts

BWASL returns
dwirch posted on May 13, 2017 at about 15:24 in Site News

BWASL returns
dwirch posted on May 13, 2017 at about 8:46 in Site News

Job Spammer: Balashankar Bose Bose
dwirch posted on May 11, 2017 at about 10:05 in Spammers

Job Spammer: Bharti Jigyasi
dwirch posted on May 11, 2017 at about 7:58 in Spammers

List of Shady Characters
dwirch posted on April 25, 2017 at about 16:39 in Webmaster Stuff

Job Spammer: Bilal Uddin
dwirch posted on April 25, 2017 at about 11:00 in Spammers