$_ BSDHowTo.ch
How To... Why not..? Scripts RSS logo

How to boot bsd.rd over the network

Last modified: 2018-08-27


I show you how you can boot bsd.rd over the network. OpenBSD brings along all the tools you need for this in the base system. You need only one additional box that works as the server for DHCP and TFTP.

Configuration of tftpd(8)

The first step of the configuration of tftpd(8) is to choose a directory for tftpd(8). You will copy the required files to this directory and tftpd(8) will chroot(2) to it. Create it with the following commands:

$ doas mkdir /tftpboot

As a next step copy pxeboot(8) and /bsd.rd to the new directory:

$ doas cp /usr/mdec/pxeboot /tftpboot/
$ doas cp /bsd.rd /tftpboot/

Configuration of dhcpd(8)

When you boot a system using PXE it will first grap some configuration parameters from a DHCP server. The configuration of dhcpd(8) might look similar to this:

subnet netmask {
    default-lease-time 120;
    filename "pxeboot";
    max-lease-time 120;
    option domain-name "example.net";
    option domain-name-servers,;
    option routers;
    option subnet-mask;

The entries filename "pxeboot" and next-server are the ones that pxeboot(8) requires. These contain the IP of the TFTP server to use and the file to fetch from it.

Configuration of boot(8)

The pxeboot(8) will try to load boot.conf(8) from the TFTP server. Like boot(8) it expects to find the file in the path /etc/boot.conf:

$ doas mkdir /tftpboot/etc
$ doas sh -c 'echo "boot tftp:bsd.rd" > /tftpboot/etc/boot.conf'

Of course you can add additional parameters to the file if you need to. If you install a headless box the following two entries might be required:

set tty com0
stty com0 115200

Start the required daemons

Once you are done with the configuration you must enable and start the two daemons. tftpd(8) requires the path to its directory as parameter.

$ doas rcctl enable tftpd
$ doas rcctl set tftpd flags /tftpboot
$ doas rcctl start tftpd
$ doas rcctl enable dhcpd
$ doas rcctl start dhcpd