Automated Installations of Multiple RHEL Distributions using PXE Server and Kickstart

In the world of IT, efficiency is key. Whether it's managing a data center, deploying a new software update, or configuring new hardware, streamlining processes can make all the difference. One of the most important areas where this is true is in the installation and configuration of operating systems. And when it comes to deploying multiple instances of Red Hat Enterprise Linux (RHEL), there's no better solution than automated installations using PXE server and Kickstart files.

What is PXE Server?

PXE (Preboot Execution Environment) is a network protocol that allows a computer to boot from a server on the network. Essentially, it means that you can install an operating system on a computer without having to use physical installation media such as a CD or USB drive. Instead, the computer boots over the network and downloads the operating system image from a server. PXE can be used with various operating systems, including RHEL, and it can be incredibly useful for large-scale deployments where time and efficiency are critical.

PXE Boot Process Flow Client DHCP TFTP HTTP 1. IP Request 2. Boot File 3. OS Image Network Boot IP + Boot Info Kernel & Initrd Installation Files

What is Kickstart?

Kickstart is a configuration file used to automate the installation and configuration of RHEL. With Kickstart, you can specify all installation options in advance, including partitioning, package selection, and network configuration. When the installation process begins, the installer reads the Kickstart file and automatically applies the specified settings. This can be a real time-saver, especially when installing multiple instances of RHEL with the same configuration.

Setting up PXE Server

To set up a PXE server, you'll need a few things. First, you'll need a server running Linux with enough disk space to store RHEL images. You'll also need a DHCP (Dynamic Host Configuration Protocol) server to assign IP addresses to client machines. Finally, you'll need a TFTP (Trivial File Transfer Protocol) server to transfer boot files to client machines.

The first step is to install the necessary packages on your Linux server. You can do this using the following command on a RHEL-based system

yum install tftp-server syslinux httpd dhcp

Once the packages are installed, you'll need to configure the TFTP server to serve boot files. The PXE boot process uses a combination of several boot files, including pxelinux.0, menu.c32, and vesamenu.c32. These files are included in the syslinux package, which you installed earlier.

Copy these files to the TFTP server directory using the following command

cp /usr/share/syslinux/{pxelinux.0,menu.c32,vesamenu.c32} /var/lib/tftpboot/

Next, you'll need to configure the DHCP server to assign IP addresses to client machines. Edit the /etc/dhcp/dhcpd.conf file and add the following lines

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 192.168.1.1;
   filename "pxelinux.0";
}

These lines define a subnet with a range of IP addresses to be assigned to client machines. The filename option specifies the name of the boot file to be downloaded from the TFTP server.

Finally, you'll need to configure the HTTP server to serve RHEL images. Copy the contents of the RHEL DVD to the document root of the HTTP server, which is typically located at /var/www/html/.

Creating Kickstart File

Now that you have your PXE server set up, it's time to create a Kickstart file.

The Kickstart file is a simple text file that specifies installation options for RHEL. The file can be created using any text editor, and there are several examples available online to help you get started. Here's a basic example

# Kickstart file for RHEL 7

# System language
lang en_US.UTF-8

# Keyboard settings
keyboard us

# Network information
network --bootproto dhcp --hostname=myhost.example.com

# Root password
rootpw --iscrypted $6$...

# Firewall configuration
firewall --enabled --service=ssh

# Disk partitioning
autopart --type=plain

# Package selection
%packages
@^minimal
@core
chrony
vim-enhanced
%end

# Reboot after installation
reboot

This Kickstart file specifies system language, keyboard settings, network information, root password, firewall configuration, disk partitioning, package selection, and reboot options. You can customize these options to fit your specific needs.

Once you have created your Kickstart file, save it to the document root of the HTTP server, which is typically located at /var/www/html/. You can name the file anything you like, but it should have a .cfg extension. For example, you could name the file rhel7.cfg.

Booting Client Machines

To boot a client machine using PXE, you'll need to configure the BIOS to boot from the network. This option is typically located in the boot menu of the BIOS settings. Once you have selected the network boot option, the client machine will request an IP address from the DHCP server and download the boot file from the TFTP server.

Once the boot file is downloaded, the client machine will display a menu that allows you to select the RHEL version you want to install. This menu is created using the menu.c32 and vesamenu.c32 files that you copied to the TFTP server earlier. The menu options are defined in a file called pxelinux.cfg/default, which you can edit to add or remove options.

When you select the RHEL version you want to install, the installer will read the Kickstart file you created earlier and automatically apply the specified settings. This can save you a lot of time and effort, especially if you need to install multiple instances of RHEL with the same configuration.

Advantages

  • Centralized Management Single server manages all installations across the network.

  • Consistent Configuration Kickstart ensures identical setups across all machines.

  • Time Efficiency Simultaneous installation of multiple systems without physical media.

  • Reduced Human Error Automated process eliminates manual configuration mistakes.

  • Scalability Easy to deploy hundreds of systems with minimal effort.

Common Use Cases

  • Data Centers Mass deployment of server infrastructure.

  • Enterprise Networks Standardized workstation configurations.

  • Cloud Environments Automated provisioning of virtual machines.

  • Development Labs Quick setup of testing environments.

Conclusion

Automated installations of RHEL using PXE server and Kickstart files provide a powerful solution for large-scale deployments. This approach combines network booting capabilities with unattended installation, making it ideal for enterprise environments where consistency and efficiency are paramount. With proper setup, administrators can deploy dozens of identical RHEL systems simultaneously, significantly reducing deployment time and ensuring standardized configurations.

Updated on: 2026-03-17T09:01:38+05:30

842 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements