SolusVM KVM templates sometimes don't set up swap space correctly. This guide will help you create your swap partition.
This issue is specific to SolusVM KVM VPS. Cloud instances handle swap differently and typically don't require manual configuration.
To create your swap space, connect to your VPS via SSH and run the following commands:
# Turn off the current swap
swapoff /dev/vda2
# Create the swap filesystem
mkswap /dev/vda2
# Enable the swap
swapon /dev/vda2After running the commands above, you can verify that swap is now active by running:
free -hYou should see a non-zero value in the "Swap" row.
If you need to resize your swap partition, you might have to use the GParted ISO available in SolusVM. To do this:
Before resizing partitions, always backup your important data. While partition resizing is generally safe, there's always a small risk of data loss.
If you're seeing "cannot allocate memory" errors when trying to run updates, the missing swap space is likely the cause. See our memory allocation error guide for more information.
If you're having trouble creating swap space or resizing partitions, contact our support team. We can help troubleshoot or resize your swap partition for you.