How to disable the swap partition in template and app VMs?

Hi. I am trying to disable the swap partition and zswap because I want to see if it would speed up my my laptop.

To disable the swap partition, I did several things in the template VM:

I add a kernel parameter:

I also commented out the line for the swap partition in /etc/fstab

But that doesn’t work :frowning:

After I start the template VM and run top, I still see the size of the swap is 1 GB.

I can run ‘sudo swapoff -a’ to temporarily disable the swap. But whenever I restart the VM, the swap is back.

How to disable the swap partition in the template and app VMs?

Thanks.

Disable systemd swap service:
sudo systemctl mask "dev-*.swap"