Marcio Cunha

PXE Boot: How to Install Operating Systems Over the Network Without USB Drives

Learn how PXE Boot transforms operating system deployment on servers and workstations over a local network, eliminating the need for physical media.

Marcio Cunha12 min
Also available in:EspañolPortuguês
Summary
  • Network booting eliminates the need to carry USB drives and physical media to deploy operating systems across hundreds of machines.
  • Infrastructure setup requires strict harmony among network protocols like DHCP, TFTP, and NFS or HTTP servers.
  • Writing accurate bootloader configuration files demands absolute precision in file paths and kernel parameters.
  • Corporate environments achieve extreme agility in automated provisioning for both servers and client workstations.
  • Network failures or misconfigured IP options break the entire provisioning flow, requiring precise diagnostics with tools like tcpdump.

What is PXE Boot and Why It Eliminates the Need for USB Drives

Imagine you need to format and install an operating system on fifty company computers at the same time. Running from machine to machine plugging in a USB thumb drive is an exhausting, slow task highly prone to human error. This exact problem is solved by PXE Boot, a technology that allows a computer to load an operating system directly over the local network by talking straight to a central server. In practice, the acronym stands for Preboot Execution Environment, meaning an environment that executes even before the operating system kicks in on the machine.

When you turn on a computer with PXE support enabled in its motherboard, the hardware sends a silent distress call across the network asking if anyone out there is willing to provide boot instructions. This initial handshake uses fundamental network protocols, special packets traveling via broadcast to reach every corner of the local network in a split second. The great advantage is that any modern computer has this capability built right into its network chip, turning ordinary network cables into true digital installation umbilical cords.

How the Magic Happens: The Dance of Network Protocols

For a computer to boot up successfully without a hard drive or flash drive containing files, a choreographed sequence of events unfolds behind the scenes. The first step involves the DHCP protocol, which essentially acts as a hotel receptionist handing out an ID badge and a room number to the newly arrived computer. But in the case of PXE, DHCP works overtime: besides assigning an IP address, it discreetly points out where the server responsible for supplying boot files is located.

Right after receiving that coordinate, the newly powered machine contacts the TFTP server, a minimalist and extremely simple file transfer protocol used to quickly send tiny boot files. The computer downloads a small program called a bootloader, which acts as the initial master of ceremonies. This bootloader then displays an on-screen menu where the operator chooses which operating system to install, pulling the remaining heavy packages through faster protocols like HTTP or NFS.

Setting the Stage: Infrastructure Requirements and Servers

Setting up a PXE Boot lab requires some network planning to avoid conflicts and dropped packets. The most critical component is the DHCP server, which must be configured to inject special options called 'next-server' (where to fetch files) and 'filename' (which file to download first, such as the famous pxelinux.0 or grubx64.efi). Without this directional information, the machine simply powers on, tries to find a boot server, gives up, and attempts local disk initialization.

Aside from a tuned DHCP, you will need to install well-known software packages on your central machine, such as dnsmasq to lightweight centralize DHCP and TFTP, or dedicated servers like TFTP-HPA. It is vital to ensure that your internal network firewall does not block the ports used by these services, especially UDP port 69 for TFTP. A common mistake at this stage results in timeout error screens, leaving the technician clueless about whether the issue lies in the cable, the switch, or the server configuration.

Writing the Script: Configuring Menus and Boot Files

With services running, the time comes to organize the files delivered to clients across the network. Inside the root folder of your TFTP server, you need to structure organized directories containing the operating system kernel and the initial virtual disk, affectionately known in the Linux world as initrd. These files contain the basic drivers required for the OS installer to understand the hardware of the client machine.

DEFAULT menu.c32
PROMPT 0
TIMEOUT 30

MENU TITLE Central PXE Server

LABEL ubuntu22
    MENU LABEL Install Ubuntu 22.04 LTS
    KERNEL ubuntu/vmlinuz
    APPEND initrd=ubuntu/initrd.img url=http://192.168.1.100/ubuntu.iso autoinstall

The code snippet above demonstrates a classic configuration file for the PXELINUX bootloader, defining a clean and direct interactive menu. The TIMEOUT parameter ensures that if no one interacts with the machine within three seconds, a default system boots automatically. This automation is vital in large server fleets where manual intervention must be minimized as much as possible.

Modern Challenges: The Inevitable Transition from BIOS to UEFI

For decades, the universal standard for turning on computers was traditional BIOS, but modern hardware has adopted UEFI, a much more secure, fast, and complex firmware. In practice, this means your PXE Boot strategy must change drastically, because the old pxelinux.0 file simply does not work on UEFI-based motherboards. Instead, you must supply binaries compatible with the client architecture, such as grubx64.efi or ipxe.efi, ensuring full compatibility.

To bypass this headache and offer simultaneous support for legacy and modern machines on the same network, experienced administrators typically rely on iPXE. This is an advanced boot firmware that replaces the network card's native PXE and adds superpowers, such as native HTTP protocol support, embedded scripts, and encrypted HTTPS connections. With iPXE, network installation stops being a rigid monster and becomes as flexible as browsing the internet.

Conclusion and Final Thoughts on Network Provisioning

Mastering PXE Boot is a massive leap in the operational maturity of any technology infrastructure, whether in a small business or a large datacenter. Although the initial learning curve requires patience to align DHCP, TFTP, and kernel images, the return on investment in time and productivity is immeasurable. With a well-configured environment, machine fleet maintenance stops being a physical endurance marathon and becomes a clean, centralized, and fully automated process.

As we move into the era of infrastructure as code and cloud provisioning, knowing what happens behind the scenes of hardware is what separates an ordinary operator from a true systems engineer. After all, understanding how bits travel from the central server to the RAM of a freshly powered machine is grasping the very essence of distributed computing.