Operations 24 min read

How to Set Up Unattended Linux Installation with PXE, DHCP, TFTP, and Kickstart

This guide explains how to automate large‑scale Linux deployments by configuring a PXE boot environment with DHCP, TFTP, and NFS services, creating a Kickstart answer file, and troubleshooting common issues to achieve fully unattended installations.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
How to Set Up Unattended Linux Installation with PXE, DHCP, TFTP, and Kickstart

Unattended Linux Installation Overview

When an organization needs to deploy Linux on many servers, a network‑based, unattended installation using PXE boot and a Kickstart answer file can automate the process. A single installation server provides DHCP, TFTP and NFS services, and client machines boot from the network, download the bootloader and kernel, and install the OS automatically.

1. Large‑scale Deployment Scenario

Diagram of the topology (image).

2. PXE Technology

PXE (Preboot Execution Environment) is an Intel‑developed client‑server protocol that allows a client to download a boot image from a remote server via DHCP and TFTP. pxe client must support PXE and be set to network boot. pxe server must provide DHCP, TFTP and an HTTP/FTP/NFS share.

DHCP supplies IP address and the location of the TFTP server.

TFTP delivers the bootloader and kernel to the client’s memory.

The boot configuration can point to a Kickstart file for fully unattended installation.

3. Kickstart Technology

Kickstart uses an answer file to provide all installation parameters (language, keyboard, timezone, root password, partitioning, network, packages, etc.). The file can be created manually, with system-config-kickstart GUI, or generated by Anaconda.

4. Configuring the Installation Server

4.1 DHCP Service

Install and configure dhcp (example /etc/dhcp/dhcpd.conf shown).

# dhcpd.conf example
subnet 192.168.0.0 netmask 255.255.0.0 {
    interface "ens34";
    range 192.168.17.202 192.168.17.240;
    option domain-name-servers 8.8.8.8;
    option routers 192.168.17.1;
    default-lease-time 600;
    max-lease-time 7200;
    next-server 192.168.17.139;
    filename "pxelinux.0";
}

Enable and start the service.

4.2 TFTP Service

Install tftp-server and edit /etc/xinetd.d/tftp to set disable = no and define server_args = -s /var/lib/tftpboot. Place pxelinux.0, vmlinuz, initrd.img and a pxelinux.cfg/default file in /var/lib/tftpboot.

# Example pxelinux.cfg/default
default linux
timeout 600
menu title Welcome to CentOS7
label linux
  menu label ^Install CentOS 7
  kernel vmlinuz
  append initrd=initrd.img ks=nfs:192.168.17.139:/ks/ks.cfg
label rescue
  menu label ^Rescue a CentOS system
  kernel vmlinuz
  append initrd=initrd.img rescue

4.3 NFS Service

Start nfs-server and export the installation media and Kickstart directory in /etc/exports (e.g., /media 192.168.0.0/255.255.0.0(ro) and /ks 192.168.0.0/255.255.0.0(ro)).

# /etc/exports
/ks     192.168.0.0/255.255.0.0(ro)
/media  192.168.0.0/255.255.0.0(ro)

5. Example Deployment

5.1 Server Setup

Install DHCP, TFTP and NFS, create the Kickstart file with system-config-kickstart, and place it in /ks/ks.cfg. Sample Kickstart content:

#ks.cfg excerpt
install
keyboard 'us'
rootpw --iscrypted $1$2ZdAsgIv$xBtWTquTEb5prUaMEgk.G/
lang zh_CN
auth --useshadow --passalgo=sha512
graphical
firstboot --disable
selinux --enforcing
nfs --server=192.168.17.139 --dir=/media
firewall --enabled --http --ssh
network --bootproto=dhcp --device=ens33
halt
timezone Africa/Abidjan
bootloader --location=mbr --boot-drive=sda
clearpart --all --initlabel
part swap --fstype="swap" --size=1000
part /boot --fstype="ext4" --size=200
part / --fstype="ext4" --grow --size=1
%post
/usr/bin/hostname yurq
%end
%packages
@core
%end

5.2 Client Setup

Configure each client’s BIOS to boot from PXE (or use the VM’s boot menu). Ensure the client obtains an IP address from the DHCP server and can reach the TFTP and NFS shares.

6. Common Issues and Troubleshooting

Stuck in dracut – ensure initramfs includes required modules.

“No disk selected” – add explicit / and /boot partitions in the Kickstart file.

DHCP address not assigned – verify the correct network interface is specified in dhcpd.conf and the DHCP service is running.

TFTP timeout – confirm TFTP service is active and the firewall allows UDP port 69.

Missing pxelinux.0 – copy the file to /var/lib/tftpboot.

Missing kernel config – ensure pxelinux.cfg/default exists.

Kickstart file not reachable – check that the NFS/HTTP service serving ks.cfg is up.

Insufficient memory – allocate at least 2 GB to the client VM.

Topology diagram
Topology diagram
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PXENFSKickstartDHCPTFTPUnattended Installation
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.