Start here for any work on a VMware Workstation, Player or Fusion virtual machine from Claude Code. Picks the channel that works at the VM's current stage (VNC, vmcli, vmrun guest operations, serial port, guestinfo, shared folders), runs the snapshot, run, collect, revert loop of a test lab, keeps evidence that can fail honestly, and keeps off VMs the owner protected. Use when asked to build, boot, install, test, automate, debug or inspect a VM, or when unsure which VMware tool applies.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Vmware Vm Lab?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/dboudreau00-vmware-vm-lab)
---
name: vmware-vm-lab
description: Start here for any work on a VMware Workstation, Player or Fusion virtual machine from Claude Code. Picks the channel that works at the VM's current stage (VNC, vmcli, vmrun guest operations, serial port, guestinfo, shared folders), runs the snapshot, run, collect, revert loop of a test lab, keeps evidence that can fail honestly, and keeps off VMs the owner protected. Use when asked to build, boot, install, test, automate, debug or inspect a VM, or when unsure which VMware tool applies.
license: MIT
compatibility: VMware Workstation 17 or later (measured on 26.0), Player, or Fusion; Python 3.10+ on the host, no packages.
---
# Working with VMware VMs from Claude Code
Every VM task comes down to two questions: **what stage is the guest at**, and
**which channel reaches that stage**. Pick the channel first; most failures are
a channel used at a stage it cannot reach.
## Which channel works when
| Guest stage | VNC (`vnc.py`) | vmcli MKS | vmrun guest ops (`vmctl.py`) | Serial file (`vmserial.py wait`) | Serial pipe console |
|---|---|---|---|---|---|
| Firmware, boot menu | yes | screenshot | no | no | no |
| Bootloader, initramfs, LUKS prompt | yes | screenshot, text | no | kernel messages | no |
| OS installer | yes | screenshot, text | no | if the installer writes there | no |
| Login screen, desktop | yes | screenshot, text | yes once Tools run | yes | yes with a getty |
| Tools running | yes | yes | yes (needs credentials) | yes | yes |
- **VNC** needs `RemoteDisplay.vnc.*` in the `.vmx`, set while the VM is off
(`vmx.py vnc`). Keyboard, mouse and screen, below the guest OS.
- **vmcli** (`vmcli VM.vmx MKS captureScreenshot out.png`) needs no `.vmx`
change and no restart. Measured on Workstation 26: the screenshot works at
the firmware boot menu, `sendKeySequence` types plain text at a console.
- **vmrun guest operations** need VMware Tools running and a guest account.
`checkToolsState` is not proof: it reported `running` while a VM sat in its
firmware menu. `vmctl.py wait-tools` waits for a real guest operation.
- **Serial file**: kernel messages, cloud-init, and anything a script writes
to `/dev/ttyS0` or `COM1` land in a host file. The best channel for status.
- **guestinfo variables**: small strings both ways with no network
(`vmctl.py var`). The guest reads and writes them with `vmware-rpctool`.
- **Network**: often the worst choice. A VPN or host firewall can block the
host from reaching a NAT guest entirely, while the hypervisor channels above
keep working. Do not debug host-to-guest networking unless the task needs it.
## The tools
All are single-file Python 3 scripts with no dependencies. Paths below are
relative to this skill's folder; the plugin keeps every skill side by side.
| Tool | Skill | Does |
|---|---|---|
| `../vmware-vnc/vnc.py` | vmware-vnc | keys, chords, typing, mouse, screenshots, waits, recording over VNC |
| `../vmware-vmrun/vmctl.py` | vmware-vmrun | power, snapshots, clones, guest commands with output, files, guestinfo, memory dumps |
| `../vmware-vmx/vmx.py` | vmware-vmx | read and edit `.vmx` safely; VNC, serial, CD, floppy, isolation presets |
| `../vmware-serial-console/vmserial.py` | vmware-serial-console | wait for serial markers, tail, scripted login over a serial pipe |
| `../vmware-create-vm/mkvm.py` | vmware-create-vm | build a VM folder: disk, `.vmx`, unattended Windows or cloud-init Linux |
| `../vmware-create-vm/mkmedia.py` | vmware-create-vm | ISO 9660 + Joliet and FAT12 floppy images, cloud-init seeds |
Run them as `python "${CLAUDE_SKILL_DIR}/../vmware-vmrun/vmctl.py" ...`
(`python3` on Linux and macOS). Every tool exits 0 on success, 1 on a timeout
or a negative answer, 2 on a usage or tool error, 3 when it refused (a
protected or running VM). `vmctl.py run` exits with the guest's own code, or
125 when the run itself could not happen.
## The lab loop
1. **Build or pick the VM.** `mkvm.py create` writes a VM that is reachable
from the first boot: VNC on loopback, a serial log, a guest account with a
generated password in `guest-password.txt`.
2. **Snapshot it clean, powered off.** `vmctl.py snapshot VM.vmx clean`. Only
a snapshot taken while the VM is off can be the source of a clone.
3. **Start and wait on a signal, never a sleep.** `vmctl.py start`, then
`vmserial.py wait serial.log --pattern MARKER` or `vmctl.py wait-tools`.
4. **Act.** `vmctl.py run`, `push`, `vnc.py type`, `key`, `click`.
5. **Collect evidence.** `vmctl.py pull` (prints SHA-256), `run --evidence DIR`,
`vnc.py screenshot`, `vmserial.py tail`, `vmctl.py memdump`.
6. **Revert.** `vmctl.py revert VM.vmx clean`. Reverting to a snapshot taken
while the VM ran leaves it suspended at that point; `start` resumes it.
Run one test at a time per VM. Tests that share a VM (or a disk image) can
corrupt each other's state and report failures that are scheduling artefacts.
## Evidence that can fail
A check that cannot fail reports success forever and stops anyone looking.
- Before trusting a screen check, send a key that does nothing and confirm the
digest stays put (`vnc.py wait-change` should time out).
- Wait on markers that only the action under test can produce, and start
waiting from the current end of the log (`vmserial.py wait` does by default)
so a marker from an earlier boot cannot satisfy it.
- Keep the hashes `push`, `pull` and `memdump` print; they tie a result to
the exact bytes that produced it.
## Safety rules
- **Protected VMs.** List the owner's own VMs, one `.vmx` or folder per line,
in `~/.config/vmware-vnc-control/protected-vms.txt` (or the
`VMWARE_PROTECTED_VMS` environment variable, separated like `PATH`). Every
tool here refuses them, including screenshots and a bare VNC port that
belongs to one. An unreadable list refuses everything.
- **Never delete a VM.** No tool here deletes a VM or its disks. Deleting is
the owner's call; say what exists and how big it is.
- **Secrets stay in files.** Pass `--password-file`, `--guest-password-file`,
`type --file`, `--send-file`. Never echo a password, never put one in a
command you show. vmrun itself takes `-gp PASSWORD` on its command line, so
it is visible to other processes on the host while a call runs.
- **VNC on loopback only.** `RemoteDisplay.vnc.ip = "127.0.0.1"` (verified with
`netstat`: the listener binds to loopback). VNC has no encryption.
- **Edit a `.vmx` only while the VM is off.** VMware rewrites it at power-off.
`vmx.py` refuses a running VM.
## Working from Claude Code
- **Long waits go in the background** (a background Bash or PowerShell
command); the tools' own waits poll, so nothing needs a foreground sleep.
- **Prefer text to pixels.** A serial line or a guest command's output costs a
fraction of a screenshot. When a screenshot is needed, crop it (`--region`)
and shrink it (`--max-width 1024`), then Read the PNG to look at it.
- **On a Windows host use PowerShell for vmrun and wsl.** Git Bash rewrites
arguments that start with `/` into Windows paths.
- **Guest stage first, then command.** If a command fails strangely, take a
screenshot before concluding the guest is broken; it is usually at a
different stage than assumed.
See the other skills for each channel's details and traps.