Run Tails OS in virt-manager with Persistent Storage

In this tutorial, I show how to run Tails OS in virt-manager on Linux Mint / Ubuntu with Persistent Storage working.

This tutorial is tested on Linux Mint, but it should also work on Ubuntu and most Debian-based distributions that support virt-manager, QEMU, and libvirt.

Important note

This is a lab/demo setup.

For real privacy-sensitive use, boot Tails from a physical USB drive.

Running Tails inside a virtual machine is useful for learning, testing, and tutorials, but the host Linux system can still control or observe the VM.

1. Install virt-manager

Make sure virtualization is enabled in your BIOS/UEFI.

Update your system and install virt-manager with the required packages:

sudo apt update
sudo apt install virt-manager libvirt-daemon-system qemu-kvm qemu-utils

Check your current username:

whoami

Add your user to the libvirt and kvm groups:

sudo usermod -aG libvirt,kvm $USER

Log out and log back in, or reboot:

sudo reboot

After reboot, check your groups:

groups

You should see:

libvirt kvm

2. Download the Tails USB image

Download the Tails USB image, not the ISO.

The file should look something like this:

tails-amd64-7.8.1.img

Verify the image on the official Tails website before using it:

https://tails.net/

3. Prepare the Tails VM disk image

Go to the Downloads folder where the Tails USB image was downloaded:

cd ~/Downloads

Copy the Tails USB image into libvirt’s VM image folder:

sudo cp tails-amd64-*.img /var/lib/libvirt/images/tails-lab.img

Resize the image to 16GB so there is space for Persistent Storage:

sudo truncate -s 16G /var/lib/libvirt/images/tails-lab.img

I use 16GB for this lab because it is enough to demonstrate Persistent Storage.

You can use a larger size, like 32GB or 64GB or more, if you want more persistent storage space.

Important note: truncate creates a sparse file, so a 64GB image may not immediately use 64GB on your real disk. It grows as data is written. Still, make sure your system has enough free space.

Set the correct owner and permissions for libvirt:

sudo chown libvirt-qemu:kvm /var/lib/libvirt/images/tails-lab.img
sudo chmod 600 /var/lib/libvirt/images/tails-lab.img

Check that the VM disk image exists:

sudo ls -lh /var/lib/libvirt/images/tails-lab.img

4. Test virt-manager

Open virt-manager from the terminal:

virt-manager

Make sure virt-manager opens correctly.

Then close it before creating the VM from the terminal.

5. Create the VM

Create the Tails VM using virt-install:

virt-install \
  --name tails-lab \
  --memory 4096 \
  --vcpus 2 \
  --osinfo detect=on,require=off \
  --import \
  --disk path=/var/lib/libvirt/images/tails-lab.img,format=raw,bus=usb \
  --network network=default \
  --graphics spice \
  --noautoconsole

In this example:

4096 MB = 4GB RAM
2 vCPUs = 2 virtual CPU cores

You can adjust these depending on your system resources.

The important part is:

bus=usb

This makes Tails see the image as a USB-style disk, which is needed for Persistent Storage.

6. Shut down the VM before changing settings

The VM may start automatically after running virt-install.

Check the VM status:

virsh list --all

If it is running, shut it down:

virsh shutdown tails-lab

Wait a few seconds and check again:

virsh list --all

If it is still running, force it off:

virsh destroy tails-lab

7. Check VM settings in virt-manager

Open virt-manager again:

virt-manager

Open the tails-lab VM settings.

Check the disk settings:

USB Disk 1
Disk bus: USB
Removable: checked
Readonly: unchecked
Shareable: unchecked

Then go to Boot Options and make sure:

USB Disk 1 is first in the boot order

8. Boot Tails

Start the virtual machine.

Tails should boot from the USB image.

Wait for Tails to load.

9. Create Persistent Storage

Inside Tails, go to:

Applications → Tails → Persistent Storage

Create Persistent Storage and choose a strong password.

Then reboot Tails.

At the welcome screen, unlock Persistent Storage with your password.

10. Test persistence

Open the Persistent folder.

Create a small test file and save it.

Reboot Tails again.

Unlock Persistent Storage.

Open the Persistent folder again and confirm the test file is still there.

If the file is still there, Persistent Storage is working.

11. Optional: check Tor / internet

You can also briefly check that Tor connects and that internet access works through Tails/Tor.

This is optional. The main goal of this lab is to confirm that Persistent Storage works.

12. Cleanup lab

To remove the lab VM, first check the VM list:

virsh list --all

If the VM is running, stop it:

virsh destroy tails-lab 2>/dev/null

Remove the VM definition:

virsh undefine tails-lab --nvram 2>/dev/null

Delete the Tails VM disk image:

sudo rm -f /var/lib/libvirt/images/tails-lab.img

That removes the lab VM and its Persistent Storage.

Summary

The key idea is simple:

Use the Tails USB image, not the ISO.
Resize the image.
Attach it as a USB disk.
Enable Removable.
Create Persistent Storage inside Tails.

That is what allows Tails Persistent Storage to work inside virt-manager.

Leave a Comment

Your email address will not be published. Required fields are marked *


Scroll to Top