Hide Forgot
RFE: Add support to libvirt API (and virsh) for taking a screenshot of current guest console. Use case : Allow management application to take screenshot of VM to use as a preview for various management actions. Exporting the screenshot in the currently supported qemu PPM format would be acceptable
Patches are being worked on upstream.
Patches currently waits for review: https://www.redhat.com/archives/libvir-list/2011-April/msg00275.html
Pushed upstream: commit 6a1fcd9f209005954628c158314b071fcf2ba84a Author: Michal Privoznik <mprivozn> Date: Mon Apr 4 11:58:53 2011 +0200 screenshot: Defining the public API Add public API for taking screenshots of current domain console. * include/libvirt/libvirt.h.in: add virDomainScreenshot * src/libvirt_public.syms: Export new symbol v0.9.1-95-g6a1fcd9 But virsh currently miss the screenshot command. I work on it.
Note for QE - please ensure you test with VNC and Spice. For spice remember that it supports multiple displays.
New virsh command: commit 3ef7350c4206887983af88d97d66931b14bf0412 Author: Michal Privoznik <mprivozn> Date: Thu May 12 18:29:12 2011 +0200 screenshot: Expose the new API in virsh * tools/virsh.c: Add screenshot command * tools/virsh.pod: Document new command * src/libvirt.c: Fix off-be-one error v0.9.1-353-g3ef7350
Moving this to POST. However, to track possibility of taking screenshots of secondary monitors in QEMU, I've created Bug 710489.
can't verify now, waiting for bug:705070 modified.
I test on fedora15 with libvirt-0.9.2-2.fc16.x86_64 qemu-kvm-0.14.0-9.fc16.x86_64 I found that after running # virsh screenshot domain /tmp/screen.ppm the file /tmp/screen.ppm can be generated, but with 0 size. I debug libvirtd with gdb and find that when generate temp file /var/cache/libvirt/qemu/qemu.screendump.xxxxxx the attribute of file is -rw-------. 1 root root 0 Jun 28 14:35 /var/cache/libvirt/qemu/qemu.screendump.a3yOoa which means that qemu has no privilege to access this file. So we also need to change either permissions or owner of this file for this bug. It still has bug, so change the status to assign
Sorry for the delay. It is upstream for a while but I've forgotten to update BZ. commit c72aecc5fcac98d61f8a94ff2ae1f40a149a5c4a Author: Michal Privoznik <mprivozn> Date: Wed Jun 29 10:17:51 2011 +0200 screenshot: Set access rights to temporary file Although we create a temporary file, it is owned by root:root and have rights 0600. In case qemu does not run under root, it is unable to write to that file and thus we transfer 0B sized file. v0.9.3-rc1-39-gc72aecc
As bug 705070 was set to MODEFIED status with qemu-kvm-0.12.1.2-2.177.el6, tested with libvirt-0.9.4-1.el6 and qemu-kvm-0.12.1.2-2.177.el6, get the same error as comment 10. According to comment 4 and comment 9, add the bug 710489 in the "Depends on".
Will try to verify this bug after bug 729969 get VERIFIED .
There is a bug in the RPC code which also prevents the screenshot command from being used in virsh. The upstream patch is https://www.redhat.com/archives/libvir-list/2011-September/msg00840.html
Note that the above patch is now in libvirt-0.9.4-14.el6, please use this for further QA on this bug, thank, Daniel
Bug verified. rpm packages version: libvirt-0.9.4-18.el6.x86_64 qemu-kvm-0.12.1.2-2.197.el6.x86_64 kernel-2.6.32-210.el6.x86_64
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Cause: Users often want to do a screenshot of running VM Consequence: Other tools (like virt-manager) needed to be used Change: New Libvirt API was created (virDomainScreenshot) which allows to take screenshots on those hypervisors supporting it (virtualbox, qemu) Result: Users can use libvirt directly (e.g. virsh screenshot) instead of workarounds
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2011-1513.html