Hassle Free PXE With Netboot.xyz!

What is PXE Boot?

PXE (Preboot Execution Environment) Boot, also known as PXE boot, is a method of booting a computer from a network source. It allows a device to boot up automatically using a network connection instead of a traditional local storage medium such as a hard drive or USB drive. Services such as netboot.xyz help streamline this process.

How Does It Work?
  1. A device (such as a laptop, desktop, or server) sends an Ethernet request for IP address configuration to a nearby DHCP server.
  2. The DHCP server assigns an IP address and other networking information to the device.
  3. The device then requests a boot file from a PXE-compliant network source, such as a TFTP (Trivial File Transfer Protocol) server or a NAS (Network-Attached Storage) device.
  4. The network source sends the requested boot file to the device, which executes it and boots up.
What Is It Used For?
  1. Boot management : PXE boot allows administrators to easily manage boot settings for multiple devices, making it easier to deploy images or updates across a network.
  2. Image deployment : Organizations can use PXE boot to deploy operating systems, applications, or other software updates to their devices automatically, reducing the need for manual installation.
  3. Remote desktop and thin client management : PXE boot is often used in remote desktop and thin client environments, where devices are managed centrally from a server or network source.
  4. Automated testing and quality assurance : Developers can use PXE boot to automate testing and quality assurance processes by booting devices with custom images and running automated tests.
  5. Emergency recovery and troubleshooting : In the event of a failure or hardware issue, administrators can use PXE boot to quickly recover a device by booting it from a network source

Installing Netboot

Set A Static IP

This process varies depending on what network manager your OS uses. The following instructions work for Debian 12. Google “how to set a static IP on <distro name>” and follow the relevant instructions if your distribution is not Debian.

  • Switch to root with the command su - .
  • edit your interfaces file using nano /etc/network/interfaces with the following information
  • Restart your networking service using systemctl restart networking
Installing netboot.xyz using docker

Ensure your system meets the following minimum System Requirements:

  • i686, x86_64, or aarch64 Processor
  • Bare Metal or Virtual Machine
  • A hard wired ethernet connection (WiFi networking is not supported)
  • At least 4GB of RAM is recommended

The following instructions will be based on a headless Debian 12 Bookworm install running inside a virtual machine on TrueNAS Scale 24.10.02, but should work for any bare metal installation or virtualization software as long as the host network is accessible.

Install docker and docker compose using docker’s official guide. Supported distributions are:

Platformx86_64 / amd64arm64 / aarch64arm (32-bit)ppc64les390x
CentOS
Debian
Fedora
Raspberry Pi OS (32-bit)
RHEL
SLES
Ubuntu

Create Directories and Docker Compose YAML File

The output of tree -L 2 /docker should look like this

if tree is not recognized, install it with apt update && apt install tree


Edit The Docker Compose File

Use nano /docker/netboot/docker-compose.yaml to paste the following:

Bring Up The Stack
Check That Netboot Is Running

Enter docker ps in the command prompt. The output should look like this:

Check the logs with docker logs netbootxyz .


Navigate to the Netboot Web UI

At this point the containers homepage should be accessible. Use the static IP we set earlier to access the interface on port 3000. If you set the same IP as in this guide that will be http://192.168.1.2:3000

You should see the dashboard like so:

Netboot.xyz Dashboard for PXE Boot
  1. Under the “Menus” tab you will find your boot.cfg file as well as a variety of .ipxe files you can edit.
  2. Under the local assets tab you can find a list of remote assets that you can pull to host locally.
Creating a Local Mirror

If you would like to create a local mirror, you can do so by editing the boot.cfg file in the Menus section.

Creating a custom boot.cfg file to enable a local mirror

Just select the boot.cfg file in the left menu and replace “set live_endpoint https://github.com/netbootxyz” with

Be aware that you won’t be able to boot from any environments that haven’t been downloaded.

Configuring DHCP

Some routers allow their DHCP servers to be configured to point to a server for PXE booting. The UniFi UDM Pro/SE for instance can be configured under Settings > Network > Choose Network > DHCP Service Management > Show Options where you will find “Network Boot“. Enter the Server IP and file name


Since most home routers don’t have that feature, we will set up a DHCP server on our server using isc-dhcp-server as per the official netboot.xyz docs.

Install isc-dhcp-server

To install the DHCP server under Debian and Ubuntu run:


Configuring the DHCP Server

edit the isc-dhcp-server config file with nano /etc/default/isc-dhcp-server and configure at least one of the interface variables with the name of the interface you want to run the DHCP server on. The modified section is highlighted in yellow.

Be sure to run ip a to check your interface name if you are unsure.

Open your dhcp.conf file with nano /etc/dhcp/dhcpd.conf and make the following changes:

Once the changes are saved, restart the dhcp server.

Enable the DHCP server to autostart the server after reboots

The DHCP configuration file can have the following bootfile names specified:

bootfile namedescription
netboot.xyz.kpxeLegacy DHCP boot image file, uses built-in iPXE NIC drivers
netboot.xyz-undionly.kpxeLegacy DHCP boot image file, use if you have NIC issues
netboot.xyz.efiUEFI boot image file, uses built-in UEFI NIC drivers
netboot.xyz-snp.efiUEFI w/ Simple Network Protocol, attempts to boot all net devices
netboot.xyz-snponly.efiUEFI w/ Simple Network Protocol, only boots from device chained from
netboot.xyz-arm64.efiDHCP EFI boot image file, uses built-in iPXE NIC drivers
netboot.xyz-arm64-snp.efiUEFI w/ Simple Network Protocol, attempts to boot all net devices
netboot.xyz-arm64-snponly.efiUEFI w/ Simple Network Protocol, only boots from device chained from
etboot.xyz-rpi4-snp.efiUEFI for Raspberry Pi 4, attempts to boot all net devices

Connect A Client to Netboot

To connect your client to the PXE boot server you must first set PXE boot as the 1st boot priority in your BIOS’ boot config options. This process varies between motherboard manufacturers, but in general it requires the following steps:

  1. Press F2 or DEL during boot to enter BIOS setup
  2. Go to the Boot Menu (this may also be under the Advanced Settings depending on BIOS version)
  3. Select Boot Priority (or Boot Configuration) and uncheck Boot Network Devices Last
  4. Go to Network Boot and enable UEFI PXE & iSCSI
  5. Select either Ethernet1 Boot or Ethernet2 Boot

Please refer to your motherboard’s instruction manual for more detailed instructions.

All that’s left to do now is boot and let the magic happen!

If all went according to plan you should be greeted with the following page:

image of the pxe boot main menu loaded by our DHCP server from the netboot.xyz docker container.

You can now select your distribution and iPXE will work it’s magic. Netboot will pull the required files from the internet and boot in to the OS!

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.