Trying to install TAILS with persistence not working...any ideas?


New Member
Oct 29, 2023
Trying to install TAILS with persistence...seems like an obvious enough thing to do, right? It keeps saying there's no device for persistence, I've tried it with a scsi disk, remapping to a usb disk, and as a usb disk, no dice. Any ideas? I'm going to do some prodding after I reboot the effing thing again because I didn't enable root but it takes like 5 minutes to start even though I can write to the disk at 500MB/s and it has 8GB (more than enough) RAM.

References: Running TAILS as a VM with persistence , qemu USB emulation , tails - virt-manager

Here's what I've tried so far:
# Create a VM with storage size of intended image using GUI, make note of
# storage location for image

# Download the TAILS USB image and change the filesize (32G in this case)
root@pr0xm0x /fandango# truncate -s 32G /home/jackd/Downloads/tails-amd64-5.19-img/tails-amd64-5.19.img
root@pr0xm0x /fandango#

# Import disk image to VM (in this case 105)

# backup config file for VM
root@pr0xm0x /fandango# cp /etc/pve/qemu-server/105.conf /etc/pve/qemu-server/105.conf.bak

# open the config file and locate the disk, you are looking for this line
# (nimrod is the storage name, vm-105 is the VM)
scsi0: nimrod:vm-105-disk-0,aio=native,cache=directsync,size=32G

# find the disk
root@pr0xm0x /fandango# zfs list
NAME                          USED  AVAIL     REFER  MOUNTPOINT
nimrod/vm-105-disk-0         33.0G   247G       12K  -

# Find the zvol that corresponds to your VM disk image
root@pr0xm0x ~# ls -l /dev/zvol/nimrod/vm-105-disk-0
lrwxrwxrwx 1 root root 10 Nov 17 00:07 /dev/zvol/nimrod/vm-105-disk-0 -> ../../zd96

# Additional information (not required)
$ udevadm info /dev/zd0
P: /devices/virtual/block/zd0
N: zd0
S: rpool/swap
S: zvol/rpool/swap
E: DEVLINKS=/dev/zvol/rpool/swap /dev/rpool/swap
E: DEVNAME=/dev/zd0
E: DEVPATH=/devices/virtual/block/zd0
E: MAJOR=230
E: TAGS=:systemd:

# Clone the image into the zfs vdev
root@pr0xm0x /fandango# dd bs=4M if=/home/jackd/Downloads/tails-amd64-5.19-img/tails-amd64-5.19.img of=/dev/zd96 status=progress
34292629504 bytes (34 GB, 32 GiB) copied, 85 s, 403 MB/s
8192+0 records in
8192+0 records out
34359738368 bytes (34 GB, 32 GiB) copied, 103.733 s, 331 MB/s
root@pr0xm0x /fandango#

# Awesome, you should be able to boot from it and be relatively satisfied with
# your transfer speeds but wonder why it doesn't boot faster, oh well

# Boot the VM aaaand, it freezes during the boot process so we'll need to
# change some things

# Find your drive and device lines
  -iscsi '' \
  -drive 'if=none,id=drive-ide2,media=cdrom,aio=io_uring' \
  -device 'ide-cd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2,bootindex=101' \
  -device 'lsi,id=scsihw0,bus=pci.0,addr=0x5' \
  -drive 'file=/dev/zvol/nimrod/vm-105-disk-0,if=none,id=drive-scsi0,cache=directsync,aio=native,format=raw,detect-zeroes=on' \
  -device 'scsi-hd,bus=scsihw0.0,scsi-id=0,drive=drive-scsi0,id=scsi0,bootindex=100' \

# So we need to set the original drive image (id=drive-scsi0) to read-only

# Create a new USB device from the original image we found previously
# (/dev/zvol/nimrod/vm-105-disk-0)
-drive 'file=/dev/zvol/nimrod/vm-105-disk-0,if=none,id=drive-usb0,format=raw,cache=none,aio=native,detect-zeroes=on'

# Attach it as a new device
-device 'usb-storage,drive=drive-usb0,bootindex=1,removable=on'

# And add these options to the config file as one line
args: -set -drive 'file=/dev/zvol/nimrod/vm-105-disk-0,if=none,id=drive-usb0,format=raw,cache=none,aio=native,detect-zeroes=on' -device 'usb-storage,drive=drive-usb0,bootindex=1,removable=on'

# You can cut and paste or (and honestly is this the only way to escape the single quotes?)
echo 'args: -set -drive '"'"'file=/dev/zvol/nimrod/vm-105-disk-0,if=none,id=drive-usb0,format=raw,cache=none,aio=native,detect-zeroes=on'"'"' -device '"'"'usb-storage,drive=drive-usb0,bootindex=1,removable=on'"'"'' >> /etc/pve/qemu-server/105.conf

# aaaaand it doesn't work and freezes at the boot screen

# So let's
root@pr0xm0x /fandango# echo 'args: -set -drive '"'"'file=/dev/zvol/nimrod/vm-105-disk-0,if=none,id=drive-usb0,format=raw,aio=native,detect-zeroes=on'"'"' -device '"'"'usb-storage,drive=drive-usb0,bootindex=1,removable=on'"'"'' >> /etc/pve/qemu-server/105.conf

root@pr0xm0x /fandango# sed -i '/scsi0/d' /etc/pve/qemu-server/105.conf

root@pr0xm0x /fandango# mv /etc/pve/qemu-server/105.conf /etc/pve/qemu-server/105.conf-poo summary of resource usage, why is memory so high what I see after the boot process

# Let's try something else with USB options

# remove the scsi0 line and add a usb device from the disk image
args: -drive if=none,id=usbstick,format=raw,file=/dev/zvol/nimrod/vm-105-disk-0
    -usb                                                        \
    -device usb-ehci,id=ehci                                    \
    -device usb-storage,bus=ehci.0,drive=usbstick

# Holy fish it worked

# I'm guessing you could do away with the whole "create a scsi device and dd
# the image into the scsi device and then say it's a USB by just changing the
# file= and point it to the truncated image"

# But it still won't allow persistence

# Even though it says on the USB emulation page
In the configuration view, choose VirtIO Disk 1 or IDE Disk 1

    Set Disk bus to USB.

    Click Apply.

    Expand the Advanced options.

    Enable Removable.

    Click Apply again.

    Click Begin Installation in the top left corner to start the virtual machine.

After you start on the USB image, you can create a Persistent Storage on it.


The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!