Connecting and Disconnecting Virtual Devices
The vmware-command options connectdevice and disconnectdevice allow you to connect the following types of devices to your virtual machines and to disconnect them:
These devices must already be defined in the virtual machine virtual hardware list.
The command options connect and disconnect a defined ISO or FLP file or a physical device on the host. After you connect a device, its content can be accessed from the Guest OS. For network adapters, the options connect the virtual NIC to its defined port group or disconnect the NIC. This is equivalent to selecting or deselecting the Connected check box in the vSphere Web Client.
Note The terms CD/DVD drive, Floppy drive. and Network adapter are case-sensitive.
You can connect or disconnect devices if the following conditions are met:
The following examples illustrate connecting and disconnecting a virtual device. Device names are case sensitive.
The connectdevice option connects the virtual IDE device CD/DVD Drive 2 to the specified virtual machine.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx connectdevice "CD/DVD drive 2"
The disconnectdevice option disconnects the virtual device.
vmware-cmd -H <vc_system> -U <user> -P <password> --vihost <esx_host> /vmfs/volumes/Storage2/testvm/testvm.vmx disconnectdevice "CD/DVD drive 2"