swap-file-creator

Adds encrypted swap file to the system.
Contents
Introduction[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Introduction
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#Introduction|Introduction]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Introduction](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Introduction)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Introduction](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Introduction)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Introduction]Introduction[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
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]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Installation
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#Installation|Installation]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Installation](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Installation)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Installation](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Installation)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Installation]Installation[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Platform dependent.
- Kicksecure: Available. Installed by default. Otherwise, see footnote. [3]
- Kicksecure-Qubes: Unsupported. [4]
Configuration[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Configuration
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#Configuration|Configuration]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Configuration](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Configuration)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Configuration](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Configuration)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Configuration]Configuration[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
The config file is located at /etc/default/swap-file-creator
. Here you can change various parameters for the swapfile creation such as the path for where to create the swapfile at startup. [5]
Open file /etc/default/swap-file-creator
in an editor with root rights.
Kicksecure
See Open File with Root Rights for detailed instructions on why to use
sudoedit
for better security and how to use it.
Note: Mousepad (or the chosen text editor) must be closed before running the sudoedit
command.
Click = Copy Copied to clipboard! sudoedit /etc/default/swap-file-creator
Kicksecure for Qubes
NOTES:
- When using Kicksecure-Qubes, this needs to be done inside the Template.
Click = Copy Copied to clipboard! sudoedit /etc/default/swap-file-creator
- After applying this change, shutdown the Template.
- All App Qubes based on the Template need to be restarted if they were already running.
- This is a general procedure required for Qubes and unspecific to Kicksecure for Qubes.
Others and Alternatives
- This is just an example. Other tools could achieve the same goal.
- If this example does not work for you or if you are not using Kicksecure, please refer to this link.
Click = Copy Copied to clipboard! sudoedit /etc/default/swap-file-creator
For example, to set a custom swap file size of 1024 MB, add.
Click = Copy Copied to clipboard! SWAP_FILE_SIZE_CUSTOM_MB=1024
Save.
Done. Settings will be applied after reboot (or when swap-file-creator is restarted).
Other configuration options.
- Click = Copy Copied to clipboard! SWAPFILE=/var/swapfile
Check Swap File Size[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Check_Swap_File_Size
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#Check_Swap_File_Size|Check Swap File Size]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Check Swap File Size](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Check_Swap_File_Size)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Check Swap File Size](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Check_Swap_File_Size)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Check_Swap_File_Size]Check Swap File Size[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Click = Copy Copied to clipboard! sudo du -sh /var/swapfile
Functionality Test[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Functionality_Test
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#Functionality_Test|Functionality Test]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Functionality Test](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Functionality_Test)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Functionality Test](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Functionality_Test)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Functionality_Test]Functionality Test[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
To check it is working correctly, check the amount of free and used memory in the system.
Click = Copy Copied to clipboard! free -m
Next, enable swapping and display the swap usage summary.
Click = Copy Copied to clipboard! sudo swapon -s
For troubleshooting purposes, Check Daemon Log and search for unit-name: swap-file-creator
.
Live Mode[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Live_Mode
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#Live_Mode|Live Mode]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Live Mode](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Live_Mode)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Live Mode](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Live_Mode)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Live_Mode]Live Mode[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
swap-file-creator
does not run if live mode is detected. [6]
Debugging[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Debugging
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#Debugging|Debugging]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Debugging](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Debugging)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Debugging](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Debugging)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Debugging]Debugging[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Only required in case of issues. Otherwise the user can skip this wiki chapter.
Error States[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Error_States
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#Error_States|Error States]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Error States](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Error_States)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Error States](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Error_States)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Error_States]Error States[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
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. [7] 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]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Manual_Swap_File_Creation
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#Manual_Swap_File_Creation|Manual Swap File Creation]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Manual Swap File Creation](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Manual_Swap_File_Creation)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Manual Swap File Creation](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Manual_Swap_File_Creation)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Manual_Swap_File_Creation]Manual Swap File Creation[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
TODO: document
Disable[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Disable
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#Disable|Disable]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Disable](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Disable)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Disable](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Disable)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Disable]Disable[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Click = Copy Copied to clipboard! sudo systemctl stop swap-file-creator
Click = Copy Copied to clipboard! sudo systemctl disable swap-file-creator
Click = Copy Copied to clipboard! sudo rm -f /var/swapfile
Development[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Development
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#Development|Development]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Development](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Development)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Development](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Development)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Development]Development[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
- main source code file: https://github.com/Kicksecure/swap-file-creator/blob/master/usr/share/swap-file-creator/swap-file-creator
- systemd unit file: https://github.com/Kicksecure/swap-file-creator/blob/master/usr/lib/systemd/system/swap-file-creator.service
- https://github.com/Kicksecure/swap-file-creator
See Also[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#See_Also
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#See_Also|See Also]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[See Also](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#See_Also)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[See Also](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#See_Also)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#See_Also]See Also[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Footnotes[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Footnotes
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Swap-file-creator#Footnotes|Footnotes]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Footnotes](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Footnotes)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Footnotes](https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Footnotes)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Swap-file-creator?oldid=87874#Footnotes]Footnotes[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
- ↑ 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 package(s)
swap-file-creator
following these instructions1 Platform specific notice.
- Kicksecure: No special notice.
- Kicksecure-Qubes: In Template.
2 Update the package lists and upgrade the system
.
Click = Copy Copied to clipboard! sudo apt update && sudo apt full-upgrade
3 Install the
swap-file-creator
package(s).Using
apt
command line--no-install-recommends
optionis in most cases optional.
Click = Copy Copied to clipboard! sudo apt install --no-install-recommends swap-file-creator
4 Platform specific notice.
- Kicksecure: No special notice.
- Kicksecure-Qubes: Shut down Template and restart App Qubes based on it as per Qubes Template Modification
.
5 Done.
The procedure of installing package(s)
swap-file-creator
is complete. - ↑ Setting up swap and/or encryption of any kind is completely up to Qubes. Unspecific to Kicksecure.
- ↑ Useful in case you have a copy-on-write system like ZFS or BtrFS.
- ↑
Live mode is detected if file
/proc/cmdline
contains stringboot=live
. - ↑
https://www.virtualbox.org/ticket/17055#comment:3


Copy as Wikitext

for Discourse, reddit, GitHub

Copy as Markdown

Copy as phpBB Click below ↴ = Open social URL with share data











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!