How to record Virtual Machine Manager QEMU/KVM virtual machine screen? I don't want to record the host Virtual Machine Manager window, nor record the screen from the virtual machine.
2/2
Jul 21, 10:41am
Recording the screen of a QEMU/KVM virtual machine (VM) directly—without capturing the host's Virtual Machine Manager window or the guest OS screen—can be achieved by leveraging QEMU's built-in capabilities. Here’s how you can do it:
Method 1: Using QEMU's VNC and ffmpeg
This method involves redirecting the VM's display to a VNC server and then recording the VNC output using ffmpeg.
Steps:
Start the VM with VNC Display
When starting your VM, use the -vnc option to expose the display over VNC. For example:
bash
qemu-system-x86_64 -vnc :1 -display none ...
:1 means the VNC server will listen on port 5901 (default VNC port is 5900 + display number).
-display none disables the default graphical window.
Connect to the VNC Server
Use a VNC client (like vinagre, tigervnc-viewer, or RealVNC) to connect to localhost:5901 and verify the display is working.
Record the VNC Display with ffmpeg
Use ffmpeg to capture the VNC display: