PXE Boot Installation in Linux
What is PXE Boot?
PXE (Preboot Execution Environment) allows a computer to boot from a network interface, enabling the installation of operating systems without physical media.
Steps to Set Up PXE Boot in Linux
- Install Required Packages: Install a DHCP server, TFTP server, and optionally an HTTP/FTP server.
- Configure DHCP Server: Edit the DHCP server configuration file to enable PXE boot.
- Set Up TFTP Server: Place the PXE bootloader and configuration files in the TFTP root directory.
- Prepare Bootable Files: Add the Linux kernel and initrd files to the TFTP directory.
- Restart Services: Restart the DHCP and TFTP services to apply changes.
sudo apt update
sudo apt install isc-dhcp-server tftpd-hpa
# /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;
filename "pxelinux.0";
next-server 192.168.1.10;
}
sudo cp /usr/lib/PXELINUX/pxelinux.0 /var/lib/tftpboot/
sudo mkdir -p /var/lib/tftpboot/pxelinux.cfg
sudo cp vmlinuz initrd.img /var/lib/tftpboot/
sudo systemctl restart isc-dhcp-server tftpd-hpa
Testing PXE Boot
Configure a client machine to boot from the network and verify that it loads the PXE boot menu.