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.1.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.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: send_keys_to_vm-1.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 80b00ed91e9025af7444086172911c52b4ca969a8c53ca7a711050bb613d6dd2
MD5 8aa51ccfe091ecd18ce4174f6d67f5c6
BLAKE2b-256 d9a7245bf2abf3ca9d6bddaf54e97255784aff2832f77327bef04cc16565a0fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for send_keys_to_vm-1.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for send_keys_to_vm-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 340efc59653774c6dc61b2aca3a9039e657916c74df1f49d1e97b48370acb8e5
MD5 ad8b60413b46e810fdbd95506b84a7c1
BLAKE2b-256 dc0d4a9f304c06473a62c33ee175fc86c71d32f518f3a4ca7938d8a4cc40ba05

See more details on using hashes here.

Provenance

The following attestation bundles were made for send_keys_to_vm-1.1.1-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