Link

PXE boot

PXE boot with minimal resources.

Table of contents

  1. TFTP via Windows
  2. PXE Files
  3. UniFi Security Gateway

TFTP via Windows

TFTPD claims to be “the industry standard TFTP server”. It does work well when you don’t need to regularly boot a server over the network.

However, TFTP is slow. If you need to serve installation media, I suggest to use a simple Docker container:

version: "3.7"

services:

  nginx:
    image: nginx:alpine
    ports:
      - target: 80
        published: 80
        protocol: tcp
    volumes: 
    - type: bind
      read_only: true
      source: ./tftp
      target: /usr/share/nginx/html

PXE Files

For basic PXE boot you need the following inside ./tftp:

  • pxelinux.0
  • pxelinux.cfg/default
  • ldlinux.c32
  • libcom32.c32
  • libutil.c32
  • vesamenu.c32

The pxelinux.cfg folder contains plain text config files. The booting machine will search for a range of file names based on UUID, MAC, and finally default. An example:

UI vesamenu.c32
MENU RESOLUTION 768 480
MENU TITLE PXE Boot Options
TIMEOUT 50

LABEL next
	MENU LABEL Local Boot
	MENU DEFAULT
	localboot

MENU SEPARATOR

LABEL rhcos-k3s-server
    MENU LABEL RedHat CoreOS K3S Server
    KERNEL rhcos/4.2.0/x86_64-installer-kernel
    INITRD rhcos/4.2.0/x86_64-installer-initramfs.img
    APPEND mitigations=off ip=dhcp rd.neednet=1 coreos.inst=yes coreos.inst.image_url=http://192.168.111.111/rhcos/4.2.0/x86_64-metal-bios.raw.gz coreos.inst.ignition_url=http://192.168.111.111/rhcos/k3s-server.json coreos.inst.install_dev=sda

LABEL rhcos-k3s-agent
    MENU LABEL RedHat CoreOS K3S Agent
    KERNEL rhcos/4.2.0/x86_64-installer-kernel
    INITRD rhcos/4.2.0/x86_64-installer-initramfs.img
    APPEND mitigations=off ip=dhcp rd.neednet=1 coreos.inst=yes coreos.inst.image_url=http://192.168.111.111/rhcos/4.2.0/x86_64-metal-bios.raw.gz coreos.inst.ignition_url=http://192.168.111.111/rhcos/k3s-agent.json coreos.inst.install_dev=sda

In this case the TFTP server will serve the kernel and initramfs, but a HTTP server will serve the installation media.

UniFi Security Gateway

In Advanced DHCP Options set the network boot to the IP address of the TFTP server and pxelinux.0 as the file.