vCenter

 View Only
  • 1.  Send keystroke to VM via API

    Posted May 22, 2022 03:11 PM

    Hello!

    Does anyone know whether it's possible to send a keystroke like Ctrl+Alt+Del to the VM via an API (I'm using pyVmomi).

    This feature is available in vCenter and host UI, as well as in the webMKS API. The latter is client-side JS API, but is there a way to do that using server-side API (pyVmomi for example)?



  • 2.  RE: Send keystroke to VM via API

    Posted May 25, 2022 11:42 AM

    I found an answer myself. There is vm.PutUsbScanCodes method. Here is a python example.



  • 3.  RE: Send keystroke to VM via API

    Posted May 28, 2022 05:06 PM

    Not sure if helpful but i remember an old blogpost from lamw: https://williamlam.com/2017/09/automating-vm-keystrokes-using-the-vsphere-api-powercli.html

    Think it sould be possible to translate it to python