How to increase dom0 RAM and disable swap in dom0?

Hello, I have three questions, please tell me:

  1. How to increase dom0 RAM?
  2. How to disable swap in dom0?
    Is it enough to comment out the line in the /etc/fstab file:
#/dev/mapper/qubes_dom0-swap none    swap    defaults,x-systemd.device-timeout=0 0 0
  1. How to disable swap in a specific virtual machine?
    Is it enough to comment out the line in the virtual machine template in the /etc/fstab file:
#/dev/xvdc1    swap    swap    defaults    0 0

Add this line at the end of in grub config /etc/default/grub and change dom0_mem=max value:

GRUB_CMDLINE_XEN_DEFAULT="$GRUB_CMDLINE_XEN_DEFAULT dom0_mem=max:4096M"

And regenerate grub config:

sudo grub2-mkconfig -o /boot/grub2/grub.cfg

This should be enough, but you can try it to make sure.

1 Like

After I disabled the swap file in dom0:
Commented out the line in the /etc/fstab file:

#/dev/mapper/qubes_dom0-swap none    swap    defaults,x-systemd.device-timeout=0 0 0

I have a block device (qubes_dom0-swap):

[user@dom0]$ qvm-block
BACKEND:DEVID  DESCRIPTION      USED BY
dom0:dm-5      qubes_dom0-swap

Is there a way to prevent the block device (qubes_dom0-swap) from appearing in Qubes Devices ?

Check if this volume is used for swap using this command:

swapon -s

You can remove this volume if you don’t plan to use it for swap anymore:

lvremove /dev/mapper/qubes_dom0-swap
1 Like