Read, lint and edit VMware .vmx configuration files without breaking the VM. Replaces keys in place in any letter case, removes duplicates, keeps the file's encoding and line endings, refuses a running or protected VM, redacts secrets in output, and has presets for VNC on loopback, serial ports backed by a file or named pipe, CD-ROM images, floppy images and guest isolation. Use before changing any VM setting by hand, when VMware says "Cannot read the virtual machine configuration file", or w...
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 Vmx?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/dboudreau00-vmware-vmx)
---
name: vmware-vmx
description: Read, lint and edit VMware .vmx configuration files without breaking the VM. Replaces keys in place in any letter case, removes duplicates, keeps the file's encoding and line endings, refuses a running or protected VM, redacts secrets in output, and has presets for VNC on loopback, serial ports backed by a file or named pipe, CD-ROM images, floppy images and guest isolation. Use before changing any VM setting by hand, when VMware says "Cannot read the virtual machine configuration file", or when a VM fails to power on after an edit.
license: MIT
compatibility: VMware Workstation, Player or Fusion .vmx files; Python 3.10+, no packages.
---
# Editing .vmx files
A `.vmx` is VMware's dictionary format: one `key = "value"` per line, keys
case-insensitive. Three facts make hand edits dangerous:
- **One duplicate key and VMware refuses the whole file:** *"Cannot read the
virtual machine configuration file"*. Workstation often wrote the key you are
about to append (`RemoteDisplay.vnc.enabled = "FALSE"`), sometimes in another
letter case.
- **VMware rewrites the file at power-off.** An edit made while the VM runs is
silently lost, and the `.lck` folder next to the `.vmx` says it is running.
- **Mixed line endings** (CRLF appended into an LF file) can break parsing too.
`${CLAUDE_SKILL_DIR}/vmx.py` edits in place: it replaces a key wherever it sits,
drops duplicates, keeps the encoding (the `.encoding` line, a UTF-8 BOM, or
cp1252) and the line endings, writes atomically, refuses a running VM (checked
with `vmrun list` and the `.lck` folder) or a protected one, and prints what
changed with secrets redacted. Below, `vmx.py` means
`python "${CLAUDE_SKILL_DIR}/vmx.py"`.
## Read
```bash
vmx.py show VM.vmx [--prefix ethernet0.] [--show-secrets]
vmx.py get VM.vmx guestOS
vmx.py check VM.vmx # exit 1 when it finds an error
```
`check` reports duplicate keys, lines that are not `key = "value"`, unbalanced
or unescaped quotes, mixed line endings, a VNC password longer than 8 bytes,
VNC listening beyond loopback or without a password, an `e1000e` or `vmxnet3`
NIC without PCIe root ports, missing ISO, floppy and disk files, and a lock
folder. Run it after any hand edit and before the first power-on.
## Edit (VM powered off)
```bash
vmx.py set VM.vmx memsize=4096 numvcpus=2 [--dry-run]
vmx.py unset VM.vmx 'isolation.tools.*'
```
A trailing `*` in `unset` matches a prefix. `--dry-run` prints the change
without writing. `--force` edits despite a stale `.lck` folder left by a crash,
never a VM that `vmrun list` shows running.
Values are written quoted, with VMware's escapes: a double quote becomes `|22`,
a pipe `|7C`, a newline `|0A`. Backslashes are literal, so Windows paths and
`\\.\pipe\name` need no escaping.
## Presets
```bash
vmx.py vnc VM.vmx --port 5951 --generate-password vnc-password.txt
vmx.py vnc VM.vmx --port 5951 --password-file pw.txt [--ip 127.0.0.1]
vmx.py vnc VM.vmx --off
vmx.py serial VM.vmx --file serial.log # first free serialN
vmx.py serial VM.vmx --pipe vmlab-com2 # \\.\pipe\vmlab-com2 on Windows, /tmp/... elsewhere
vmx.py serial VM.vmx --off [--index 1]
vmx.py cdrom VM.vmx --iso seed.iso [--slot sata0:2]
vmx.py cdrom VM.vmx --eject [--slot sata0:2]
vmx.py floppy VM.vmx --image unattend.flp
vmx.py isolate VM.vmx [--no-network]
```
- `vnc` writes `enabled`, `port`, `ip` (loopback by default) and `password`,
removing any `RemoteDisplay.vnc.key` so only one password applies. A
generated password is written to the file you name and never printed. It
refuses a password VNC would truncate (more than 8 bytes).
- `serial` picks the first free port: `serialN` is `COM(N+1)` in Windows and
`ttySN` in Linux. A pipe gets `pipe.endPoint = "server"` (VMware creates it;
your tool or debugger connects) and `tryNoRxLoss = "TRUE"`; every port gets
`yieldOnMsrRead = "TRUE"` so a guest polling the port does not burn a core.
- `isolate` disables copy, paste, drag and drop and shared folders, keeps VNC
on loopback, and with `--no-network` disconnects every network adapter.
Measured: guest operations (`vmctl.py push` and `run`) still worked with
these keys set, so an isolated lab VM stays drivable.
## Traps
- Close the VM's tab in the Workstation window before editing: the GUI can
hold its own copy of the settings and write it back.
- A hand-written `.vmx` with an `e1000e` NIC and no PCIe root ports
(`pciBridge4` to `pciBridge7` as `pcieRootPort`) has crashed `vmware-vmx` at
power-on, with vmrun saying only *"The operation was canceled"*. Use `e1000`,
or add the bridges (`mkvm.py` always writes them).
- `RemoteDisplay.vnc.password` is stored in plain text in the `.vmx`; treat
the file as a secret. `show` and `get` redact it unless `--show-secrets`.
- `guestinfo.*` keys in the `.vmx` are readable from inside the guest by any
user (`vmware-rpctool "info-get guestinfo.NAME"`).
See [reference.md](reference.md) for the keys these tools set and why.