How to install Tails on (internal or external) hard disk. How to install Tails in VirtualBox

The guide, describes how to install Tails to an hdd and enable persistence using Tails builtin tools, exists already. But the manual is outdated nowadays and it does not work. So I reviewed it and fixed it. The next text will explain how to install Tails on hard disk in 2021.

This instruction is only for those who really understand why he needs it. If you know why you need it, then you should also understand the disadvantage/consequences/differences from the usual installation of Tails.

We will use the built-in Tails tool, we will just patch them a bit.

By the way, in the same way you can install Tails in VirtualBox.

Boot from DVD/USB and set the Administrator Password. Click + (plus):

Click Administration Password:

Enter and confirm any password:

Click Start Tails:

Then open the terminal.

Enter a command in the terminal to open the file:

sudo gedit /usr/lib/python3/dist-packages/tails_installer/creator.py

Find the line in it.

Only pay attention to USB and SDIO devices

and comment out the next 8 lines by putting # in front of each line (changing the font color indicates that you did everything right). This should be done up to and including:

continue

It turns out:

Save and close the file.

Now open the file:

sudo gedit /usr/lib/python3/dist-packages/tails_installer/gui.py

Find the line there

Skip devices with non-removable bit enabled

And comment out the next nine lines, down to and including

continue

It should look like this:

Save and close the file.

Now in the terminal run the command:

sudo /usr/bin/python3 -tt /usr/local/bin/tails-installer -u -n --clone -P -m -x

Select your disk and click Install:

Without rebooting, mount the "Tails" partition from the device/disk you just created using Applications → Utilities → Disks:

In the terminal, run

gedit /media/amnesia/Tails/syslinux/live*.cfg

Two files will be opened in gedit:

In each of them, find all occurrences of the string.

live-media=removable

and delete this stings.

Save and close these files.

Then in the terminal, run

gedit /media/amnesia/Tails/EFI/debian/grub*.cfg

The file will be opened in gedit. In it, similarly find all occurrences of the string.

live-media=removable

and delete this string.

Finally, run the command:

gedit /media/amnesia/Tails/EFI/debian/grub/grub*.cfg

As usual, gedit will open the file. Find all occurrences of the string in it

live-media=removable

and remove that line.

Reboot, select boot from disk (HDD) and when starting OS, set the Administration Password.

Now open a terminal and run there:

sudo gedit /usr/local/share/perl/*/Tails/Persistence/Setup.pm

Find in this file:

foreach my $check (@checks) {

After this line, insert the line

=begin

Important: it MUST be placed in column 1! A change in color means you did everything right:

Below, find the line

return 1;

BEFORE (above the curly bracket "}", which is in the same column as the first "r" in "return 1;"), insert the line

=cut

Important: it MUST be placed in column 1:

As you usually do, run Applications → Tails → Configure persistant volume:

Set a password and create a persistent storage:

You may want to save two files (or at least /usr/local/share/perl/*/Tails/Persistence/Setup.pm) and replace them with a script after each reboot (care of the owners and permissions!) For your hdd-Tails behaves exactly like USB Tails.

After reboot, a new field will appear in the welcome window, in which you can enter a password to enable the persistent storage:

