swap-file-creator
Adds encrypted swap file to the system.
Introduction[edit]
swap-file-creator
adds an encrypted swap file to the system. On every boot, it creates a new encrypted swapfile with a random password.
This is useful for systems with low RAM such as those inside virtual machines. Prevents common cases of freezing of VMs with low RAM during upgrades. [1]
It has an ENOUGH_RAM
setting which defaults to 1950
MB. If there is more than enough RAM, it will not advice to increase RAM.
An optional option exists to shred the swapfile on shutdown but this is slow. [2]
For further information, see: https://github.com/Kicksecure/swap-file-creator
Installation[edit]
Installed by default. Otherwise, see footnote. [3]
Check Swap File Size[edit]
sudo du -sh /var/swapfile
Functionality Test[edit]
To check it is working correctly, check the amount of free and used memory in the system.
free -m
Next, enable swapping and display the swap usage summary.
sudo swapon -s
For troubleshooting purposes, Check Daemon Log and search for unit-name: swap-file-creator
.
Live Mode[edit]
swap-file-creator
does not run if live mode is detected. [4]
Debugging[edit]
Only required in case of issues. Otherwise the user can skip this wiki chapter.
Error States[edit]
In case swap-file-creator is failing at boot time, it does not break the boot process.
For example, host kernel versions other than the one recommended on the recommended VirtualBox version wiki page are are likely to break VirtualBox VMs in many ways if these are unsupported by VirtualBox. [5] In this case, swap-file-creator might be broken and this being the only visible error but this still does not break the boot process. However, when using kernel versions unsupported by VirtualBox, many other things will be broken and the system will be unbootable anyhow.
Manual Swap File Creation[edit]
TODO: document
Disable[edit]
sudo systemctl stop swap-file-creator
sudo systemctl mask swap-file-creator
See Also[edit]
Footnotes[edit]
- ↑ Such as during Linux kernel module building (VirtualBox guest additions) as well as kernel header package upgrades.
- ↑ https://github.com/Kicksecure/swap-file-creator/blob/master/etc/default/swap-file-creator
- ↑
Install
swap-file-creator
. To accomplish that, the following steps A. to D. need to be done.A. Update the package lists.
sudo apt update
B. Upgrade the system.
sudo apt full-upgrade
C. Install the
swap-file-creator
package.Using
apt
command line parameter--no-install-recommends
is in most cases optional.sudo apt install --no-install-recommends swap-file-creator
D. Done.
The procedure of installing
swap-file-creator
is complete. - ↑
Live mode is detected if file
/proc/cmdline
contains stringboot=live
. - ↑ https://www.virtualbox.org/ticket/17055#comment:3
Unfinished: This wiki is a work in progress. Please do not report broken links until this notice is removed, use Search Engines First and contribute improving this wiki.
We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 12 year success story and maybe DONATE!