How can I change default volume size and remove volatile volume?

Hello!

I have noticed that when creating a new VM, root, private and volatile volumes are assigned, no matter the type of the VM or the OS that will be installed later on. How can I:

  1. Reduce the default size of each volume during the creation of such VM? (Not after the VM has been created, because decreasing volume size is quite difficult.)

  2. Not assign the volatile volume at all? (I don’t want swap for Linux-based VM; Windows-based VM cannot utilise non-formatted volatile volume for swapping.)

Thanks

AFAIK, there is no option to do this.
I guess you have to build yourself the template to do it.
I’m not even sure you can do it that way.

Note that the template is a thin volume, so it only use the space occupied by the data.
Even if the root volume of the template is 10GiB, it doesn’t use 10GiB of your disk.

You doesn’t want to discard the volatile volume, it’s not just used for the swap parttion.
https://www.qubes-os.org/doc/template-implementation/

xvdc – volatile.img, discarded at each VM restart – here is placed swap and temporal “/” modifications (see below)

Snapshot device in AppVM

Root device is exposed to AppVM in read-only mode. AppVM can write only in:

  • private.img – persistent storage (mounted in /rw) used for /home, /usr/local – in future versions, its use may be extended
  • volatile.img – temporary storage, which is discarded after an AppVM restart

volatile.img is divided into two partitions:

  1. changes to root device
  2. swap partition

Inside of an AppVM, the root device is wrapped by the snapshot in the first partition of volatile.img. Therefore, the AppVM can write anything to its filesystem – however, such changes will be discarded after a restart.

Yes, I realised that the volatile volume is not just about swapping. In fact, I intended to get rid of overlay as well and mount rootfs as read-only. I found a topic on this forum about a GitHub project called Liteqube doing that among others, but have not tried yet.

As regard to thin volume, it is true that usually less space is used than the (maximum) size of the volume. However, I have some VMs with almost identical data on the private volume (just 1MB) but the Qube Manager says one VM uses 1.2MB while the other VM uses 149MB of disk space. I just cannot figure out why.