add readme on how to create OS template

This commit is contained in:
ghe0 2024-11-09 17:04:42 +02:00
parent df817222eb
commit f86c6fb9fa
Signed by: ghe0
GPG Key ID: 451028EE56A0FBB4
3 changed files with 18 additions and 1 deletions

17
README.md Normal file

@ -0,0 +1,17 @@
You will need a working OS template to work with this project.
Easy solution create an OS template:
- mount the archlinux installation .iso in a VM
- run `pacstrap /mnt base linux openssh`
- run `ln -s /usr/lib/systemd/system/sshd.service /mnt/etc/systemd/system/multi-user.target.wants/sshd.service`
- run `fsarchiver savedir /tmp/os_template.fsa /mnt`
- download `/tmp/os_template.fsa`
- upload the `os_template.fsa` anywhere so that it can be downloaded with wget
Some notes on the above:
- base and linux are the only packages to run a VM
- you will need sshd to operate the VM, so create the symlink to make it start with the OS
- fsarchiver is very good at preserving OS data
- the initrd will dump that template to the encrypted disk
- the same procedure can be used with any distribution, but we didn't test that yet

@ -23,6 +23,7 @@ create_dirs() {
mkdir -p "${ROOT}/usr/lib"
mkdir -p "${ROOT}/dev"
mkdir -p "${ROOT}/etc"
mkdir -p "${ROOT}/mnt"
mkdir -p "${ROOT}/proc"
mkdir -p "${ROOT}/run"
mkdir -p "${ROOT}/sys"

@ -106,6 +106,5 @@ github_ssh_key() {
}
mount_root() {
mkdir /mnt
mount /dev/vda1 /mnt
}