6

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

4
  • Why aren't you using virt-manager? Aug 17, 2018 at 12:36
  • Not a bad question. Part of it is because the installation location is /var/lib/libvirt/images, which doesn't have enough space left for it to store my Win10 VM. Another reason is because I like to create desktop launchers for my VMs, which I know how to do when he VM is started from the command-line, not so sure if it's started using virt-manager.
    – Josh Pinto
    Aug 18, 2018 at 12:56
  • You don't have to store disk images there. It's just the default location. You can store them anywhere else you want. Just choose a new location or even create a new storage pool. Aug 18, 2018 at 13:02
  • Thanks. I suspected I might be wrong on that one.
    – Josh Pinto
    Aug 18, 2018 at 13:06

1 Answer 1

6

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).
14
  • Thanks, one side question. Which driver would be best for a Windows 10 VM?
    – Josh Pinto
    Aug 16, 2018 at 16:00
  • 1
    I have no idea, sorry... Aug 16, 2018 at 16:18
  • I tried this with a Windows 10 VM and it's still saying there's only 32 MB video memory available to it, even though I allocated 128 MB and there's no error at the command-line.
    – Josh Pinto
    Aug 16, 2018 at 16:20
  • What driver are you using? Aug 16, 2018 at 16:21
  • I used the above -device specification, although I combined it with the qemu-kvm command I was using, namely: qemu-kvm -boot d /data/VMs/win10.img -m 8192 -smp 3 -soundhw hda -device VGA,vgamem_mb=128. There's an error mentioned relating to the audio (audio: Unknown audio driver pa'`), but as that's not graphics related I didn't think it counted.
    – Josh Pinto
    Aug 16, 2018 at 16:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .