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:

  1. Start >> Run
  2. Type cmd and then press Enter
  3. From the command prompt, run the following command:
    set devmgr_show_nonpresent_devices=1
  4. From the same command prompt, run:
    start devmgmt.msc
  5. This will launch Device Manager
  6. From here, click View >> Show Hidden Devices
  7. Expand the Network Adapters tree
  8. Any dimmed or greyed out NICs are ghost network adapters
  9. To remove, simply right-click and select Uninstall
  10. Repeat for all ghost network adapters present
  11. 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:

  1. Take VM snapshot
  2. Record static IP information (if applicable)
  3. Disconnect current NIC
  4. Shutdown VM
  5. Remove old NIC
  6. Add VMXNET3 NIC (in an unconnected state)
  7. Start VM
  8. Remove ghost network adapter(s) as per above process
  9. Re-configure static IP on new NIC
  10. Connect new VMXNET3 NIC
  11. Test incoming and outgoing connectivity
  12. 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

Comments

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

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

  2. This is especially problematic when changing virtual network adapters and not being able to remove IP configurations from old adapters.

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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.