Anti-forensics Precautions when using Whonix ™ VMs in Live Mode

From Whonix



Non-Qubes-Whonix ™ users have the option of booting into live mode. When using this feature in Whonix ™ VMs, precautions should still be taken on trusted systems (like GNU/Linux hosts) to prevent leaving traces -- proprietary operating systems such as Windows and macOS are a lost cause.

At the moment there is only one advantage of this configuration compared to running grub-live on the host -- achieving selective amnesia for some virtual machines (VMs) while others remain persistent. This section is a work in progress and not exhaustive.

When Whonix ™ is run as a live system, all changes are written to non-persistent memory (RAM) by default. However, it is possible for this design to be bypassed by malware, swap files, core dumps and other relevant configurations that are in effect. Fortunately, most of these can be disabled. [1] [2] [3] [4]

To prevent malware from remounting the hard drive as read-write it is highly recommended to use read-only hard drive mode. This raises the bar because malware would need to break out of the VM to gain persistence. In order to stymie disk forensics, it is suggested to apply full disk encryption on the host and the computer should be powered off when not in use.

Alternatively or in addition to full disk encryption, the entire host operating system could be run in live mode. In this configuration, all writes are redirected to the non-persistent memory (RAM). Running the host operating system in live mode also mandates a correctly implemented write protection switch; this is not required but highly recommended.

To make memory forensics harder, the machine should be removed from any power source by pulling the power plug. In the case of notebooks, the battery should be removed. [5]


Ambox warning pn.svg.png Tails documentation notes that host swapping may be the biggest threat to anti-forensics on Linux when running in a VM; see Security Considerations [archive]. [6]

Disabling Swap for an Entire System[edit]

Turning off swap for the whole system may cause system instability or crashes if the RAM hard limit is reached. However the ample RAM in new systems makes this unlikely and it is worth the tradeoff. [7] Disabling swap also disables the hibernation functionality.


On the host

1. Disable swap either temporarily or persistently.

The following command will disable swap and delete the file during the life of this session.

sudo swapoff -a

To disable swap in a persistent way, edit the fstab file and comment out the line (using #) with the swap partition.

sudoedit /etc/fstab

2. Save and reboot.

3. Confirm swap is disabled.

To check it is off, run the free command. The swap line should show zeros.

free -h

TODO: the existing swap partition should be securely wiped since sensitive information like encryption keys might have already leaked there.


Disabling swapping selectively for KVM VMs

An alternative KVM-only solution is to set guest memory pages as 'locked'. [8] [9]


This option is not without disadvantages - it can be abused by malicious guests DoSing the host through RAM exhaustion. [10]

Note: Setting vm.swappiness = 0 does not completely prevent swapping. [11]

Disabling Program Crash Dumps[edit]

Besides swap there is the problem of disabling process memory dumping to disk.


A user must go out of their way to enable kernel memory dumps since it is not enabled by default; kdump-tools is utilized in Debian. [12]


The default core dump file size is 0 on Debian Linux: [13]

ulimit -c

This setting is enforced for systemd-coredump too and can be verified by inspecting the lack of core files in /var/spool or /var/lib/systemd/coredump when an intentional crash is induced (/var/crash does not exist in Debian but it may be available in other Linux distributions). [14]

Disable setuid processes dumping their memory

Processes with elevated permissions (or the setuid bit) might still be able to perform a core dump, depending on your other settings. These processes usually have more access and might contain more sensitive data segments in memory, so they should be changed as well. The behavior can be altered with a sysctl key, or directly via the /proc file system. For permanent settings, the sysctl command and configuration is typically used. A setting is called a ‘key’, which has a related value attached to it (also known as a key-value pair).

To disable programs with the setuid bit to dump, set the fs.suid_dumpable to zero:

sudo su

echo "fs.suid_dumpable=0" >> /etc/sysctl.conf

Reload the sysctl configuration with the -p flag to activate any changes you made.

sysctl -p


  1. Is there a Whonix ™ Amnesic Feature / Live CD / Live DVD? What about Forensics?
  2. Whonix ™ is not Amnesic
  3. Encrypted Guest Images: Other Security Considerations
  4. Core Dumps
  5. And/or the memory should be wiped upon shutdown. This is a theoretical mechanism at present because it is undocumented. [archive]
  6. Linux also uses swapping despite having apparent "free" memory. The kernel tends to swap out long-inactive and memory-consuming processes. This frees up RAM for caches and therefore improves responsiveness.
  7. [archive]
  8. [archive]
  9. [archive]
  10. When set and supported by the hypervisor, memory pages belonging to the domain will be locked in the host's memory and the host will not be allowed to swap them out, which might be required for some workloads such as real-time. For QEMU/KVM guests, the memory used by the QEMU process itself will be locked too: unlike guest memory, this is an amount libvirt has no way of figuring out in advance, so it has to remove the limit on locked memory altogether. Thus, enabling this option opens up to a potential security risk: the host will be unable to reclaim the locked memory back from the guest when it is running out of memory. This means a malicious guest allocating large amounts of locked memory could cause a denial-of-service attack on the host. Due to the risk, this option is discouraged unless your workload demands it. Even then, to mitigate these risks it is strongly recommended to set a `hard_limit` (see memory tuning [archive]) on memory allocation suitable for the specific environment at the same time.
  11. [archive]
  12. [archive]
  13. [archive]
  14. [archive]

text=Jobs in USA
Jobs in USA

Search engines: YaCy | Qwant | ecosia | MetaGer | peekier | Whonix ™ Wiki

Follow: Twitter.png Facebook.png 1280px-Gab text logo.svg.png Iconfinder news 18421.png Rss.png Matrix logo.svg.png 1024px-Telegram 2019 Logo.svg.png Discourse logo.svg Reddit.jpg Diaspora.png Gnusocial.png Mewe.png 500px-Tumblr Wordmark.svg.png Iconfinder youtube 317714.png 200px-Minds logo.svg.png 200px-Mastodon Logotype (Simple).svg.png 200px-LinkedIn Logo 2013.svg.png

Donate: Donate Bank Wire Paypal Bitcoin accepted here Monero accepted here Contriute

Whonix donate bitcoin.png Monero donate whonix.png United Federation of Planets 1000px.png

Share: Twitter | Facebook

Want to get involved with Whonix ™? Check out our Contribute [archive] page.

https link onion link

This is a wiki. Want to improve this page? Help is welcome and volunteer contributions are happily considered! Read, understand and agree to Conditions for Contributions to Whonix ™, then Edit! Edits are held for moderation. Policy of Whonix Website and Whonix Chat and Policy On Nonfreedom Software applies.

Copyright (C) 2012 - 2020 ENCRYPTED SUPPORT LP. Whonix ™ is a trademark. Whonix ™ is a licensee [archive] of the Open Invention Network [archive]. Unless otherwise noted, the content of this page is copyrighted and licensed under the same Freedom Software license as Whonix ™ itself. (Why?)

Whonix ™ is a derivative of and not affiliated with Debian [archive]. Debian is a registered trademark [archive] owned by Software in the Public Interest, Inc [archive].

Whonix ™ is produced independently from the Tor® [archive] anonymity software and carries no guarantee from The Tor Project [archive] about quality, suitability or anything else.

By using our website, you acknowledge that you have read, understood and agreed to our Privacy Policy, Cookie Policy, Terms of Service, and E-Sign Consent. Whonix ™ is provided by ENCRYPTED SUPPORT LP. See Imprint, Contact.