Link

PXE boot

PXE boot with minimal resources.

Table of contents

  1. TFTP via Windows
  2. TFTP via MacOS
  3. UniFi Security Gateway
  4. PXE Files
  5. Installation media over HTTP

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.

TFTP via MacOS

MacOS has a built-in TFTP server. The TFTP Server app is the easiest tool to configure it, and it works similar to TFTPD above.

UniFi Security Gateway

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

PXE Files

For basic PXE boot you need the following files inside /pxe (get them from syslinux-tftpboot):

  • 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 BIOS UUID, NIC 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 fcos-server
    MENU LABEL Fedora CoreOS Server
    KERNEL fcos/31.20200407.3.0/live-kernel-x86_64
    INITRD fcos/31.20200407.3.0/live-initramfs.x86_64.img
    APPEND mitigations=off ip=dhcp rd.neednet=1 console=tty0 coreos.inst.install_dev=/dev/sda coreos.inst.stream=stable coreos.inst.ignition_url=http://192.168.111.111/fcos/ignition-server.json coreos.inst.image_url=http://192.168.111.111/fcos/31.20200407.3.0/metal.x86_64.raw.xz

LABEL fcos-agent
    MENU LABEL Fedora CoreOS Agent
    KERNEL fcos/31.20200407.3.0/live-kernel-x86_64
    INITRD fcos/31.20200407.3.0/live-initramfs.x86_64.img
    APPEND mitigations=off ip=dhcp rd.neednet=1 console=tty0 coreos.inst.install_dev=/dev/sda coreos.inst.stream=stable coreos.inst.ignition_url=http://192.168.111.111/fcos/ignition-agents.json coreos.inst.image_url=http://192.168.111.111/fcos/31.20200407.3.0/metal.x86_64.raw.xz

Installation media over HTTP

In the above config the kernel and initramfs are served over TFTP, but a HTTP server serves the installation media. This is because TFTP boot is slow; the installation media might take 5 minutes to load over TFTP. Instead, the installation media is served over HTTP with 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: /pxe
      target: /usr/share/nginx/html