| name | pxe-boot |
| description | PXE network boot configuration for diskless systems. Use when setting up network boot servers, deploying operating systems over network, or creating diskless workstations. |
PXE Network Boot
Configure Preboot Execution Environment for network booting.
Server Requirements
- DHCP server (with PXE options)
- TFTP server (for boot files)
- HTTP/NFS server (for OS files, optional)
DHCP Configuration
ISC DHCP server /etc/dhcp/dhcpd.conf:
subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.200;
option routers 192.168.1.1;
option domain-name-servers 8.8.8.8;
# PXE options
next-server 192.168.1.10; # TFTP server
filename "pxelinux.0"; # Boot file (BIOS)
# filename "grubx64.efi"; # Boot file (UEFI)
}
TFTP Directory Structure
/tftpboot/
├── pxelinux.0
├── ldlinux.c32
├── menu.c32
├── vesamenu.c32
├── libutil.c32
├── libcom32.c32
├── pxelinux.cfg/
│ ├── default
│ └── 01-aa-bb-cc-dd-ee-ff # MAC-specific
└── images/
├── vmlinuz
└── initrd.img
PXELINUX Configuration
Create /tftpboot/pxelinux.cfg/default:
DEFAULT menu.c32
PROMPT 0
TIMEOUT 100
MENU TITLE PXE Boot Menu
LABEL linux
MENU LABEL Install Linux
KERNEL images/vmlinuz
INITRD images/initrd.img
APPEND ip=dhcp root=/dev/nfs nfsroot=192.168.1.10:/nfsroot
LABEL local
MENU LABEL Boot from Local Disk
LOCALBOOT 0
LABEL memtest
MENU LABEL Memory Test
KERNEL memtest86+
Copy Boot Files
# Copy PXELINUX files
cp /usr/lib/PXELINUX/pxelinux.0 /tftpboot/
cp /usr/lib/syslinux/modules/bios/*.c32 /tftpboot/
# For UEFI boot
cp /usr/lib/SYSLINUX.EFI/efi64/syslinux.efi /tftpboot/
# Or use GRUB
cp /usr/lib/grub/x86_64-efi-signed/grubnetx64.efi.signed /tftpboot/grubx64.efi
TFTP Server Setup
# Install tftpd-hpa
apt-get install tftpd-hpa
# Configure /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS=":69"
TFTP_OPTIONS="--secure"
# Start service
systemctl start tftpd-hpa
NFS Root Configuration
# /etc/exports
/nfsroot 192.168.1.0/24(ro,no_root_squash,no_subtree_check)
# Export and restart
exportfs -a
systemctl restart nfs-server
UEFI PXE with GRUB
Create /tftpboot/grub/grub.cfg:
set timeout=10
menuentry "Install Linux" {
linux images/vmlinuz ip=dhcp
initrd images/initrd.img
}