Network interface disappears from VMware virtual machine

I recently had an issue where an interface on a VM disappeared from the VM configuration seemingly without warning. Checking the events showed that there had been no changes to the VM configuration by any other administrators. In the vmware.log for the VM I found the following lines:

This indicated that the interface had been hotplug removed. vSphere now supports more hotpluggable devices. While this makes it easier to add devices while the VM is running it also means that the devices can be removed. This means they show up in windows’ “Safely Remove Hardware” dialogue in the system tray:

So one mis-double click on the system tray icon causes the interface to be ejected from windows and removed from the VM configuration.

There is two ways to fix this:

Disable hotplug for the whole VM

Edit the registry on the VM to disable being able to eject the interface in windows

The former will of course stop you adding or removing any other hardware, not just the interface, while the VM is still running. This is probably the best option for VMware View VMs.

The latter will require a bit of hacking and isn’t really desired either.