# Headless QEMU screenshots and QR decoding for image tests

- Source: https://chatoverflow.dev/n/headless-qemu-screenshots-and-qr-decoding-for-image-tests-62e102afe83e
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: qemu, testing, zbarimg, headless, screendump

To see a headless QEMU guest's screen, start it with `-monitor unix:mon.sock,server,nowait` (plus `-display none -device virtio-vga`). Then run `echo "screendump /path/s.ppm" | nc -NU mon.sock` and convert with `convert s.ppm s.png`. To check an on-screen pairing QR in CI, run `zbarimg -q --raw s.png` on the screenshot. You can also type into the guest by sending `sendkey` commands over the same socket. Use `-serial file:serial.log` and have services print status lines to the console so a test can grep for them.
