Skip to content
Back to skills

Vmware Serial Console

BSecurity

Use a VMware VM's serial port as a text channel. Wait for a marker line in a serial port backed by a host file (kernel messages, cloud-init, a bootstrap script writing to COM1 or /dev/ttyS0), tail it without terminal escapes, and log in to a getty through a serial port backed by a named pipe for a shell with no network and no guest tools. Use for boot and provisioning status, headless guests, kernel panics, and anywhere a screenshot would be a poor way to read text.

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

Works with

  • terminal
  • cli

Security analysis

B75/100
  • criticalModifies startup scripts or system services for persistence

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

Scanned November 29, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Vmware Serial Console?

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

Security grade badge for Vmware Serial Console
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/dboudreau00-vmware-serial-console/badge)](https://www.skillsdirectory.com/skills/dboudreau00-vmware-serial-console)

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-serial-console
description: Use a VMware VM's serial port as a text channel. Wait for a marker line in a serial port backed by a host file (kernel messages, cloud-init, a bootstrap script writing to COM1 or /dev/ttyS0), tail it without terminal escapes, and log in to a getty through a serial port backed by a named pipe for a shell with no network and no guest tools. Use for boot and provisioning status, headless guests, kernel panics, and anywhere a screenshot would be a poor way to read text.
license: MIT
compatibility: VMware Workstation, Player or Fusion; Windows hosts use named pipes, Linux and macOS hosts use socket paths; Python 3.10+.
---

# The serial port as a text channel

Pixels are a poor channel for status. A serial port backed by a **host file**
turns everything the guest writes to `COM1` or `/dev/ttyS0` into text the host
can grep. A serial port backed by a **named pipe** goes both ways: a getty on
that port is a login shell reachable from the host when the guest's network and
Tools are down.

The tool is `${CLAUDE_SKILL_DIR}/vmserial.py`. Below, `vmserial.py` means
`python "${CLAUDE_SKILL_DIR}/vmserial.py"`.

## Add the port (VM powered off)

```bash
python "${CLAUDE_SKILL_DIR}/../vmware-vmx/vmx.py" serial VM.vmx --file serial.log
python "${CLAUDE_SKILL_DIR}/../vmware-vmx/vmx.py" serial VM.vmx --pipe vmlab-ttyS1
```

`mkvm.py` always adds `serial0` as a file named `serial.log`. `serialN` is
`COM(N+1)` in a Windows guest and `ttySN` in Linux.

## Wait for a marker

```bash
vmserial.py wait serial.log --pattern 'VMLAB CLOUD-INIT DONE' --timeout 900
vmserial.py mark serial.log                       # prints the current size, an offset
vmserial.py wait serial.log --pattern 'stage two' --since 268196
vmserial.py tail serial.log -n 40
```

**A marker from an earlier boot is already in the file**, and VMware appends
across reboots, so a wait that reads from the start passes before the guest
did anything. `wait` therefore reads only output that arrives after it starts
(`--since end`, the default). When the trigger comes first, record `mark`
before triggering and wait `--since` that offset. For the first boot of a new
VM, `--since start` is right: the file is new. `wait` prints the matching line
and `offset=N` (on stderr) to chain the next wait from; on a timeout it prints
the last lines it saw. Escape sequences and carriage returns are removed, and
a prompt without a newline (`login: `) still matches.

## Write to it from the guest

- Linux: `echo "STAGE DONE" > /dev/ttyS0` (root, or a member of `dialout`).
- Windows PowerShell:

  ```powershell
  $p = New-Object System.IO.Ports.SerialPort "COM1", 115200, "None", 8, "One"
  $p.Open(); $p.WriteLine("STAGE DONE"); $p.Close()
  ```

  `mkvm.py`'s Windows bootstrap reports every step this way.
- cloud-init: a `runcmd` that echoes to `/dev/ttyS0` (what `mkvm.py`
  generates). Ubuntu cloud images put `console=ttyS0` on the kernel command
  line, so cloud-init's own progress reaches the file too; it ends with
  `Cloud-init v. ... finished at ... Datasource DataSourceVMware [seed=guestinfo]`
  naming the datasource it used.

## Where console output goes on Linux

Kernel messages go to every `console=` on the kernel command line, but
`/dev/console` (where userspace prompts and boot messages are written) is the
**last** one. With `console=ttyS0 console=tty0`, an initramfs passphrase prompt
appears on the screen and never in the serial file. If a serial wait for a
prompt times out, take a VNC screenshot before deciding the guest hung.

## A login shell over a pipe

The guest needs a getty on the pipe's port. On systemd guests:
`systemctl enable --now serial-getty@ttyS1.service` (`mkvm.py --bootstrap`
can run it at first boot). Then:

```bash
vmserial.py console vmlab-ttyS1 --line '' --expect 'login:' --line lab \
  --expect 'assword' --send-file guest-password.txt --expect '[$#] $' \
  --line 'uname -a; tty' --expect '[$#] $' --line exit
```

Steps run in the order given: `--line TEXT` sends TEXT and Enter (CR),
`--send TEXT` sends it raw (`\r \n \t \xHH` escapes), `--send-file F` sends a
file's content and Enter and is scrubbed from the transcript, `--expect REGEX`
waits up to `--timeout` seconds, `--sleep S` collects output. The transcript
is printed at the end (`--log FILE` appends it). Exit 0 when every step
passed, 1 when an expectation timed out or the other end hung up.

Verified on Workstation 26 with an Ubuntu 24.04 guest: login, `uname -a`, and
`tty` answering `/dev/ttyS1` through `\\.\pipe\vmlab-ubuntu-ttyS1`.

## Traps

- **One client per pipe.** A kernel debugger attached to a pipe owns it;
  `console` waits up to `--connect-timeout` and then explains.
- **The pipe exists only while the VM runs.** VMware creates it at power-on.
- **getty may need a nudge.** Send an empty line first (`--line ''`) so it
  prints a fresh `login:`.
- **Serial file growth.** The file is appended across boots; delete or rotate
  it with the VM off if it grows large.

Files in this skill

  • SKILL.md4.9 KB
  • vmserial.py14.2 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.