VMware Cloud Community
Pierrick77
Contributor
Contributor

Enable or disable a USB port from a VM

Hi Guys,

One of my VM is using an external storage connected on the host virtual machine.

This external storage must be only accessed by this specific VM.

Do you know if it is possible for my VM to SSH the host and use a command to enable or disable the USB port?

Indeed, I would like to enable the port when the VM will need to copy some files to the external storage and disable the port when no needs.

Thanks for your help!

0 Kudos
3 Replies
daphnissov
Immortal
Immortal

I think the best think you can do is have a script that removes the device and re-adds it. Just out of curiosity, why would you want to even do this if the storage can only be used by the VM to which it is being passed through?

0 Kudos
Pierrick77
Contributor
Contributor

Indeed, I realize that I want to switch off the energy of the USB port...

My external storage starts as soon as it is connected to an USB port and to preserve energy, noise and heat, I want to disconnect it without unplug manually...

0 Kudos
daphnissov
Immortal
Immortal

You're not going to be able to do that with ESXi, I'm afraid.

0 Kudos