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.

1

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

2

Select the virtual machine in the inventory panel.

3

On the Summary tab, click Edit Settings.

4

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

5

Log in to the ESXi Shell and acquire root privileges.

6

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.

/vmfs/volumes/vol1/vm-finance/
7

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"
Note

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.

8

Save your changes and close the file.

9

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

10

Right-click the virtual machine and select Power On.