RSSAmplifier

My Sysadmin Cheatsheet · Mar 12, 2020

Boot Tails from USB Drive in VirtualBox on macOS

0
Sign in to vote or save

docs.j7k6.org

13 Mar 2020


Booting a Tails USB drive in a VirtualBox VM is rather complicated because VirtualBox is not able to boot from an USB drive directly. The workaround consists of using VirtualBox’ raw hard disk access and modifying the Tails boot command.

VirtualBox VM

  1. Download the Tails VM ISO.
  2. Create a new VM in VirtualBox:
    • Type: Linux
    • Version: Debian (64-bit)
    • Do not add a virtual hard disk
  3. Edit VM settings:
    • PortsUSBEnable USB 3.0
    • Storage → Attach Tails ISO
  4. Start VM & Boot Tails ISO.
  5. Attach USB drive to VM (DevicesUSB → …).

Tails Installation

Install Tails by cloning it to the connected USB drive (ApplicationsTailsTails InstallerClone the current Tails).

Later, the Tails USB drive will be used in raw hard disk access mode. It will be connected as a hard disk to the virtual SATA controller. Booting from a hard disk is not intended by Tails, so it will fail to start.

The solution for this is modifying the boot command. The boot command can either be changed temporarily at boot time or permanently by writing the modification to the Tails USB drive boot partition.

Boot Command Workaround

Permanently

  1. Open Terminal after finishing the Tails cloning process.
  2. Run:
    sudo mount /dev/sda1 /mnt
    sudo sed -i 's/live-media=removable //g' /mnt/syslinux/live*.cfg
    sudo umount /dev/sda1
    

Temporary

  1. Boot VM.
  2. Press TAB.
  3. Remove live-media=removable from the boot command.
  4. Continue booting.

Raw Hard Disk Access

The USB drive needs to be made available in raw disk access mode on the macOS host:

  1. List available disks (e.g. /dev/disk2):
    sudo diskutil list
    
  2. Unmount USB disk:
    sudo diskutil unmountDisk /dev/disk2
    
  3. Own disk device:
    sudo chown <$USERNAME> /dev/disk2
    
  4. Create raw disk:
    VBoxManage internalcommands createrawvmdk -filename ~/VirtualBox\ VMs/tails/usb.vmdk -rawdisk /dev/disk2
    

Boot Tails from USB Drive

  1. Attach usb.vmdk to VM’s virtual SATA controller.
  2. Detach Tails ISO.
  3. Start VM.
  4. Boot Tails.
  5. At the welcome screen set an Administrator Password (Additional Settings+).
  6. Start Tails.

Encrypted Persistence

To enable the encrypted persistant volume, another workaround needs to be applied because Tails won’t enable the encrypted persistence on a “hard disk”.

  1. Edit /usr/share/perl5/Tails/Persistence/Setup.pm.
  2. Find & delete the foreach my $check (@checks) { loop block.
  3. ApplicationsTailsConfigure persistent volume.

  1. https://www.virtualbox.org/manual/ch09.html#rawdisk
  2. https://www.reddit.com/r/tailswiki/wiki/index/internal-hd-install
  3. https://www.reddit.com/r/tails/comments/9u371g/how_to_install_tails_3_to_hdd_fixed_drive/

Read the original on docs.j7k6.org

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.