OpenBSD Boot and Install Using PXE (Preboot Execution Environment)

How do I boot and Install OpenBSD operating system using Preboot Execution Environment (PXE)? Do I need to use an existing OpenBSD host to install OpenBSD using PXE?

Tutorial details
Difficulty level Intermediate
Root privileges Yes
Requirements Unix/Linux os with network
server with DHCPD+TFTPD.
Est. reading time N/A


Do I need to use an existing OpenBSD host to install OpenBSD using PXE?

No. You do not need to use an existing OpenBSD host. All you need is DHCP and TFTP server. You can install and configure DHCPD and TFTPD on Linux, Debian, Ubuntu, RHEL, CentOS and so on. In short, you need:

  1. DHCP Server
  2. TFTP Server
  3. PXE-capable NIC
  4. Serial console

What is PXE?

PXE is acronmy for Preboot Execution Environment. You need to use PXE to boot a server from the network, rather than from a CD/DVD or hard disk. Usually, PXE booting is done using ROMs on the NIC of the server. OpenBSD can be installed using PXE.

How does it work?

        +--------------+               +---------------+ vr0 -> PXE-capable NIC 
        | DHCP Server  |               | Target system | con0 -> Serial console 
        | TFTFD Server +---------------+---------------+
        | Debian Linux |            Step #1: Give me an IP address.
        +--------------+            Step #2: DHCP server will assing an IP address 
        eth0:                     and gives the name of a file to be 
                                             retrieved from a tftpd server.
                                    Step #3: This file (pxeboot) will boot the target system
                                             and will load and and execute a kernel called bsd/bsd.rd
                                             from tftp server.
                                    Step #4: Continue as normal and install OpenBSD on disk.


Make sure your server support booting using a PXE-boot network card.

Configure dhcpd

See how to install and configure DHCPD server under Debian Linux. Type the following command and update configuration:
# vi /etc/dhcp/dhcpd.conf
Update / configure as follows:

subnet netmask {
  ## openbsd pxe boot  file ##
  filename "pxeboot";
  ## tftpd server IP ##
  option subnet-mask;
  option broadcast-address;
  option routers;

Save and close the file.

Configure TFTPD

See how to install and configure TFTPD server under Debian Linux. First, find out TFPTD serer directory:
# grep TFTP_DIRECTORY /etc/default/tftpd-hpa
Sample outputs:


Use cd command to change a directory to /srv/tftp:
# cd /srv/tftp
Download the OpenBSD PXE boot loader from OpenBSD ftp server:
# wget
Download the install kernel called bsd.rd:
# wget
Configure a boot configuration file called etc/boot.conf:
# mkdir etc
# vi etc/boot.conf

Sample configuration:

stty com0 19200
set tty com0
boot tftp:/bsd.rd

Save and close the file.

  1. stty com0 19200 : Set console redirection using com0. The tty speed is set to 19200 baud.
  2. set tty com0 : Tty name.
  3. boot tftp:/bsd.rd : OpenBSD boot kernel name.

Start / reload DHCPD / tftpd:
# service isc-dhcp-server restart
# service tftpd-hpa restart

Configure system to boot from PXE

You will have to activate the PXE boot on your system and network card. Go to BIOS and activate PXE boot or consult your system documentation:

Fig.01: Sample pxeboot bios setting

How do I install OpenBSD via PXE

When your netboot servers are ready, you can install OpenBSD. Start the server or embedded device. You should see something similar to the following:

Fig.02: Installing OpenBSD via PXE

Note: Make sure you connect your server using a serial console client such as screen:
# screen /dev/ttyUSB0 19200,cs8

Check out related media

The following video demonstrate the OpenBSD installation using PXE boot:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 4 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
4 comments… add one
  • Philippe Petrinko Dec 12, 2012 @ 15:53

    I always appreciate your very practical topics.

    typo here: “the name of a file to be retrived”
    “the name of a file to be retri_e_ved”

    • 🐧 nixCraft Dec 12, 2012 @ 17:33

      You’re right, that was a typo. Thanks.

  • vedu Jun 18, 2013 @ 9:50

    HI ,

    I jst wanted to know what exactly is pxelinux.0 file , they say its pxe boot file , can you shed some more light into what exactly this file is ?

  • Hasse Hansson Nov 10, 2013 @ 0:03

    Just installed OpenBSD 5.4 from my laptop running Debian 7 64 bit.
    Worked like a charm. Thanx for an excellent tuturial.

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum