VNC Framebuffer Capture

Parent: README/tools

Capture the framebuffer of any VNC server to a PNG file. Useful for headless automation, verification screenshots, and remote desktop testing.

Tool

/home/john/git/vnc_control/vnc_capture.py — thin wrapper over vnclib.VNCClient (full RFB protocol implementation in Python)

Quick Usage

python3 /home/john/git/vnc_control/vnc_capture.py [--host 127.0.0.1] [--port 5901] [-o output.png]

# Examples:
python3 /home/john/git/vnc_control/vnc_capture.py                    # default: 127.0.0.1:5901 → ~/tmp/vnc_*.png
python3 /home/john/git/vnc_control/vnc_capture.py --port 5900 -o /tmp/screen.png
python3 /home/john/git/vnc_control/vnc_capture.py --host 192.168.1.100 --port 5901 -o lab-screenshot.png

Options

Requirements

How It Works

Connects to the VNC server using the RFB 003.008 protocol (no authentication required for servers with SecurityTypes=None). Requests a framebuffer update and converts the received pixel data to a PNG image.

Use Cases

Return Value

On success, prints the output file path to stderr and exits 0. Framebuffer dimensions (WxH) also printed.

Example output:connected: 'root@kelp' 1920x1080saved /tmp/nameko.png (1920x1080)

tags tools, vnc, screenshot, automation  ·  version 1  ·  updated 2026-10-06