FreeBSD on Hetzner dedicated servers

The European cloud and dedicated server provider Hetzner has silently dropped support for FreeBSD. A FreeBSD rescue system is not offered anymore so users running dedicated servers with FreeBSD may run into difficulties if anything goes wrong. But luckily it is still possible to install FreeBSD using a mfsBSD image and to manage the installation from the Linux rescue system to some degree if using a root-on-ZFS installation.

If you have a fresh new server, it is quite easy to get into a FreeBSD rescue system, here are the steps:

  • boot the Linux rescue system
  • download a recent mfsBSD image (.img not .iso)
    wget https://mfsbsd.vx.sk/files/images/13/amd64/mfsbsd-13.1-RELEASE-amd64.img
  • write the image to the first drive
    • if it is a SATA or SAS drive
      dd if=mfsbsd-13.1-RELEASE-amd64.img of=/dev/sda bs=1m
    • if it is a NVMe drive
      dd if=mfsbsd-13.1-RELEASE-amd64.img of=/dev/nvme0n1 bs=1m
  • reboot the system
  • now you can login via SSH with the password “mfsroot”
    • if you want a secure password or an authorized key, you need to build your own mfsBSD image

I recommend using ZFS-on-root installs (e.g. the “zfsinstall” tool bundled in mfsBSD), so that in case of a problem you can import the zfs pool from the Linux rescue system and make changes to configuration files if necessary. The only thing that that cannot easily be installed from the Linux rescue system is the FreeBSD boot code.

If you are using a newer dedicated server that supports booting from UEFI, you can create an UEFI partition for booting and install and actually do a complete FreeBSD installation from the Linux rescue system.

More advanced users can setup grub to boot FreeBSD from ZFS, but there are many limitations to supported pool features and the user may require two ZFS pools. I personally recommend sticking to the FreeBSD boot loader.

Example minimalistic /etc/rc.conf with Hetzner-specific network configuration:

hostname="myhost"
zfs_enable="YES"
sshd_enable="YES"
ifconfig_igb0="inet A.B.C.D/32"
ifconfig_igb0_ipv6="inet6 AAAA:BBBB:CCCC:DDDD::2"
gateway_ip4="A.B.C.E"
gateway_if="igb0"
static_routes="gateway default"
route_gateway="-host $gateway_ip4 -interface $gateway_if"
route_default="default $gateway_ip4"
ipv6_defaultrouter="fe80::1%$gateway_if"

Explanations:

  • A.B.C.D is your IPv4 address
  • A.B.C.E is your IPv4 gateway
  • AAAA:BBBB:CCCC:DDDD::2 is your IPv6 address
  • igb0 is your network interface

Example minimalistic /boot/loader.conf:

zfs_load="YES"
vfs.root.mountfrom="zfs:rpool/ROOT/FreeBSD"

Posted in Uncategorized

0 thoughts on “FreeBSD on Hetzner dedicated servers

  • Hi! Thank you for that information.
    I just wanted to migrate a few hosts to Hetzner next week – now I will host them my own as I do currently. Quite bad, I liked Hetzner so far.

    Is there any official documentation about the reason they’ve done that?
    THX

    • Martin Matuška says:

      I have only unofficial information – the number of uses of the rescue system was low and the company focuses now on other projects.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>