| Tutorial details | |
|---|---|
| Difficulty | Intermediate (rss) |
| Root privileges | Yes |
| Requirements | Unix/Linux os with network server with DHCPD+TFTPD. |
Requirements
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:
- DHCP Server
- TFTP Server
- PXE-capable NIC
- 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:192.168.1.5 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.
Configuration
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 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.20 192.168.1.50;
## openbsd pxe boot file ##
filename "pxeboot";
## tftpd server IP ##
next-server 192.168.1.5;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.5;
}
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:
TFTP_DIRECTORY="/srv/tftp"
Use cd command to change a directory to /srv/tftp:
# cd /srv/tftp
Download the OpenBSD PXE boot loader from OpenBSD ftp server:
# wget http://ftp.openbsd.org/pub/OpenBSD/5.2/i386/pxeboot
Download the install kernel called bsd.rd:
# wget http://ftp.openbsd.org/pub/OpenBSD/5.2/i386/bsd.rd
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.
Where,
- stty com0 19200 : Set console redirection using com0. The tty speed is set to 19200 baud.
- set tty com0 : Tty name.
- 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:
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:
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:
Video 01: Installing OpenBSD From The Network Using PXE
Editor's note: Stay tuned for the tutorial on how install Debian, Ubuntu, CentOS, FreeBSD and RHEL using PXE.
You should follow me on twitter here or grab rss feed to keep track of new changes.
This FAQ entry is 3 of 3 in the "Debian / Ubuntu Linux DHCP+TFTPD Netboot Server Tutorial" series. Keep reading the rest of the series:- Setup An ISC DHCP Server For Your Network
- Setup A TFTPD-HPA Trivial File Transfer Protocol Server
- Example: Install OpenBSD Using PXE















{ 2 comments… read them below or add one }
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”
You’re right, that was a typo. Thanks.