21.25. Taking a Screenshot of the Guest Console

The virsh screenshot guestname [imagefilepath] command takes a screenshot of a current guest virtual machine console and stores it into a file. If no file path is provided, the screenshot is saved to the current directory. If the hypervisor supports multiple displays for a guest virtual machine, use the --screen screenID option to specify the screen to be captured.

Example 21.52. How to take a screenshot of a guest machine's console

The following example takes a screenshot of the guest1 machine's console and saves it as /home/username/pics/guest1-screen.png:
virsh screenshot guest1 /home/username/pics/guest1-screen.ppm
Screenshot saved to /home/username/pics/guest1-screen.ppm, with type of image/x-portable-pixmap