If you do not want to permanently remove a device, you can prevent a virtual machine user or process from connecting or disconnecting the device from within the guest operating system.


Log in to a vCenter Server system using the vSphere Client.


Select the virtual machine in the inventory panel.


On the Summary tab, click Edit Settings.


Select Options > General Options and make a record of the path displayed in the Virtual Machine Configuration File text box.


Log in to the ESXi Shell and acquire root privileges.


Change directories to access the virtual machine configuration file whose path you recorded in Step 4.

Virtual machine configuration files are located in the /vmfs/volumes/datastore directory, where datastore is the name of the storage device on which the virtual machine files reside. For example, if the virtual machine configuration file you obtained from the Virtual Machine Properties dialog box is [vol1]vm-finance/vm-finance.vmx, you would change to the following directory.


Use a text editor to add the following line to the .vmx file, where device_name is the name of the device you want to protect (for example, ethernet1).

device_name.allowGuestConnectionControl = "false"

By default, Ethernet 0 is configured to disallow device disconnection. The only reason you might change this is if a prior administrator set device_name.allowGuestConnectionControl to true.


Save your changes and close the file.


In the vSphere Client, right-click the virtual machine and select Power Off.


Right-click the virtual machine and select Power On.