Skip to content
Back to skills

Vmware Vnc

ASecurity

Type keystrokes, send key chords, move and click the mouse, and capture the screen of a VMware virtual machine over VNC, without guest tools or network access in the guest. Use when automating or testing a VM at a level vmrun cannot reach (a firmware or GRUB menu, an initramfs or LUKS passphrase prompt, a login screen, an OS installer, a desktop with no Tools), when vmrun captureScreen, runScriptInGuest or checkToolsState fail or say "Anonymous guest operations are not allowed", or to wait un...

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 29, 2026
ai-agentspythongoshellbashreacttestingapisecurity

Works with

  • cursor
  • terminal
  • cli
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 29, 2026

npx -y skills add dboudreau00/VMWare-VNC-Control-for-Claude --skill vmware-vnc --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Vmware Vnc?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Vmware Vnc
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dboudreau00-vmware-vnc/badge)](https://www.skillsdirectory.com/skills/dboudreau00-vmware-vnc)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: vmware-vnc
description: Type keystrokes, send key chords, move and click the mouse, and capture the screen of a VMware virtual machine over VNC, without guest tools or network access in the guest. Use when automating or testing a VM at a level vmrun cannot reach (a firmware or GRUB menu, an initramfs or LUKS passphrase prompt, a login screen, an OS installer, a desktop with no Tools), when vmrun captureScreen, runScriptInGuest or checkToolsState fail or say "Anonymous guest operations are not allowed", or to wait until the screen changes, settles, or shows a known element.
license: MIT
compatibility: VMware Workstation 17 or later (measured on 26.0), Player, or Fusion with VNC enabled in the .vmx; Python 3.10+, no packages.
---

# Driving a VMware VM over VNC

`vmrun`'s guest operations run *inside* the guest: they need VMware Tools alive
and, usually, guest credentials. That rules out everything before userspace and
every guest whose tools are missing or broken.

VNC operates at the **hypervisor's virtual keyboard, mouse and framebuffer**,
below the guest OS. It works at a firmware menu, a bootloader, an initramfs
passphrase prompt, a login screen, inside an installer, and on a desktop.

The tool is `${CLAUDE_SKILL_DIR}/vnc.py`: one Python 3 file, standard library
only. Below, `vnc.py` means `python "${CLAUDE_SKILL_DIR}/vnc.py"`.

## Enable VNC on the VM

With the VM **powered off**:

```bash
python "${CLAUDE_SKILL_DIR}/../vmware-vmx/vmx.py" vnc VM.vmx --port 5951 --generate-password vnc-password.txt
```

That sets `RemoteDisplay.vnc.enabled`, `.port`, `.ip = "127.0.0.1"` and
`.password`, replacing any existing VNC keys instead of appending duplicates.
By hand, the traps are:

- **The password is DES-based and truncated to 8 bytes.** Longer strings
  silently use only the first eight.
- **Do not append these lines blindly.** Workstation often already wrote
  `RemoteDisplay.vnc.enabled = "FALSE"`, and a duplicate key makes it refuse
  the file: *"Cannot read the virtual machine configuration file"*.
- **Bind it to loopback.** `RemoteDisplay.vnc.ip = "127.0.0.1"` makes the
  listener loopback-only (verified with `netstat`). VNC has no encryption.
- One port per VM if you run several (`mkvm.py` picks a free one).

## Use it

`--vmx VM.vmx` reads the port, address and password from the `.vmx`, so no
secret appears on the command line. Options go before or after the command.

```bash
vnc.py --vmx VM.vmx info                         # handshake + framebuffer geometry
vnc.py --vmx VM.vmx screenshot shot.png          # prints "shot.png WxH digest=XXXXXXXX"
vnc.py --vmx VM.vmx screenshot crop.png --region 0,0,800,120 --max-width 800
vnc.py --vmx VM.vmx key Down Down Return
vnc.py --vmx VM.vmx key Control_L+Alt_L+Delete Super_L+r
vnc.py --vmx VM.vmx key space --repeat 30 --gap 0.3   # "Press any key to boot from CD"
vnc.py --vmx VM.vmx type 'some text' --enter
vnc.py --vmx VM.vmx type --file passphrase.txt --enter # never echoed
vnc.py --vmx VM.vmx click 24 748 [--button right] [--double]
vnc.py --vmx VM.vmx drag 100 100 300 200
vnc.py --vmx VM.vmx scroll 500 400 --clicks 3 --down
vnc.py --vmx VM.vmx wait-change --timeout 180 --out changed.png
vnc.py --vmx VM.vmx wait-stable --quiet 10 --timeout 900
vnc.py --vmx VM.vmx wait-match ref.png --at 16,490 --timeout 600 [--absent]
vnc.py --vmx VM.vmx record frames/ --interval 5 --duration 1800
vnc.py keynames                                  # every key name and alias
```

Without `--vmx`: `--port N` plus `--password-file F`, or the environment
variables `VNC_PASSWORD_FILE` or `VNC_PASSWORD`. `--connect-wait 30` retries a
refused connection while a VM is still powering on.

Key names are X11 keysyms (`Return`, `Escape`, `Tab`, `BackSpace`, arrows,
`Page_Up`, `F1` to `F24`, `Shift_L`, `Control_L`, `Alt_L`, `Super_L`,
`KP_Enter`), case-insensitive aliases (`enter`, `esc`, `ctrl`, `win`, `pgdn`),
any single character, or a raw `0xff0d`. Join a chord with `+`; write the plus
key itself as `plus` inside a chord. See [reference.md](reference.md).

## Look at the screen

`screenshot` writes a PNG: Read it to see the guest. Crop with `--region X,Y,W,H`
and shrink with `--max-width` to keep images cheap. The printed digest is a CRC
of the captured pixels; comparing digests is how to tell whether the guest
reacted, without looking.

## Wait on the screen, not the clock

- `wait-change` returns when the frame (or `--region`) differs from the frame
  at the start. Exit 1 if nothing changed before `--timeout`.
- `wait-stable --quiet N` returns once nothing changed for N seconds (a boot
  that finished drawing).
- `wait-match REF.png --at X,Y` returns when that spot looks like a reference
  crop you saved earlier with `screenshot --region`; `--absent` waits for it to
  go away. `--tolerance` is the share of pixels allowed to differ (default 2%).
- `record DIR` saves a PNG each time the screen changes, with `index.tsv`
  listing time, file and digest: a timelapse of a long install to review later.

Anything that animates defeats a whole-screen wait: Windows Setup's progress
bar kept `wait-stable` from ever settling, and a blinking text cursor changes
the frame twice a second. Narrow the wait with `--region`, or use `wait-match`
on a static element.

## Patterns that work

**Screenshot before you type.** A passphrase typed before the prompt is ready
goes nowhere, and the boot then continues into a state indistinguishable from
a wrong passphrase.

**Typing is paced** (about 30 ms per character, `--delay`). Bootloaders and
initramfs prompts are polling readers; blasting a string drops characters.
Shift is pressed for capitals and shifted symbols; newlines become Return.
Typing assumes a US keyboard layout in the guest; with another layout, symbols
land on the wrong keys.

**Secrets from files.** `type --file` and `--stdin` print only the character
count. A password on the command line is visible to every process on the host.

**Reach the firmware boot menu** on an EFI VM: power on, then
`key Escape --repeat 40 --gap 0.1`. That opened VMware's EFI Boot Manager in
testing. On a Windows EFI install CD, `key space --repeat 30 --gap 0.3` answers
"Press any key to boot from CD or DVD".

**Reach a shell in a desktop guest** with no direct binding: `key Super_L`,
then `type terminal --enter` (verified on Cinnamon), or `key Super_L+r` then
`type cmd --enter` on Windows.

## How VMware's VNC server behaves (measured on Workstation 26)

- It answers the first full-frame request on a connection, then answers later
  requests only once the screen changed. `vnc.py` keeps one incremental request
  outstanding and treats silence as "nothing changed"; a client that asks for a
  second full frame and waits hangs on a static screen.
- It drops a mouse-button press that arrives without pointer motion soon after
  the last move (60 ms after reaching the Start button: no click). A press that
  itself moves the pointer always counted, so `click` approaches from one pixel
  away, settles 150 ms, and presses while moving onto the target.
- With VMware Tools in a Windows guest, absolute positioning was exact: the
  pointer landed on the pixel asked for.
- It serves RFB 3.8, accepts a requested pixel format, and follows guest
  resolution changes (640x480 at boot, 1024x768 in Setup).

## Limits, stated plainly

- **Raw encoding only.** Every RFB server supports it; a frame is
  `width x height x 4` bytes, fine on loopback.
- **Security types None(1) and VNCAuth(2).** No TLS. Intended for loopback to
  your own hypervisor.
- **Pixels, not text.** Read the PNG, or have the guest write status to a
  serial port backed by a host file (see vmware-serial-console).
- VMware may drop VNC in a future release. `vmcli VM.vmx MKS captureScreenshot`
  is a fallback for screenshots (see vmware-vmrun).
- Protected VMs are refused, including a bare `--port` that belongs to one.

Files in this skill

  • SKILL.md7.7 KB
  • reference.md3.1 KB
  • vnc.py49.3 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.