Skip to content

ZFS bootloader for root-on-ZFS systems with support for snapshots and native full disk encryption

License

Notifications You must be signed in to change notification settings

terem42/zfsbootmenu

 
 

Repository files navigation

ZFSBootMenu Logo

Build Check Documentation Status Latest Packaged Version(s)

ZFSBootMenu is a Linux bootloader that attempts to provide an experience similar to FreeBSD's bootloader. By taking advantage of ZFS features, it allows a user to have multiple "boot environments" (with different distributions, for example), manipulate snapshots before booting, and, for the adventurous user, even bootstrap a system installation via zfs recv.

In essence, ZFSBootMenu is a small, self-contained Linux system that knows how to find other Linux kernels and initramfs images within ZFS filesystems. When a suitable kernel and initramfs are identified (either through an automatic process or direct user selection), ZFSBootMenu launches that kernel using the kexec command.

screenshot

Remote SSH Access

This fork includes enhanced remote SSH access support for headless servers and cloud environments:

⚠️ Breaking Changes from Upstream

Change Before (upstream) After (this fork)
SSH Port 222 22 (standard SSH port)
SSH Timeout Indefinite wait 30 seconds (configurable)
Auto-launch Manual zfsbootmenu command Automatic on SSH login
Network Config ip=single-dhcp (first interface only) ip=dhcp (all interfaces)

Critical Fixes

  • RFC 3442 DHCP Fix: Fixes dracut init loop on providers like Hetzner that use classless static routes
    • Resolves integer expression expected and shift count out of range errors
    • Patched parse_option_121() function with proper argument validation

Features

  • SSH Connection Timeout: Wait for SSH login before auto-boot (default: 30 seconds)
  • Multi-NIC Support: DHCP on all interfaces by default, or specify by MAC address
  • RFC 3442 DHCP Fix: Robust handling of classless static routes (works with Hetzner and similar providers)
  • Race Condition Prevention: Console waits when SSH user is connected

Quick Start

# Build ZBM with SSH support (uses DHCP on all interfaces)
./contrib/remote-ssh-build.sh

# Or specify a specific NIC by MAC address
NET_MAC=aa:bb:cc:dd:ee:ff ./contrib/remote-ssh-build.sh

# Override SSH timeout (default 30s, 0 = indefinite)
SSH_TIMEOUT=60 ./contrib/remote-ssh-build.sh

Kernel Command Line Parameters

Parameter Description
zbm.ssh_timeout=N Wait N seconds for SSH login before auto-boot
ip=dhcp Enable DHCP on all interfaces (default)
ifname=eth0:<mac> ip=eth0:dhcp Use specific NIC by MAC address

Repacking Existing Images

Use contrib/zbm-repack.sh to add SSH keys to existing ZBM EFI or BIOS images:

sudo ./contrib/zbm-repack.sh -i vmlinuz.EFI -k ~/.ssh/authorized_keys

For more details, see:

Join us on IRC

Come chat about ZFSBootMenu in #zfsbootmenu on libera.chat

About

ZFS bootloader for root-on-ZFS systems with support for snapshots and native full disk encryption

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 89.4%
  • Perl 9.1%
  • Other 1.5%