Parent: README/tools
Capture the framebuffer of any VNC server to a PNG file. Useful for headless automation, verification screenshots, and remote desktop testing.
/home/john/git/vnc_control/vnc_capture.py — thin wrapper over vnclib.VNCClient (full RFB protocol implementation in Python)
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
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.
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)