Skip to main content

Send USB Scancodes to a VMware vSphere Virtual Machine

Project description

Transmit keystrokes to a running vSphere virtual machine via pyvmomi.

Can be used either as a command-line tool directly, or import as a module.

Usage

usage: send-keys-to-vm [--file in.txt] [--characters 'a long line of text'] [--raw-scancode I]
                       [--modifier {shift,alt,meta,ctrl}] [--moref MOREF] [--uuid UUID] [--ip IP] [-v] [--whatif]
                       [--insecure] [--hostname vCenter Server or ESXi host] [--port vCenter Server Port]
                       [--username USERNAME] [--password PASSWORD]
                       [keys ...]

Examples

Pass characters as a quoted string.

send-keys-to-vm --characters "sudo tailscale up --auth-key=tskey-auth-1234567890 --ssh"

Open a config file for appending, then stream in some text.

echo "cat >> .ssh/authorized_keys" | send-keys-to-vm --moref 24
`cat ~/.ssh/id_rsa.pub | send-keys-to-vm --moref 24 --file -`
.venv/bin/send-keys-to-vm --moref 24 ctrl+d

Dump raw KeyEvent list.

send-keys-to-vm a b C ctrl+d --whatif

(vim.vm.UsbScanCodeSpec.KeyEvent) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   usbHidCode = 262151,
   modifiers = <unset>
}
(vim.vm.UsbScanCodeSpec.KeyEvent) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   usbHidCode = 327687,
   modifiers = <unset>
}
(vim.vm.UsbScanCodeSpec.KeyEvent) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   usbHidCode = 393223,
   modifiers = (vim.vm.UsbScanCodeSpec.ModifierType) {
      dynamicType = <unset>,
      dynamicProperty = (vmodl.DynamicProperty) [],
      leftControl = <unset>,
      leftShift = true,
      leftAlt = <unset>,
      leftGui = <unset>,
      rightControl = <unset>,
      rightShift = <unset>,
      rightAlt = <unset>,
      rightGui = <unset>
   }
}
(vim.vm.UsbScanCodeSpec.KeyEvent) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   usbHidCode = 458759,
   modifiers = (vim.vm.UsbScanCodeSpec.ModifierType) {
      dynamicType = <unset>,
      dynamicProperty = (vmodl.DynamicProperty) [],
      leftControl = true,
      leftShift = <unset>,
      leftAlt = <unset>,
      leftGui = <unset>,
      rightControl = <unset>,
      rightShift = <unset>,
      rightAlt = <unset>,
      rightGui = <unset>
   }
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

send_keys_to_vm-1.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

send_keys_to_vm-1.1.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file send_keys_to_vm-1.1.0.tar.gz.

File metadata

  • Download URL: send_keys_to_vm-1.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for send_keys_to_vm-1.1.0.tar.gz
Algorithm Hash digest
SHA256 d0a1dc6bc700b7b2c302bd1f2e62b7c44a6f0103d7b92cf77c03827bf4e380c1
MD5 bbc99b5ef50c3ccf1490c56bfa31bb10
BLAKE2b-256 5cb481edd960daf5fd7020b54dbcfaca29ad572ab4651c4e6735ecc92d249c94

See more details on using hashes here.

Provenance

The following attestation bundles were made for send_keys_to_vm-1.1.0.tar.gz:

Publisher: publish.yaml on ellieayla/send-keys-to-vm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file send_keys_to_vm-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for send_keys_to_vm-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eecfd233479af1ac9c427d93f7fb1e2076f5977d694a89b33cf4bb28ebd869f9
MD5 55d3272a6d36053d897ee65b2292ab6f
BLAKE2b-256 9c1c8f94e0acc641ab00c9d06d3a323a03ca80250fbd97207cc4b68401a1998c

See more details on using hashes here.

Provenance

The following attestation bundles were made for send_keys_to_vm-1.1.0-py3-none-any.whl:

Publisher: publish.yaml on ellieayla/send-keys-to-vm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page