How to set video memory with KVM/QEMU virtualization

kvmqemu

As a long-time VirtualBox user I'm used to being able to set video memory available to my virtual machines, but unfortunately I cannot seem to find such an option for when I start KVM/QEMU VMs with:

qemu-kvm -boot d OS.img

I know how to set RAM available, however, with the -m RAM option, which I'm mentioning in the hope that people won't confuse what I'm asking about with RAM. Here's a screenshot showing how I set this option in VirtualBox VM settings:

enter image description here

Best Answer

The video memory size can be defined using the vgamem_mb property on the VGA device:

qemu -device VGA,vgamem_mb=64 ...

will allocate 64 MiB to the framebuffer (instead of the default 16 MiB IIRC).

Some drivers have specific properties:

  • the virtio GPU uses max_hostmem instead to specify how much host memory it’s allowed to use;
  • the QXL driver adds ram_size_mb, vram_size_mb, and vram64_size_mb, to define the size of the two regions it uses: ram stores the framebuffer, command rings, rendering commands and image data, and vram stores spice surfaces (see this email for details).
Related Question