Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 39 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ with native encryption.

This is a more automated way of following these guides:

- [Debian Bookworm Root on ZFS](https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bookworm%20Root%20on%20ZFS.html)
- [Debian (Bookworm) Root on ZFS](https://openzfs.github.io/openzfs-docs/Getting%20Started/Debian/Debian%20Bookworm%20Root%20on%20ZFS.html)
(via [OpenZFS Documentation](https://openzfs.github.io/openzfs-docs/))
- [Install Proxmox VE on Debian 12 Bookworm](https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_12_Bookworm)
- [Install Proxmox VE on Debian 13 Trixie](https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_13_Trixie)
(via [Proxmox VE official wiki](https://pve.proxmox.com/wiki))

## Opinionated
Expand All @@ -32,13 +32,24 @@ Only do the first item in the list (until _Open a terminal_).
> **Tip!**
>
> If you want to boot much faster, and get dropped into a shell immediately, you
> may want to use `debian-live-12.*-amd64-standard.iso`! Download it from the
> may want to use `debian-live-13.*-amd64-standard.iso`! Download it from the
> same place as the other ISO:
>
> [https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/](https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/)
>
> Log in as `user`, with password `live`, if asked.

Also, it might be helpful to install openssh and connect to it from another machine:
```bash
sudo apt install openssh-server
```

Make sure that the drives you want to install to are empty, as the script will only use the free (unformatted) space before and you might get errors due to lack of space:

```bash
wipefs -a /dev/disk-device
```

Instead of editing files etc. manually, launch this automated script from the
terminal:

Expand Down Expand Up @@ -68,6 +79,15 @@ sudo NON_INTERACTIVE=true \
https://raw.githubusercontent.com/hugojosefson/proxmox-root-on-encrypted-zfs/main/src/cli.ts \
debian
```
If the installation fails with an error about ZFS module not being loaded, try this first

```bash
sudo apt install -y zfs-dkms zfsutils-linux
sudo apt install linux-headers-$(uname -r)
sudo dpkg-reconfigure zfs-dkms
sudo modprobe zfs
```
and then re-run the installation script.

> If you want to inspect the chroot:
>
Expand All @@ -92,8 +112,8 @@ encryption key.
Login as `root`.

Continue manually at
[Install Proxmox VE Kernel etc](https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_12_Bookworm#Install_the_Proxmox_VE_Kernel)
in the _Install Proxmox VE on Debian 12 Bookworm_ guide.
[Install Proxmox VE Kernel etc](https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_13_Trixie#Install_the_Proxmox_VE_Kernel)
in the _Install Proxmox VE on Debian 13 Trixie_ guide.

## Opinionated: Specifics

Expand Down Expand Up @@ -198,7 +218,7 @@ Skip the rest;

### Proxmox VE

#### Install a standard Debian 12 Bookworm (amd64)
#### Install a standard Debian 13 Trixie (amd64)

##### Add an /etc/hosts entry for your IP address

Expand All @@ -220,6 +240,17 @@ Skip the rest;
leaving it up to manual installation and configuration.

See
[Install Proxmox VE Kernel](https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_12_Bookworm#Install_the_Proxmox_VE_Kernel)
and the following sections in the _Install Proxmox VE on Debian 12 Bookworm_
[Install Proxmox VE Kernel](https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_13_Trixie#Install_the_Proxmox_VE_Kernel)
and the following sections in the _Install Proxmox VE on Debian 13 Trixie
guide.

#### Additional notes about Dropbear
- use ```zfsunlock``` to get the password prompt when you login to Dropbear-initramfs
- use the user 'root'
- to generate a compatible key (run on a client computer): ```ssh-keygen -t rsa -f ~/.ssh/pve-dropbear```
- then copy the generated .pub to ``` /etc/dropbear/initramfs/authorized_keys```
- if you want dropbear to only ask for the password, add this in front of the public key in auhtorized_keys:
``` no-port-forwarding,no-agent-forwarding,command="/bin/zfsunlock" ssh-rsa ...```
- to update initramfs after updating the key, run
``` update-initramfs -u -k all ```

9 changes: 4 additions & 5 deletions src/commands/chroot-proxmox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ echo EDITOR=vim >> /etc/environment
byobu-enable

apt install -y wget
echo "deb [arch=amd64] http://download.proxmox.com/debian/pve bookworm pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/proxmox-archive-keyring.gpg] http://download.proxmox.com/debian/pve trixie pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list

cd /etc/apt/trusted.gpg.d/
wget https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg -O proxmox-release-bookworm.gpg
echo '7da6fe34168adc6e479327ba517796d4702fa2f8b4f0a9833f5ea6e6b48f6507a6da403a274fe201595edc86a84463d50383d07f64bdde2e3658108db7d6dc87 *proxmox-release-bookworm.gpg' | sha512sum --check --strict
wget https://enterprise.proxmox.com/debian/proxmox-archive-keyring-trixie.gpg -O /usr/share/keyrings/proxmox-archive-keyring.gpg
echo '136673be77aba35dcce385b28737689ad64fd785a797e57897589aed08db6e45 /usr/share/keyrings/proxmox-archive-keyring.gpg' | sha256sum --check --strict

apt update
apt full-upgrade -y
Expand All @@ -24,4 +23,4 @@ apt install -y --download-only proxmox-default-kernel proxmox-ve
);

export const chrootProxmox = Command.custom("chrootProxmox")
.withDependencies([chrootBasicSystemEnvironment]);
.withDependencies([chrootBasicSystemEnvironment]);
4 changes: 2 additions & 2 deletions src/commands/chroot-tmpfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { chrootZfsBpool } from "./chroot-zfs-bpool.ts";
export const chrootTmpfs = inChrootCommand(
"chrootTmpfs",
`
cp /usr/share/systemd/tmp.mount /etc/systemd/system/
cp /usr/lib/systemd/system/tmp.mount /etc/systemd/system/
systemctl enable tmp.mount
`,
)
.withDependencies([chrootZfsBpool]);
.withDependencies([chrootZfsBpool]);
2 changes: 1 addition & 1 deletion src/commands/debian-3-system-installation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ mkdir /mnt/run
mount -t tmpfs tmpfs /mnt/run
mkdir /mnt/run/lock

debootstrap bookworm /mnt
debootstrap trixie /mnt

mkdir /mnt/etc/zfs
cp /etc/zfs/zpool.cache /mnt/etc/zfs/
Expand Down
12 changes: 6 additions & 6 deletions src/commands/files/etc/apt/sources.list
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
deb http://deb.debian.org/debian bookworm main contrib non-free-firmware
# deb-src http://deb.debian.org/debian bookworm main contrib non-free-firmware
deb http://deb.debian.org/debian trixie main contrib non-free-firmware
# deb-src http://deb.debian.org/debian trixie main contrib non-free-firmware

deb http://deb.debian.org/debian-security bookworm-security main contrib non-free-firmware
# deb-src http://deb.debian.org/debian-security bookworm-security main contrib non-free-firmware
deb http://deb.debian.org/debian-security trixie-security main contrib non-free-firmware
# deb-src http://deb.debian.org/debian-security trixie-security main contrib non-free-firmware

deb http://deb.debian.org/debian bookworm-updates main contrib non-free-firmware
# deb-src http://deb.debian.org/debian bookworm-updates main contrib non-free-firmware
deb http://deb.debian.org/debian trixie-updates main contrib non-free-firmware
# deb-src http://deb.debian.org/debian trixie-updates main contrib non-free-firmware
2 changes: 1 addition & 1 deletion src/commands/zfs-reboot-instructions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ password for zfs:

-------------------------------------------------------------
Continue installing Proxmox VE Kernel etc, at
https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_12_Bookworm#Install_the_Proxmox_VE_Kernel
https://pve.proxmox.com/wiki/Install_Proxmox_VE_on_Debian_13_Trixie#Install_the_Proxmox_VE_Kernel
=============================================================

`);
Expand Down