How to set individual VM swap?

35 views
Skip to first unread message

Eric

unread,
Feb 21, 2019, 8:18:48 PM2/21/19
to qubes...@googlegroups.com
R4.0 I must be missing something - really quite
basic - cannot see how to change the fixed 1GB
allocation of swap to each VM on its volatile
volume at startup. This is much too small for a
larger VM - eg a 6GB f29 VM running leaky
software, I notice Swap: 0.0 free and it is then
not long before the biggest memory hog gets the
bullet from the kernel - out of memory - when
the VM is nowhere near thrashing.

I expected either a fixed value for swap or a
ratio to maxmem exposed by qvm-prefs. Ratio
makes more sense as then inheriting a default
from the template should work.  Should be on
Qubes Manager/Settings/Advanced tab under maxmem
as well.  Is opening an issue warranted?

In the mean time where is this constant defined?

Thanks, Eric

awokd

unread,
Feb 22, 2019, 5:12:43 AM2/22/19
to qubes...@googlegroups.com

unman

unread,
Feb 22, 2019, 5:57:44 AM2/22/19
to qubes...@googlegroups.com
The 1G is the partition size set for /dev/xvdc1
Since /dev/xvdc is 10G in size and only 1G is allocated to swap, an
alternative (better?) would be to use that space.
/sbin/swapoff -a
/sbin/parted /dev/xvdc rm 1
/sbin/parted /dev/xvdc mkpart primary 0 10G -s
/sbin/swapoff -a
/sbin/mkswap /dev/xvdc1
/sbin/swapon -a

You can put this directly in to /rw/config/rc.local and it will
reprovision swap on boot, with little effect on boot time.

unman
Reply all
Reply to author
Forward
0 new messages