Edit

Azure VM Ghosted Nic Validation and Cleanup Tools

Applies to: ✔️ Windows VMs

Summary

This article provides information about the Azure VM Ghosted Nic Validation and Cleanup Tools, which are designed to help diagnose and resolve issues related to ghosted network interface cards (NICs) in Azure virtual machines (VMs). The tools can detect and remove ghosted NICs that may cause connectivity, performance, Windows Update, and other issues in Azure VMs.

When an Azure Virtual Machine running Windows Server or Windows Client with Accelerated Networking enabled is deallocated, the following may occur:

  • Connectivity issues may occur for the active NIC
  • Interference with scripts or automation that enumerate NICs
  • Stale IP configurations associated with removed adapters may be present
  • Windows Update download issues
  • Performance issues
  • Windows Activation failures

Ghosted nics can happen to Azure virtual machines (VMs) causing connectivity, performance, Windows Update, and other issues. Microsoft provides a script-based tool to help diagnose and clean-up the ghost-nic issues.

Purpose

There two scripts that can be used to detect if there are 'ghosted nics' inside of the VM. A VM that has one ore more could experience issues.This script detects ghosted (disconnected) network interface cards (NICs) and remove them from the registry.

Key features

  • Detects for Ghosted Nics
  • Removes Ghosted Nics

For more information, see:

How to run the tools

You can run either of the tools in any of the following manners:

1. Manual Removal via Device Manager**

  • Open Device Manager → View → Show hidden devices → Remove ghosted NICs.

1. Detect and Remove using provided tools

Download from GitHub and run within the VM

Download the scripts from GitHub, and then run them manually. To access the scripts, follow the resource links in the previous sections.

Use Azure Run Command

  • Navigate to your VM in the Azure portal: > Operations > Run Command.
  • Select the script from the list (see the following screenshot).

Only the Azure VM - Windows Ghosted NIC Check Warning Script is available in this method. The other script can be run via the Run Command prepackeged method.

Azure portal view Run Command example.

Note

Alternatively, you can run these commands by using a command-line interface (CLI) tool, Windows PowerShell, or Windows on ARM.

Use prepackaged Run Command scripts

For more information, see Run scripts in your Windows VM by using action Run Commands.

  1. Run Azure VM - Windows Ghosted NIC Check Warning Script to verify activation status and detect common issues.
  2. If ghost-nics are detected, run Azure VM - Windows Ghosted NIC Check Removal Script to remove them.

Additional resources

Third-party contact disclaimer

Microsoft provides third-party contact information to help you find additional information about this topic. This contact information may change without notice. Microsoft does not guarantee the accuracy of third-party contact information.