How To Setup A Linux PXE Server: The Ultimate WDS Linux Deployment Guide

How To Setup A Linux PXE Server: The Ultimate WDS Linux Deployment Guide

How To Install Plex On Linux: Setup Guide For 2026

To establish a Linux deployment system equivalent to Windows Deployment Services (WDS), systems administrators must configure an integrated Preboot Execution Environment (PXE) utilizing DHCP, TFTP, and HTTP or NFS protocols. This setup allows target bare-metal servers or virtual machines to fetch bootloaders, Linux kernels, and kickstart automation files directly over the local network. Implementing this deployment infrastructure minimizes installation overhead and guarantees highly standardized OS deployment across enterprise subnets.

Initial Setup Requirements and Network Topology Planning

Deploying a Linux-based equivalent to a Windows Deployment Services (WDS) host—often termed a WDS Linux PXE infrastructure—demands a dedicated network environment to prevent interference with existing production DHCP services. In this architecture, a centralized server acts as the provisioning hub, hosting the necessary bootstrap programs, system kernels, and installation media files. Target clients on the same broadcast domain initiate PXE boots to locate this host, request network parameters, download a bootloader, and boot the operating system installation wizard over network streams.



Essential Hardware and Network Specifications



  • Operating System Platform: A virtual machine or physical host running Ubuntu Server 22.04 LTS, Debian 12, or Rocky Linux 9 with a static IP configuration.
  • Target Hardware Compatibility: Network Interface Cards (NICs) on client machines must support PXE specification version 2.1 or higher and UEFI/Legacy BIOS network booting.
  • Networking Hardware: A managed layer-2/layer-3 switch supporting DHCP snooping exemptions or a isolated testing VLAN.
  • Required TCP/UDP Port Access: Firewall rules allowing UDP port 67 and 68 for DHCP traffic, UDP port 69 for TFTP bootloaders, and TCP port 80/443 or UDP port 2049 for HTTP/NFS installer packages.
  • Estimated Execution Window: 1 to 2 hours for full service deployment, catalog configuration, and automated client testing.
  • Infrastructure Budget: Zero cost for open-source licenses; standard physical server or cloud instance computing costs apply.

Establishing the Linux PXE Deployment Environment



Step 1: Install Required Infrastructure Services

To mimic the functionality of WDS on Linux, you must deploy a combination of lightweight network tools. Dnsmasq is an ideal service for this task, as it bundles a DHCP proxy server and a high-performance TFTP server inside a single process. Additionally, you must install an HTTP server like Apache to host the core operating system package trees, which are significantly faster to transfer via HTTP than over TFTP.

On Debian or Ubuntu-based distribution hosts, update the system repository files and install dnsmasq, syslinux, pxelinux, and apache2 by entering the system package manager install command:

sudo apt update && sudo apt install dnsmasq syslinux pxelinux apache2 -y

For Red Hat, Rocky, or AlmaLinux distributions, execute the equivalent installation routine:

sudo dnf install dnsmasq syslinux tftp-server httpd -y

Once installed, stop the services to prevent unconfigured daemons from broadcasting on the network during configuration by entering sudo systemctl stop dnsmasq.



Step 2: Configure the Dnsmasq Daemon for Network Booting

By default, dnsmasq acts as a general-purpose DHCP server. To integrate it cleanly into environments that already have an existing DHCP server (such as an active Windows Domain Controller), you can configure dnsmasq as a DHCP proxy. This setup allows your existing network infrastructure to continue leasing IP addresses, while dnsmasq solely broadcasts the TFTP bootloader location.

Open the main configuration file with a text editor:

sudo nano /etc/dnsmasq.conf

Locate or append the following configuration variables to build the PXE network matrix. Ensure you replace the network interfaces and IP ranges with your exact infrastructure values:



  • interface=eth0 (Specify the local network interface card linked to the deployment VLAN)
  • bind-interfaces (Enforce binding only to the specified interface to ensure isolated broadcasts)
  • dhcp-range=192.168.10.0,proxy (Instructs dnsmasq to operate as a proxy DHCP server on the local 192.168.10.0 network subnet)
  • pxe-service=x86PC, "Boot legacy BIOS PXE PXELINUX", pxelinux (Configures the boot file identification tag for standard legacy BIOS hardware clients)
  • pxe-service=X86-64_EFI, "Boot UEFI PXE GRUB2", bootx64.efi (Configures the network boot file mapping for modern UEFI systems)
  • enable-tftp (Enables the built-in TFTP server engine within dnsmasq)
  • tftp-root=/srv/tftp (Sets the absolute file path on the system where boot files and kernels reside)

