VM Lab
Attribution: Sourced from steipete/agent-scripts by Peter Steinberger.
Use this when the task needs a clean macOS VM to test GUI automation, TCC prompts, screenshot capture, clicking, typing, performance, or "two-way validation" of automation tools.
Core idea: run the tool under test inside the guest, but verify it from outside the guest with Parallels screenshots and host-side observations.
Safety Rules
- Treat the VM snapshot as disposable, not the host.
- Never print secrets. If
op is needed, run it only inside tmux.
- Prefer fresh app windows you create yourself: TextEdit, a local HTML test page, or a small test app.
- Avoid modifying host state except temporary screenshots under
/tmp.
VM Discovery
# List VMs
prlctl list --all
# Get VM status/IP
prlctl list --info "macOS Sequoia"
# Run guest command
prlctl exec "macOS Sequoia" 'sudo -u $USER -H /bin/zsh -lc "uname -a"'
# Host-side screenshot
prlctl capture "macOS Sequoia" --file /tmp/vm-reference.png
sips -g pixelWidth -g pixelHeight /tmp/vm-reference.png
TCC / GUI Attribution
For macOS Screen Recording and Accessibility, the responsible process matters.
prlctl exec is headless and can fail to produce useful Screen Recording attribution.
- Launch the test command from a visible terminal app in the guest when Screen Recording is involved.
- After a first failed capture, check
System Settings > Privacy & Security > Screen & System Audio Recording.
Two-Way Validation
For each GUI action, verify through two independent signals:
- Tool-under-test output: JSON, screenshot file, AX result, or app state.
- External verifier:
prlctl capture, host-side image inspection, file content in guest, or process/window state.
Examples:
- Screenshot: compare tool image dimensions/content against
prlctl capture.
- Click: use automation to click a test button, then verify both guest app state and host screenshot.
- Performance: wrap commands with
/usr/bin/time -p; repeat cold/warm runs.
Known Pitfalls
- macOS clipboard APIs may fail from
prlctl exec; pbcopy and AppleScript clipboard can fail in headless guest context.
prlctl exec may re-join argv through a guest shell; for complex payloads, create a script file first.
- For normal typing, use
prlctl send-key-event — but it uses Parallels key values, not macOS virtual key codes.
Reporting
When handing off, include only:
- VM name and OS build
- repo commit tested
- permission state
- commands that passed/failed
- independent verifier result
- product bugs discovered
1---2name: vm-lab3description: Parallels macOS VM lab: GUI automation testing, Peekaboo, TCC, two-way validation.4---56# VM Lab78> **Attribution:** Sourced from [steipete/agent-scripts](https://github.com/steipete/agent-scripts) by [Peter Steinberger](https://github.com/steipete).910Use this when the task needs a clean macOS VM to test GUI automation, TCC prompts, screenshot capture, clicking, typing, performance, or "two-way validation" of automation tools.1112Core idea: run the tool under test inside the guest, but verify it from outside the guest with Parallels screenshots and host-side observations.1314## Safety Rules1516- Treat the VM snapshot as disposable, not the host.17- Never print secrets. If `op` is needed, run it only inside `tmux`.18- Prefer fresh app windows you create yourself: TextEdit, a local HTML test page, or a small test app.19- Avoid modifying host state except temporary screenshots under `/tmp`.2021## VM Discovery2223```bash24# List VMs25prlctl list --all2627# Get VM status/IP28prlctl list --info "macOS Sequoia"2930# Run guest command31prlctl exec "macOS Sequoia" 'sudo -u $USER -H /bin/zsh -lc "uname -a"'3233# Host-side screenshot34prlctl capture "macOS Sequoia" --file /tmp/vm-reference.png35sips -g pixelWidth -g pixelHeight /tmp/vm-reference.png36```3738## TCC / GUI Attribution3940For macOS Screen Recording and Accessibility, the responsible process matters.4142- `prlctl exec` is headless and can fail to produce useful Screen Recording attribution.43- Launch the test command from a visible terminal app in the guest when Screen Recording is involved.44- After a first failed capture, check `System Settings > Privacy & Security > Screen & System Audio Recording`.4546## Two-Way Validation4748For each GUI action, verify through two independent signals:4950- **Tool-under-test output**: JSON, screenshot file, AX result, or app state.51- **External verifier**: `prlctl capture`, host-side image inspection, file content in guest, or process/window state.5253Examples:54- Screenshot: compare tool image dimensions/content against `prlctl capture`.55- Click: use automation to click a test button, then verify both guest app state and host screenshot.56- Performance: wrap commands with `/usr/bin/time -p`; repeat cold/warm runs.5758## Known Pitfalls5960- macOS clipboard APIs may fail from `prlctl exec`; `pbcopy` and AppleScript clipboard can fail in headless guest context.61- `prlctl exec` may re-join argv through a guest shell; for complex payloads, create a script file first.62- For normal typing, use `prlctl send-key-event` — but it uses Parallels key values, not macOS virtual key codes.6364## Reporting6566When handing off, include only:67- VM name and OS build68- repo commit tested69- permission state70- commands that passed/failed71- independent verifier result72- product bugs discovered