When using virtualization on a Microsoft environment such as Hyper-V you can easily have network problems when restoring a Virtual hard drive or changing a network card. With some operating systems on Hyper-V you may notice that the network adapter “MS Virtual Machine Bus Network Adapter” name changes and a number is associated with it, example “MS Virtual Machine Bus Network Adapter #3”.

This happens when you load an image from your backup. This will sometime cause network connectivity issues, due to the fact that other network adapters will still be configured (hidden) in the device manager which still lock your IP address. This will also cause the issue whereby although you configure the current network adapter (as seen in the Device Manager), no network activity can be achieved. Unfortunately these devices will not show directly in your device manager, so the following steps must be taken.

This can easily be removed by opening the command prompt with administrative access and typing the following command:

set devmgr_show_nonpresent_devices=1
start devmgmt.msc

This will start the Device Manager. It is important to start the Device Manager from the same command prompt, since it will lose the setting to show the non present devices. If you open the Device Manager from the Control panel, the hidden devices will not show.

When the Device Manager loads, from the File menu, expand the View and select the Show Hidden Devices option. This will enable and show any old un-used devices in the window. From here, expand the Network Adapters node and you can right click on the devices which are extra and delete them accordingly.

Another method which can be used to identify the hidden devices is a free tool from Microsoft called ‘devcon’ which is a command line alternative to the Device Manager, but it will not work since it only removes present devices. Maybe Microsoft will be adding this feature in the future releases of the tool, but for now, although it will show hidden devices, it is not capable of removing them. It will give an error saying ‘Remove failed. No devices removed.’

After this is done, your network adapter will be free and you can set up the correct network settings. This method of hidden device removal can be used for any type of device. Since this option may come in handy in your daily job, it would be best to configure the setting to show non-present devices in the Environment Variables from the system properties so that every time the server is loaded, the setting will be automatically configured and you will be able to see the hidden devices without running through the above commands. This can be set by clicking the New button in the System Variables frame and in the variable name enter ‘devmgr_show_nonpresent_devices’and in the variable value enter ‘1’.

After this is done, your network adapter will be free and you can set up the correct network settings. This method of hidden device removal can be used for any type of device. Since this option may come in handy in your daily job, it would be best to configure the setting to show non-present devices in the Environment Variables from the system properties so that every time the server is loaded, the setting will be automatically configured and you will be able to see the hidden devices without running through the above commands. This can be set by clicking the New button in the System Variables frame and in the variable name enter ’devmgr_show_nonpresent_devices’, and in the variable value enter ‘1’.