{{Header}} {{Title|title= swap-file-creator }} {{#seo: |description=Adds encrypted swap file to the system. |image=File-swap-promo.jpg }} [[File:File-swap-promo.jpg|thumb|swap-file-creator logo]] {{intro| Adds encrypted swap file to the system. }} = Introduction = 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. Such as during Linux kernel module building (VirtualBox guest additions) as well as kernel header package upgrades. * https://forums.whonix.org/t/swap-swap-file-whonix-gateway-freezing-during-apt-get-dist-upgrade-encrypted-swap-file-creator/8317 * https://forums.whonix.org/t/whonix-xfce-for-virtualbox-users-ram-increase-required/8993 * https://forums.whonix.org/t/default-ram-setting/12312 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. https://github.com/{{project_name_short}}/swap-file-creator/blob/master/etc/default/swap-file-creator For further information, see: https://github.com/{{project_name_short}}/swap-file-creator = Installation = Installed by default. Otherwise, see footnote. {{Install Package| package=swap-file-creator }} = Check Swap File Size = {{CodeSelect|code= sudo du -sh /var/swapfile }} = Functionality Test = To check it is working correctly, check the amount of free and used memory in the system. {{CodeSelect|code= free -m }} Next, enable swapping and display the swap usage summary. {{CodeSelect|code= sudo swapon -s }} For troubleshooting purposes, [[Troubleshooting#Daemon_Log|Check Daemon Log]] and search for unit-name: swap-file-creator. = Live Mode = swap-file-creator does not run if [[grub-live|live mode]] is detected. Live mode is detected if file /proc/cmdline contains string boot=live. = Debugging = Only required in case of issues. Otherwise the user can skip this wiki chapter. == Error States == 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 [[VirtualBox/Recommended Version|recommended VirtualBox version]] wiki page are are likely to break VirtualBox VMs [[Kernel#Kernel_Issues|in many ways]] if these are unsupported by VirtualBox. https://www.virtualbox.org/ticket/17055#comment:3 In this case, swap-file-creator might [https://forums.whonix.org/t/solved-swap-file-creator-breaks-with-whonix-16-for-virtualbox-and-newer-linux-host-kernel-version-5-18/13799 be broken] and this being the only [https://forums.whonix.org/uploads/default/original/2X/6/694af8fb74342a848d9fae832ba028c481e18a72.png 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 == TODO: document = Disable = {{CodeSelect|code= sudo systemctl stop swap-file-creator }} {{CodeSelect|code= sudo systemctl mask swap-file-creator }} = See Also = * [[rads|RAM Adjusted Desktop Starter]] = Footnotes = {{reflist|close=1}} {{Footer}} [[Category:Documentation]]