The physical host in this case has 128G RAM and 32 CPUs. Plenty of capacity. To increase the maximum amount of memory that can be allocated to the VM:

# virsh setmaxmem <vm name> 16G --config

There are also –live and –current options which claim to affect the running/current domain. These options do not actually work. You have to use the –config option (changes take effect after next boot) and then power off the machine by logging in and running “poweroff”.

Post navigation

6 thoughts on “Increase a VM’s available memory with virsh”

Thanks for this. I had a libvirt VM that I bought up using Vagrant. I had it set to 2GB of ram on VirtualBox, but totally forgot to add a section for libvirt+kvm. Vagrant can’t adjust machines after you bring them up apparently :( This worked perfectly though. Thanks!