The following is the GNU All-permissive License as recommended in https://www.gnu.org/licenses/license-recommendations.en.html

Copyright (C) 2024 Free Software Foundation sysadmin@fsf.org

Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without any warranty.

Contributions are welcome. See https://savannah.gnu.org/maintenance/fsf/.

running local virtual machines

gnome boxes could be used to run an archived backup that is stored on monolith, but it seems to reject older operating system versions. ideally we can use virsh locally, without the added risk of running it with direct access from the internet.

install

apt install virsh

prepare vm

dd if=/dev/zero of=example.img bs=4M count=5K oflag=sync status=progress  ## creates 20 GB image file
mkfs.ext4 -L example-root example.img

sudo mount -o loop ~andrew/example.img /mnt/
sudo chown andrew:andrew /mnt/

Sync over the files

sudo rsync -e "ssh -i /home/me/.ssh/id_rsa.pub" -avhSAXP monolith.office.fsf.org:/mnt/restic/medea/snapshots/latest/ /mnt/

# or, if you're using GPG-Agent for SSH:
sudo SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh rsync -avhSAXP monolith.office.fsf.org:/mnt/restic/medea/snapshots/latest/ /mnt/

sudo mkdir -p /mnt/{sys,proc,tmp,dev,run,mnt}
sudo cp /mnt/boot/{vmlinuz,initrd}* ~/

sudo umount /mnt

...

Use kernel and initrd file names according to what you copied out of the root above.

qemu-system-x86_64 -m 2048 -enable-kvm -drive format=raw,file=example.img -kernel vmlinuz-3.13.0-165-generic -initrd initrd.img-3.13.0-165-generic -append root=/dev/sda

You may need to enter maintenance mode, enter in root password from SPD, then mount -o rewrite,rw /, then edit /etc/fstab to use /dev/sda rather than the default encrypted target. Then update initramfs, copy the new initrd out, and reboot.