Save the file and exit the text editor interface.



Step 3: Organize the TFTP Root Directory Tree and Copy Boot Files

The TFTP root folder requires structured organization to store legacy BIOS and UEFI boot loaders along with their configuration menus. Create the directories by entering:

sudo mkdir -p /srv/tftp/pxelinux.cfg

sudo mkdir -p /srv/tftp/ubuntu

Next, locate the Syslinux library files installed during the first step and copy the vital binary modules to the TFTP root directory. These modules provide the graphic UI menus, background tools, and underlying protocols needed to successfully load the Linux kernel.

Run the following commands to move the components to your TFTP root folder:

sudo cp /usr/lib/PXELINUX/pxelinux.0 /srv/tftp/

sudo cp /usr/lib/syslinux/modules/bios/ldlinux.c32 /srv/tftp/

sudo cp /usr/lib/syslinux/modules/bios/menu.c32 /srv/tftp/

sudo cp /usr/lib/syslinux/modules/bios/libutil.c32 /srv/tftp/

sudo cp /usr/lib/syslinux/modules/bios/vesamenu.c32 /srv/tftp/

By populating these system library files in the TFTP directory, your bootloader has access to the libraries it needs to render visual interfaces on legacy target clients.



Step 4: Construct the PXE Boot menu configuration

The client's network bootloader automatically looks for a text file inside the pxelinux.cfg folder to read boot options. Create a configuration file named default inside this subdirectory:

sudo nano /srv/tftp/pxelinux.cfg/default

Add the following configuration lines to build a dynamic boot selection interface:



  • DEFAULT menu.c32 (Tells the bootloader to load the graphic menu module instead of a text command prompt)
  • TIMEOUT 150 (Sets a fifteen-second timeout before launching the default boot item)
  • MENU TITLE Enterprise Linux Deployment Portal (Specifies the header title displayed on the client screen)
  • LABEL ubuntu-installer (Defines the selection handle for the installer)
  • MENU LABEL Install Ubuntu Server 22.04 LTS (Displays the clean text identifier to the sysadmin)
  • KERNEL ubuntu/vmlinuz (References the absolute location of the target Linux boot kernel relative to /srv/tftp/)
  • APPEND initrd=ubuntu/initrd.lz ip=dhcp connection-timeout=30 web-directory=http://192.168.10.10/ubuntu-media/ ds=nocloud-net;s=http://192.168.10.10/autoinstall/ (Defines kernel runtime parameters, pulls the compressed initrd image, and references the autoinstall files hosted on the Apache server)

Save the file and close the editor.



Step 5: Mount ISO Files and Populate HTTP Media Paths

To complete the setup, extract the operating system kernel files (vmlinuz and initrd) from your Linux distribution's ISO image and place them in your TFTP directory. Then, mount the entire ISO catalog into the Apache web directory to make all packages accessible via HTTP during installation.

Create a mounting destination and write the filesystem mappings:

sudo mkdir -p /mnt/iso

sudo mount -o loop /home/user/ubuntu-22.04-live-server-amd64.iso /mnt/iso

Copy the vital boot kernels directly into the TFTP server's directory layout:

sudo cp /mnt/iso/casper/vmlinuz /srv/tftp/ubuntu/

sudo cp /mnt/iso/casper/initrd /srv/tftp/ubuntu/

Next, create an Apache document folder for your OS media files and copy the entire mounted ISO file hierarchy there:

sudo mkdir -p /var/www/html/ubuntu-media