As usual, you can configure persistent storage through the menu (remember that /usr/local/share/perl/*/Tails/Persistence/Setup.pm should be patched as shown above):

You might want to save the two files (at least /usr/share/perl5/Tails/Persistence/Setup.pm) and replace them after each reboot by a script (take care of ownership and permissions!) so that your hdd-Tails behaves exactly like a USB-Tails.

I recommend to back up the Setup.pm file:

cp /usr/local/share/perl/*/Tails/Persistence/Setup.pm /home/amnesia/Persistent/

I also recommend creating a file into which we will collect some useful actions:

Create a file:

gedit Persistent/start.sh

Copy-paste into it:

#!/bin/bash

# mount -o remount -w /lib/live/mount/medium # Usually it is not necessary
rm /usr/local/share/perl/*/Tails/Persistence/Setup.pm
cp /home/amnesia/Persistent/Setup.pm /usr/local/share/perl/`perl -v | grep -E -o '[0-9]+\.[0-9]+\.[0-9]+'`/Tails/Persistence/Setup.pm
# The following lines only if you installed Tails in VirtualBox #Not need anymore anyway
VBoxClient --clipboard
VBoxClient --draganddrop
VBoxClient --display
VBoxClient --checkhostversion
VBoxClient --check3d
VBoxClient --seamless
VBoxClient --vmsvga

After rebooting, run the file as follows:

sudo bash Persistent/start.sh

As a result, the patched version of the Setup.pm file will be restored in the system, and VirtualBox Guest Additions processes will be launched - the screen will become large, the clipboard will work, and so on.

Be aware that ‘automatic’ upgrade (in place upgrade) might not work anymore and you need to manually upgrade.

Error “The configuration of your additional software failed”

This error occurs when the following conditions are combined:

  • Tails is installed on a hard disk or in a virtual machine
  • persistent storage enabled
  • you install additional software
  • you select the option “install this software every time Tails is turned on”

Error text on screen:

The configuration of your additional software failed. Please check your list of additional software or read the system log to understand the problem.

Error text in the log:

[INFO] New packages manually installed: {'chromium'}
[ERROR] /usr/bin/tails-persistence-setup returned with 2
[ERROR] 
[ERROR] (tails-persistence-setup:310): dbind-WARNING **: 05:59:53.377: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[ERROR] Prototype mismatch: sub Tails::Persistence::Setup::__ ($) vs none at (eval 428) line 2.
[ERROR] _build_boot_block_device: getting liveos_mountpoint
[ERROR] liveos_mountpoint: /lib/live/mount/medium
[ERROR] Entering underlying_block_device (/lib/live/mount/medium)
[ERROR] readlink returned: /dev/sda1
[ERROR] 
[ERROR] Leaving underlying_block_device, returning: /org/freedesktop/UDisks2/block_devices/sda1
[ERROR] Entering underlying_block_device (/lib/live/mount/medium)
[ERROR] readlink returned: /dev/sda1
[ERROR] 
[ERROR] Leaving underlying_block_device, returning: /org/freedesktop/UDisks2/block_devices/sda1
[ERROR] Error: Tails is running from non-USB / non-SDIO device.

The key here is the line “Error: Tails is running from non-USB / non-SDIO device”. The system made a check to ensure that it does not work on a USB drive or an optical disc and was unable to add additional software to the list of automatically installed.

Instead of trying to figure out which file you need to edit to fix the error, you can take a simple path – just add the packages you need to the file that contains the list of programs for unattended installation. This is the /lib/live/mount/persistence/TailsData_unlocked/live-additional-software.conf file.

Recommended for you:

40 Comments to How to install Tails on (internal or external) hard disk. How to install Tails in VirtualBox

  1. Max says:

    One aditional thing. If you want to install it on a modern Hard Disk (type NVME), you'll get an error claiming that the partition /dev/nvme0n11 does not exist (the numbers might be diferent though). This is because the installer ads an "1" to the disk name to look for the partition just created (which works with /dev/sdx devices) and not an "p1" (as required on /dev/nvme.. devices)

    Edit the file creator.py located in the same directory as the gui.py and look for "p1". Then make sure that line reads:

    elif full_drive_name.startswith('/dev/nvme'):
                append = 'p1'
    
  2. Mario says:

    Thank you for this tutorial. I was able to get tails running on my external hdd with it, before the cloning process for installing it from a usb didn't work. I have one issue with the download on my hard drive at the moment; it doesn't allow me to download anything from the web. Would you know of any possible fixes to this problem?

     

    • Alex says:

      Hello! I did not understand, what is the problem? All downloaded via web browser files are saved in the /home/amnesia/Tor Browser/ directory. Or you don’t have Internet connection?

      • Mario says:

        What happens is whenever I try to download anything from my web browser, it will begin download like normal but ultimately fail every time. I've tested to see if my internet is the issue through my I other installation of tails on my usb but this issue is only present within the hdd.

  3. NKD says:

    Hi Alex,

    I wanted to use this tutorial to install Tails as dual boot but I getting this error during installation

    g-bd-part-error-quark: GDBus.Error:orggtk.GDBus.UnmappedGError.Quark._q_2dbd_2dpart_2derror_2dquark.Code2:Faild to inform OS about changes on the '/dev/nvme0n1p7

     

    Can Tails be installed on existing nvme where are other OS installed?

    • Alex says:

      Hello! Unfortunately, I don’t know. And this error does not give any clue.

      • Mario says:

        I was getting the same error when trying to install it on an external NVMe drive, but then thanks to boop's comment, realized that my installer path was not correct and updated that bit.

        After adjusting that path my installer picked up the hard drives, but only the wole drives, I don't see partitions anymore. I would like to install it to a specific partition on one of the detected drives, but the current setup offers only to erase everything on that drive before creating a partition and installing the system on it.

        Do you know if there's a way around it?

        Thank you.

  4. Alex says:

    Instructions for installing Tails on hard drive and in VirtualBox have been checked and updated. New instruction tested successfully on Tails 4.11~rc1 - installation in VirtualBox works great.

  5. extHDD4TAILSorBUST says:

    I have a similar problem to NKD.

    sudo /usr/bin/python -tt /usr/bin/tails-installer -u -n --clone -P -m -x

    does not work for me. there IS NO tails-installer in /usr/bin anymore.

    If I run the one that’s in the applications folder it doesn’t work I get format issues like NKD.

    Am I missing something?

  6. boop says:

    The tails-installer path has changed as of Tails 4.9 / 4.10 / 4.11 / 4.12 / 4.13 (and maybe later versions)

    in a terminal, type:

    which tails-installer

    it will tell you the new location (in Tails 4.13 it's /usr/local/bin/tails-installer)

     

     

  7. smokeweedeveryday says:

    just so you guys are aware, step 1 should be:

    sudo gedit /usr/lib/python3/dist-packages/tails_installer/creator.py

     

    its python3 now not python2.7, i was stuck on this for ages, hope it helps someone

     

    • Alex says:

      Greetings! Thanks for the solution! I think this will help a lot. I will correct this command in the instructions.

  8. Alex says:

    Thanks to everyone who pointed out the changes!

    The instruction has been verified, many errors have been fixed. The instruction is now fully functional. It has been tested with Tails 4.15.

  9. Nananan says:

    Thanks for the detailed tutorial, I would like to ask about how to do a different configuration -- How I can boot from Live DVD and create a persistent volume on the hard disk? I tried to comment out the checks in Setup.pm.

    But when tails-persistence-setup launches, either the GUI fails because the DVD has no free space or if I pass `override_liveos_mountpoint=\a\different\path\harddiskfolder`, it complains the directory do not exsit. ( The directory does exist and it is on the hard disk)

  10. Frank says:

    Hi!

    Did you 'steal' that from my Tails Wiki? If so: Thanks for the effort to add pics!

    You might want to see https://web.archive.org/web/20190215233548if_/https://www.reddit.com/r/tailswiki/wiki/index for more ideas (yeah, the bastards at reddit closed the original pages )

     

    Cheers,

    Frank

     

    P.S. especially useful might be the startup script:

    https://web.archive.org/web/20200703014545if_/https://www.reddit.com/r/tailswiki/wiki/index/tails-autorun-at-startup

    • Alex says:

      I don't understand, do you blame me? I provided a link to the source ( https://www.reddit.com/r/tailswiki/wiki/index/internal-hd-install ), I never said that I was the author of the idea. I didn't just copy-paste, I fixed commands that stopped working due to changes in Tails. As you can see, then the commands were deprecated again, and with the help of the hints in the comments for this article, I corrected the commands again, and now, in 2021, they work again.

      In this article, I can provide all the credentials and links to you and your online resources. Just write, what information about the original author you would like to have in this article.

      Thanks for the link to your Tails Wiki. I'm not going to “steal”, but if you don't mind, I would be interested to check out the hacks and tricks, fix them if they are out of date, and share with everyone.

      • Frank says:

        Duuude?

        Please don't be triggered or jump to conclusions. Rather see above: " Thanks for the effort to add pics!"

        BTW: Thanks to your post my work is still available. Reddit shut it down (only a very few parts of TailsWiki have been conserved by archive.org).

        • Alex says:

          I mean, I respect the work of other authors and I don't want anyone to be unhappy about using their work in my articles.

          Thanks for the idea and for the commands - they are very useful to me. As you can see from the comments, there are enough people who need your work.

  11. Frank says:

    For Tails 4.x (at least 4.16) the above procedure doesn't work anymore.

    The files are now at

    INSTALL TAILS to HDD:         

    sudo gedit /usr/lib/pyth*/dist-packages/tails_installer/creator.py         

    sudo gedit /usr/lib/pyth*/dist-packages/tails_installer/gui.py         

    live.cfg's (command instead of manual edit):

    find /media/amnesia/Tails/syslinux -name "live*.cfg" | xargs sudo sed -i 's/live-media=removable/ /g'

     

    ENABLE PERSISTENCE:        

    sudo gedit /usr/local/share/perl/*/Tails/Persistence/Setup.pm        

     

    HTH

  12. Anonymous says:

    Tried this on Tails 4.19 and nothing shows up after pressing 'Configure persistent volume'. I followed the guide step by step and tried twice. Is anyone else experiencing this?

  13. User says:

    Dont have permission to edit these files on 4.26

  14. atlanticaas says:

    I tried this one becouse I would like to use my Tails in Portable Virtualbox in my USB but have problem after pressing 'Configure persistent volume' - its just shows nothing. My version of Tails iso is 4.27. Anybody would like to help me deal with this? I can pay ofcourse. My telegram @atlanticaas

  15. Frank says:

    Checked for 4.27 - compatibility and it still works if one follows above tut step-by-step.
     

    And you still could save followers the work to manually edit the "live.cfg"s and "grub.cfg"s (command instead of manual edit):

    find /media/amnesia/Tails/syslinux -name "live*.cfg" | xargs sed -i 's/live-media=removable/ /g'

    find /media/amnesia/Tails/EFI/debian/ -name "grub*.cfg" | xargs sed -i 's/live-media=removable/ /g'

     

    HTH

  16. Frank says:

    - Checked for 4.28 compatibility: Still works.

    - made a very quick and fool-proof sctipt version (which will have to be checked when new versions of Tails come out (if the line numbers still match)).
    a command to enter in terminal is printed kursiv

    1) INSTALL TAILS to HDD:
    - open Applications | System Tools | Root Terminal
    sed -i '170,178d' /usr/lib/python3/dist-packages/tails_installer/creator.py
    sed -i '456,465d' /usr/lib/python3/dist-packages/tails_installer/gui.py
    /usr/bin/python3 -tt /usr/local/bin/tails-installer -u -n --clone -P -m -x

    --> wait for installer to finish

    mkdir /media/amnesia/Tails
    chown amnesia:amnesia /media/amnesia/Tails
    mount /dev/sda1 /media/amnesia/Tails
    find /media/amnesia/Tails/syslinux -name "live*.cfg" | xargs sed -i 's/ live-media=removable//g'
    find /media/amnesia/Tails/EFI/debian/ -name "grub*.cfg" | xargs sed -i 's/ live-media=removable//g'
    init 6

     

    2) SETUP PERSISTENCE
    - open Applications | System Tools | Root Terminal
    sed -i '479,507d' /usr/local/share/perl/*/Tails/Persistence/Setup.pm
    sudo -u tails-persistence-setup /usr/bin/tails-persistence-setup

    3) UPGRADE TAILS
    - connect to Tor (necessary for upgrader to run)
    - open Applications | System Tools | Root Terminal
    sed -i '426d' /usr/local/share/perl/*/Tails/IUK/Frontend.pm
    sudo -u amnesia python3 /usr/local/bin/tails-upgrade-frontend-wrapper

        (it'll take a minute for the window to show up)
        -> do the upgrade as you would on a USB stick but DO NOT REBOOT (yet)
    find /lib/live/mount/medium -name "live*.cfg" | xargs sudo sed -i 's/live-media=removable//g'
    find /lib/live/mount/medium -name "grub*.cfg" | xargs sudo sed -i 's/ live-media=removable//g'
    init 6

     

     

    As always:
    HTH!

  17. Frank says:

    Addendum:
    3) is the automatic upgrade
    Manual upgrade is same as "1) INSTALL TAILS to HDD"

  18. Wintreist says:

    I did everything according to the instructions before creating persistent volume. then I had an error:

    Persistance wizard - Persistent volume creation

    Failed

    org.freedesktop.UDisks2.Error.Failed: Error creating partition on /dev/sdc: Failed to meet partition size on device '/dev/sdc'

     

    • Frank says:

      If you got as far as that it's a Tails issue, unfortunately I cannot help much there.
      In case you're going to ask in e.g. reddit make sure to keep the fact that you're trying to install to HDD to yourself - otherwise you won't get much help but only rants and downvotes.

    • Alex says:

      Hello! I did a fresh install of Tails to confirm and test the error you are having.

      Everything worked as expected – I can't reproduce your issue.

      I found a similar “Failed to meet partition size error during persistent volume creation” error related to Tails. Apparently, this problem occurs in certain circumstances, but it is not directly related to this guide.

  19. Fonic says:

    I found a simpler solution for VirtualBox that does not require any modifications. I posted detailed instructions here:

    https://unix.stackexchange.com/a/705313/399674

    • Alex says:

      Hello! I really like your idea to convert USB image to VDI format. But I have to point out some pitfalls. This method does not seem to allow ones to install Tails on an (internal or external) hard drive. And secondly, using the VirtualBox command line utilities on Windows is not as simple and straightforward as it is on Linux. I mean, Windows users may suffer…

      However, the idea of converting a USB image to VDI format is brilliant!

      • Fonic says:

        This method does not seem to allow ones to install Tails on an (internal or external) hard drive.

        As I said, this is a simpler solution for VirtualBox, nothing else.

        And secondly, using the VirtualBox command line utilities on Windows is not as simple and straightforward as it is on Linux

        I don't agree with that - the commands work in exactly the same way as they do on Linux, you just have to copy&paste them in a Windows terminal. If users are able to gedit source files, they are certainly able to run two commands in Windows terminal.

    • Frank says:

      Very good find, thank you!
      I agree that command line shouldn't be any hassle even for Windows users:

      "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" convertfromraw Tails-amd64-5.1.img Tails.vdi --format vdi
      "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifyhd Tails.vdi --resize 16384

      However you IMO forgot to change default boot entry (one still needs to take care to manually select the "external HDD" boot entry each boot).

      • Frank says:

        Not enough "reputation" to vote or comment on @Maxxim's answer, this is an addition (feel free to pls. integrate into your answer, Maxxim):

        Just checked it out, it's easy to edit grub.cfg from a rootshell:

            mount -o remount -w /lib/live/mount/medium/
            find /lib/live/mount/medium/EFI/debian/ -name "grub*.cfg" | xargs sed -i 's/ live-media=removable//g'
            mount -o remount -r /lib/live/mount/medium/

        Afterwards Tails starts w/o interaction.

      • Fonic says:

        However you IMO forgot to change default boot entry (one still needs to take care to manually select the "external HDD" boot entry each boot).

        I omitted that part on purpose, as I think it's best to leave Tails untouched. Any modifications have to be repeated after updates, I don't think that's a viable solution and/or worth the hassle. Manually selecting the boot entry each time is a small price to pay, in my opinion.

Leave a Reply to Alex Cancel reply

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