Removing ghost network adapters
Recently I found a number of VMs with old network adapters (i.e. Flexible or E1000). To improve performance and reliability, I decide to upgrade these NICs to VMXNET3.
Not as easy as it seems…
Originally I thought this was going to be really easy and I was going to follow something like the following process:
- Record static IP information (if applicable)
- Shutdown VM
- Remove old NIC
- Add VMXNET3 NIC
- Start VM
- Re-configure static IP
- Test and then reap the rewards
Unfortunately it wasn’t so simple, as when I went to re-configure the static IP I got the following error: The IP address XXX.XXX.XXX.XXX you have entered for this network adapter is already assigned to another adapter
The thing was…. I couldn’t see another adapter, only one was visible in Windows!
The fix
The reason why this happens is because the old network adapter hasn’t actually been removed from Windows, it is just hidden. In other words it is a ghost network adapter or a phantom network adapter.
So to remove a ghost network adapter, do the following:
- Start >> Run
- Type
cmd
and then press Enter - From the command prompt, run the following command:
set devmgr_show_nonpresent_devices=1
- From the same command prompt, run:
start devmgmt.msc
- This will launch Device Manager
- From here, click View >> Show Hidden Devices
- Expand the Network Adapters tree
- Any dimmed or greyed out NICs are ghost network adapters
- To remove, simply right-click and select Uninstall
- Repeat for all ghost network adapters present
- Close Device Manager. You will now be able to set the static IP
Final Upgrade Process
For those of you who are interested, here is the actual process I followed to upgrade older NICs to VMXNET3:
- Take VM snapshot
- Record static IP information (if applicable)
- Disconnect current NIC
- Shutdown VM
- Remove old NIC
- Add VMXNET3 NIC (in an unconnected state)
- Start VM
- Remove ghost network adapter(s) as per above process
- Re-configure static IP on new NIC
- Connect new VMXNET3 NIC
- Test incoming and outgoing connectivity
- Once confirmed working in production, remove VM snapshot
I know this is a bit of a long process, but it worked really well for me. Out of 25 or so VMs, I only had problems with one where for some reason it lost its gateway address. Not bad for a fairly risky upgrade.
Even more info?
If you want more info, then check out the following links:
Hope this has helped someone out there. If it has or you have a question, send me an email or post a comment below.
Merry Christmas and Happy New Year 😀
Luca
Removing ghost network adapters | 9to5IT
Many thanks for applying time in order to compose “Removing ghost network
adapters | 9to5IT”. Thank you again -Shanon
Thanks Shanon, glad it helped!
Awesome work!!! Saved my life!!! (and my job!)
Hi Luca,
Do we have any script to remove the Ghost network adapters, as we have around 2000 VMs which needs to be updated, i scripted everything else except this.
Any Help will be appreciated.
Thanks
Mounika
Hi Mounika,
I don’t have one that I have written unfortunately. All I have done in the past was execute a script that would run the command to show the ghost network adapters and then launch Device Manager and then someone would need to manually remove it. I did it this way because the IP settings needed to be re-configured and tested on each of the VMs anyway, so there was no need for a complete automated process.
I am sure there would be a way, just might need to do a little googling.
Thanks
Luca
This is especially problematic when changing virtual network adapters and not being able to remove IP configurations from old adapters.
I have a ghost network adapter (VirtualBOX one) but it is not listed, neither normal, neither hidden, neither grey, etc.
It neither appears on RegEdit seach.
But each time i install VirtualBOX the Host-Only adapter has a “#2” after and if i try to rename it without it, Windows says there is already one with that name.
It happens when installing VirtualBOX 5.2 after a clean Windows 10 (1709) install.
With respect !!!
WOW, best trick ever! Thank you for having this solution available, i refer to it from time to time!