PXE Boot Server for Ubuntu 22.04.5 Live Server¶
🎯 What You’ll Achieve¶
By following this guide, you will:
✅ Set up a PXE boot environment on a Linux machine using Docker
✅ Use pxelinux.0 as the bootloader to support BIOS PXE clients
✅ Serve the Ubuntu 22.04.5 Live Server ISO over HTTP using nginx
✅ Let PXE clients boot and start the manual Ubuntu installer entirely over the network
✅ Avoid the need for dnsmasq, iPXE, or autoinstall
✅ Use Fortigate as the DHCP provider to point PXE clients to the correct boot server
📁 Project Directory Structure¶
~/pxe-ipxe-server/
├── Dockerfile
├── nginx.conf
├── tftp/
│ ├── pxelinux.0
│ ├── ldlinux.c32
│ ├── vmlinuz
│ ├── initrd
│ └── pxelinux.cfg/
│ └── default
├── http/
│ └── ubuntu-22.04.5-live-server-amd64.iso
🪜 Step-by-Step Instructions¶
📥 Download Ubuntu Live Server ISO¶
cd ~/Downloads
wget https://releases.ubuntu.com/22.04/ubuntu-22.04.5-live-server-amd64.iso
🔧 Mount ISO and Extract Boot Files¶
sudo mkdir -p /mnt/ubuntu_iso
sudo mount -o loop ubuntu-22.04.5-live-server-amd64.iso /mnt/ubuntu_iso
mkdir -p ~/pxe-ipxe-server/tftp ~/pxe-ipxe-server/http
cp /mnt/ubuntu_iso/casper/vmlinuz ~/pxe-ipxe-server/tftp/
cp /mnt/ubuntu_iso/casper/initrd ~/pxe-ipxe-server/tftp/
cp ~/Downloads/ubuntu-22.04.5-live-server-amd64.iso ~/pxe-ipxe-server/http/
sudo umount /mnt/ubuntu_iso
📦 Download PXELINUX Bootloader Files¶
cd ~/pxe-ipxe-server/tftp
# Download pxelinux.0 from Ubuntu's archive
wget http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/pxelinux.0
# Copy ldlinux.c32 from local syslinux install
cp /usr/lib/syslinux/modules/bios/ldlinux.c32 .
📝 Create PXELINUX Config¶
mkdir -p ~/pxe-ipxe-server/tftp/pxelinux.cfg
vi ~/pxe-ipxe-server/tftp/pxelinux.cfg/default
pxelinux.cfg/default
DEFAULT install
LABEL install
KERNEL vmlinuz
INITRD initrd
APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp boot=casper url=http://192.168.2.19/ubuntu-22.04.5-live-server-amd64.iso ---
⚙️ Create nginx.conf¶
nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
server {
listen 80;
location / {
root /srv/http;
autoindex on;
}
}
}
🐳 Create container image¶
Dockerfile
FROM alpine:latest
RUN apk add --no-cache nginx tftp-hpa
COPY tftp /srv/tftp
COPY http /srv/http
COPY nginx.conf /etc/nginx/nginx.conf
RUN mkdir -p /run/nginx
EXPOSE 69/udp 80
CMD sh -c "nginx && in.tftpd --foreground --address :69 --secure /srv/tftp"
🧱 Build and Run Your Docker PXE Server¶
cd ~/pxe-ipxe-server
docker build -t pxe-server .
docker run --rm -it --net=host pxe-server
📡 Fortigate DHCP Configuration¶
config system dhcp server
edit <your_dhcp_pool_id>
set next-server 192.168.2.19
set filename "pxelinux.0"
next
end
✅ PXE Boot Result¶
- When you boot a PXE BIOS client:
- It gets an IP via DHCP from Fortigate
- Downloads pxelinux.0 and ldlinux.c32 via TFTP
- Loads the kernel + initrd
- Fetches the full ISO via HTTP
- Starts the manual Ubuntu installer