Introduction of PXE
booting
PXE (Pre-Boot Execution Environment) booting is a technology that enables
a computer to boot from a network device, rather than a local hard drive or
other storage media. PXE booting is commonly used in enterprise environments to
automate the deployment of operating systems and software applications on a
large scale.
With PXE booting, a client computer first requests an IP address from a
DHCP (Dynamic Host Configuration Protocol) server, then requests the location
of a boot server from a TFTP (Trivial File Transfer Protocol) server. The boot
server provides the client computer with the necessary files to boot, including
the operating system, drivers, and other software.
PXE booting provides several benefits, including faster deployment and
provisioning of operating systems and applications, and reduced administrative
overhead. It also enables centralized management of operating systems and
software applications, ensuring that they are consistent and up-to-date across
all client computers.
PXE booting is commonly used in combination with other technologies,
such as containerization and virtualization, to automate the deployment and
management of software applications in large-scale environments.

System Requirements
Hardware requirements:
- RAM: 8 GB (Preferred 16)
- PROCESSOR: i5 10 gen
- SSD: 256GB
Software requirements:
VMware workstation
Centos7 iso
Editor: - vi/vim/nano
Virtual Machine
Requirement for Master Node
- RAM: 4GB
- Cores: 2
- Storage: 50GB
- OS: Centos 7 (Linux)
- Network Adapter: 2
- NAT
- Custom
Prerequisite For
Creating a PXE Cluster
Disable SELinux:
Stop & Disable
Firewall:
- systemctl stop firewalld
- systemctl disable firewalld
- systemctl status firewalld
Code
- Crate a file in any editor (vi/vim/nano) and paste all following code
- Save to [file_name].sh
- For example- pxe_boot_script.sh
- Change file permission to rwx(777)
- Execute script using command (./[file_name].sh) or ( bash [file_name].sh
- For example 1) ./pxe_boot_script.sh 2). bash pxe_boot_script.sh
- User inputs after execution: - Provide only necessary IP addresses like
- Server IP address (Master Node)
- Subnet
- Network Mask
- Starting IP Range (for DHCP pool ip)
- Ending IP Range (for DHCP pool ip)
Install all necessary
packages
- yum install -y dhcp*
syslinux xinetd tftp-server httpd
Description: - yum is a package installer, this code installs
necessary packages like: - DHCPD (for IP Address pool and
lease), SYSLINUX, XINTED TFTP-SERVER and HTTPD.
- tee /etc/dhcp/dhcpd.conf<<EOF
- #host_change=server Host ip, subnet_change=subnet, netmask_change=netmask, range_start=starting ip, range_end=ending ip,
- option domain-name "host_change";
- subnet subnet_change netmask netmask_change{
- range range_start range_end;
- option routers host_change;
- filename "pxelinux.0";
- next-server host_change;
- }
- EOF
Description: - TEE command is use stdin to stdout, (save inputs to a file), This code configure DHCP network, assigning SERVER IP, SUBNET, NETWORK MASK, POOL RANGE. All this inputs will provide by user after execution of script.
- #read ip address, subnet, netmask, and DHCP network range from user
- read -p "enter server ip: " s_ip
- read -p "enter subnet mask: " sub_ip
- read -p "enter netmask: " net_ip
- read -p "enter starting ip range:" start_ip
- read -p "enter ending ip range:" end_ip
- sed -i -e "s/host_change/${s_ip}/g" /etc/dhcp/dhcpd.conf
- sed -i -e "s/subnet_change/${sub_ip}/g" /etc/dhcp/dhcpd.conf
- sed -i -e "s/netmask_change/${net_ip}/g" /etc/dhcp/dhcpd.conf
- sed -i -e "s/range_start/${start_ip}/g" /etc/dhcp/dhcpd.conf
- sed -i -e "s/range_end/${end_ip}/g" /etc/dhcp/dhcpd.conf
- #make directory
- mkdir /var/lib/tftpboot/pxelinux.cfg
- #copy pxelinux.0 file to newly created direcoty
- cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
Description: - User provides the all IP Address and pool range,
script automatically changes the values to all the configuration files.
- #configure xinted file
- tee /etc/xinetd.d/tftp<<EOF
- #default: off
- #description: The tftp server serves files using the trivial file transfer \
- #protocol. The tftp protocol is often used to boot diskless \
- #workstations, download configuration files to network-aware printers, \
- #and to start the installation process for some operating systems.
- service tftp
- {
- socket_type = dgram
- protocol = udp
- wait = yes
- user = root
- server = /usr/sbin/in.tftpd
- server_args = -s /var/lib/tftpboot
- disable = no
- per_source = 11
- cps = 100 2
- flags = IPv4
- }
- EOF
- #create a directory and copy all boot related files
- mkdir -p /var/pxe/centos7
- mkdir -p /var/lib/tftpboot/centos7
- mount -t iso9660 -o loop /dev/cdrom /var/pxe/centos7/
- cp /var/pxe/centos7/images/pxeboot/vmlinuz /var/lib/tftpboot/centos7/
- cp /var/pxe/centos7/images/pxeboot/initrd.img /var/lib/tftpboot/centos7/
- cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/
- #configure pxelinux.cfg file
- tee /var/lib/tftpboot/pxelinux.cfg/default<<EOF
- #server_ip
- timeout 100
- default menu.c32
- menu title #######PXE BOOT MENU####
- label 1
- menu label ^1) Install centos7
- kernel centos7/vmlinuz
- append initrd=centos7/initrd.img ks=http://host_change/ks/centos7-ks.cfg method=http://host_change/centos7/ devfs=nomount
- label 2
- menu label ^2) Boot from local drive
- localboot
- EOF
- sed -i -e "s/host_change/${s_ip}/g" /var/lib/tftpboot/pxelinux.cfg/default
- #configure pxeboot.conf file
- tee /etc/httpd/conf.d/pxeboot.conf<<EOF
- #subnet_ip
- Alias /centos7 /var/pxe/centos7
- <Directory /var/pxe/centos7>
- options Indexes FollowSymlinks
- Require ip 127.0.0.1 subnet_change/24
- </Directory>
- EOF
- sed -i -e "s/subnet_change/${sub_ip}/g" /etc/httpd/conf.d/pxeboot.conf
Kickstart file
- #kickstart
- #python -c 'import crypt,getpass;print(crypt.crypt(getpass.getpass(),crypt.mksalt(crypt.METHOD_SHA512)))' > pass.txt
- mkdir /var/www/html/ks
- tee /var/www/html/ks/centos7-ks.cfg<<EOF
- #create new
- install
- # automatically proceed for each steps
- autostep
- #reboot after installing
- reboot
- #encrypt algorithm
- auth --enableshadow --passalgo=sha512
- #installation source
- url --url=http://host_change/centos7/
- # install disk
- ignoredisk --only-use=sda
- # keyboard layouts
- keyboard --vckeymap=jp106 --xlayouts='jp','us'
- # system locale
- lang en_US.UTF-8
- # network settings
- network --bootproto=dhcp --ipv6=auto --activate --hostname=localhost
- #root password you generated above
- #rootpw --iscrypted < pass.txt
- #timezone
- timezone Asia/Tokyo --isUtc --nontp
- #bootloader's settings
- bootloader --location=mbr --boot-drive=sda
- #initialize all partition tables
- zerombr
- clearpart --all --initlabel
- #partitioning
- autopart --type=lvm
- #part /boot --fstype="xfs" --ondisk=sda --size=500
- #part pv.10 --fstype="lvmpv" --ondisk=sda --size=51200
- #volgroup VolGroup --pesize=4096 pv.10
- #logvol / --fstype="xfs" --size=20480 --name=root --vgname=VolGroup
- #logvol swap --fstype="swap" --size=4096 --name=swap --vgname=VolGroup
- %packages
- @core
- %end
- EOF
- sed -i -e "s/host_change/${s_ip}/g" /var/www/html/ks/centos7-ks.cfg
Start all the services
- systemctl start xinetd
- systemctl enable xinetd
- systemctl start httpd
- systemctl enable httpd
- systemctl start dhcpd
- systemctl enable dhcpd
- systemctl start tftp
- systemctl enable tftp
Screenshots of output
User provides IP
Addresses
DHCP file created after execution
pxelinux.cfg
pxeboot.conf file