sudo cp -r /mnt/iso/ /var/www/html/ubuntu-media/*

Change the ownership permissions of these directories to allow the web daemon to read them:

sudo chown -R www-data:www-data /var/www/html/ubuntu-media

Finally, start and enable your core service daemons to activate your new Linux deployment server:

sudo systemctl enable --now dnsmasq apache2

Your WDS Linux configuration is now active and listening for PXE requests across the local network interface.


How to Install & Setup Kali Linux on VMware Workstation

How to Install & Setup Kali Linux on VMware Workstation

Network Port Mapping and System Configurations

This table outlines the essential ports, protocols, and configuration parameters used by a Linux PXE server during network boots.



Service Daemon Network Port and Protocol Primary Deployment Function Mandatory Configuration Directive
Dnsmasq (DHCP) Port 67 and 68 UDP Broadcasts network boot pathways and allocates dynamic IP assignments dhcp-range=192.168.10.0,proxy
Dnsmasq (TFTP) Port 69 UDP Transfers lightweight bootloader components (pxelinux.0) and kernel binaries enable-tftp and tftp-root=/srv/tftp
Apache2 (HTTP) Port 80 TCP Serves large installation packages, squashfs filesystems, and kickstart files DocumentRoot /var/www/html
NFS Kernel Server Port 2049 TCP/UDP Alternative mount utility to stream live filesystem trees directly /srv/nfs (read-only exports)

Troubleshooting Common PXE Boot and Network Failures



Target Clients Time Out waiting for DHCP Lease (No IP Address Allocated)



  • Root Cause: A firewall on your Linux host is blocking UDP traffic on ports 67 and 68, or the physical network switch is running Spanning Tree Protocol (STP) without PortFast enabled, which delays port activation.
  • Actionable Fix: Open the network communication ports on the PXE server by running sudo ufw allow 67:68/udp. On your managed enterprise switch, verify that the interfaces connected to the client machines are configured with PortFast or Edge-port parameters enabled. This allows the switch ports to transition immediately to a forwarding state without waiting for topology loops checks.


Client TFTP Transfer Fails with File Not Found Error (PXE-E32)



  • Root Cause: The boot files are named incorrectly, or they are stored outside the active TFTP root directory. This error can also happen if the system does not have permission to read the files.
  • Actionable Fix: Verify that files like pxelinux.0 are named in lowercase and placed directly inside the TFTP directory (for example, /srv/tftp/pxelinux.0). Ensure the system user running dnsmasq has read and execute permissions on all files within that directory. You can set correct permissions by running sudo chmod -R 755 /srv/tftp and setting directory ownership using sudo chown -R dnsmasq:nogroup /srv/tftp (or nobody on Red Hat platforms).


Kernel Panics During OS Initialization Stage (Unable to Find Live Root File System)



  • Root Cause: The client successfully boots the kernel via TFTP, but cannot fetch the heavier installation packages via HTTP or NFS because of an invalid URL configuration or network routing block.
  • Actionable Fix: Test HTTP server accessibility by opening a browser on another network machine and navigating to the package path (for example, http://192.168.10.10/ubuntu-media/). Check the Apache access logs at /var/log/apache2/access.log on the server. If client IP requests do not show up, correct the web server address defined in the default boot menu configuration file at /srv/tftp/pxelinux.cfg/default.

Frequently Asked Questions



How do I configure UEFI secure boot for Linux PXE network deployment?

To deploy to UEFI-enabled machines, you must use signed UEFI bootloaders. Replace the standard pxelinux.0 file with shim.efi and grubx64.efi, which are signed by Microsoft and recognized by system hardware. Adjust your DHCP proxy configuration so that client systems requesting UEFI boot files are automatically served the grub execution binary instead of the legacy pxelinux file.



Can I run a Linux deployment server on the same subnet as an active Windows DHCP server?

Yes. By running dnsmasq as a proxy DHCP server, it ignores IP address lease requests (leaving them to your Windows Server DHCP) and only responds to PXE boot options (DHCP options 66 and 67). This allows you to deploy Linux systems over the network without modifying your main Windows Server DHCP configurations.



What is the difference between PXELINUX and iPXE in a Linux deployment environment?

PXELINUX is a traditional network bootloader restricted to slow TFTP transfers. iPXE is an open-source network boot firmware that supports HTTP, HTTPS, and SAN protocols. Using iPXE allows you to load kernels and filesystems over HTTP from the start of the boot process, resulting in significantly faster installations compared to traditional TFTP.



How do I automate the Linux OS installation process once booted?

To automate installations, create an Answer File (Autoinstall/Preseed for Debian/Ubuntu, or Kickstart for Red Hat systems) and store it on your Apache server. In the boot configuration file (/srv/tftp/pxelinux.cfg/default), append this URL to your kernel arguments list. The installer will read this file during boot and automatically configure partitions, locales, accounts, and package selections without user input.

Optimize Your Corporate OS Deployments

Achieve enterprise-grade standardization by setting up automated PXE networks throughout your staging labs. Our consulting specialists design customized PXE, WDS, and Kickstart templates to help streamline bare-metal and virtual machine provisioning.


How To Setup Visual Studio Code With Anaconda - Design Talk

How To Setup Visual Studio Code With Anaconda - Design Talk

Read also: How to Install Humidifier Systems for Whole-House Comfort and Indoor Air Quality
close