#!/bin/bash which qemu-system-x86_64 # The sleep is due to a bug (unreported) with -qmp stdio usage. # can be removed if I use a unix socket probably. ( sleep 1 echo '{ "execute" : "qmp_capabilities" }' echo '{ "execute" : "__com.redhat_qxl_screendump", "arguments" : { "id" : "0", "filename" : "test.ppm" } }' echo '{ "execute" : "quit" }') | qemu-system-x86_64 -spice port=9999 -qmp stdio