xinted file
Kickstart File

for full script please click here
Recent Articles
KB 626274 - Re-Activating Windows 11 Pro After a Motherboard Replacement
Overview After a motherboard replacement, Windows may show a message such as "Windows is not activated" because it no longer recognizes your computer's hardware. You can usually fix this yourself in 10 to 30 minutes by following the steps below. Your ...
KB 503990 - Architectural Difference Between NVIDIA HGX and DGX
Architectural Difference Between NVIDIA HGX and DGX KB Article – Web Publication Overview NVIDIA HGX and DGX are both high-performance AI computing platforms built around multi-GPU NVIDIA accelerators, NVLink/NVSwitch technology, and high-speed ...
KB 148090 - Install an OS remotely via ASUS IPMI's KVM
Here's how to install an OS remotely via ASUS IPMI's KVM (Java or HTML5-based remote console): 1. Access the BMC web interface. Connect to the ASUS IPMI/ASMB management LAN port (separate from the server's normal NICs). Browse to ...
KB 114035 - Zotac RMA Process
ZOTAC RMA PROCESS Overview This plan outlines the overall operational support process for ZOTAC hardware supported by Mbuzz, covering warranty validation, technical diagnosis, RMA coordination, replacement and return handling, SLA management, ...
Download Log from ASUSTOR NAS
How to download Log from NAS Purpose: This article will helps support team to guide customer to download Log to share the evidence for component failure. Problem: Customer reports for Storage device not detected. Storage failure. / Storage not ...
Popular Articles
CP Plus Camera and NVR Configuration
NVR Configuration The CP Plus Pro Series of NVRs have been meticulously designed for providing you with upgraded performance and higher recording quality in your IP video surveillance solution. The robust processor that has been inculcated in this ...
KB 775235 - Kerberos Authentication – Overview
What is Kerberos? Kerberos is a secure authentication method used in our Active Directory (AD) environment (mbuzztech.com). It allows users to: Access multiple systems without re-entering passwords (Single Sign-On – SSO) Log in once Where We Use It ...
KB 935001 - AMD Ryzen AM4 Motherboard CPU Compatibility
For the AM4 Platform, AMD has been very generous when it comes to motherboard compatibility. A CPU launched in 2022, like the Ryzen 7 5800X3D, will work with an almost 6-year-old motherboard, like the ASRock X370 Pro, which was launched in early ...
KB 532001 - Ubuntu Server 22.04 Installation Hangs on ASUS WRX80e-SAGE Series
During the installation of Ubuntu Server 22.04 on ASUS WRX80E-SAGE series motherboards, the installation process hangs during the boot phase. The issue is associated with USB disk recognition errors, particularly with devices managed by the XHCI ...
KB 686001 - ASUS Server Stress Testing Guide for INTEL and AMD Platforms
Creating a Bootable USB with Asus Test Tool Step 1: Download Required Files Download Asus Linux Image: Save the Linux image file provided by Asus. Download Memtest Tool: Open a browser, search for "Memtest," and download the free version from the ...