pixel

How to install Linux over PXE Server

Share on Social Media

Learn how to install Linux over PXE server with this comprehensive guide. Follow step-by-step instructions for setting up and deploying Linux across your network efficiently and effortlessly. #centlinux #linux #pxe

Problem Statement

In our previous posts, we have configured a PXE boot server for automated installation of RHEL 7.5 operating system that supports both BIOS and UEFI based clients. Now, we will add RHEL 6 installation option in our PXE boot server. We will also create a Kickstart file for automated installation of RHEL 6 operating system, and ensure that it will support both BIOS and UEFI based clients.

How to install Linux over PXE Server
How to install Linux over PXE Server

Linux Server Specification

We use the same Linux server that we have configured as PXE Boot Server in our previous article. These specifications have been re-mentioned below for convenience of the readers.

  • CPU – 2 Core (2.4 Mhz)
  • Memory – 2 GB
  • Storage – 50 GB
  • Operating System – RHEL 7.5
  • Hostname – pxe-server.itlab.com
  • IP Address – 192.168.116.41/24

Recommended Training: Linux Administration: The Complete Linux Bootcamp in 2025 from Andrei Dumitrescu, Crystal Mind Academy

3371848 9ea9 18

Read Also: How to install Ubuntu from PXE Server

Share Linux ISO via FTP Server

Connect to pxe-server.itlab.com using ssh.

Attach RHEL 6 ISO/DVD and mount it at /mnt/iso (you can use any mountpoint, according to your choice).

mount -t iso9660 /dev/cdrom /mnt/iso

Output:

mount: /dev/sr0 is write-protected, mounting read-only

Copy contents of /mnt/iso directory to FTP server.

cp -rf /mnt/iso /var/ftp/pub/rhel6

Create a Kickstart File for Automated Installation

We have to write a Kickstart file for RHEL 6 within the /var/ftp/pub/rhel6 directory, so it can be accessed by PXE clients via FTP service.

vi /var/ftp/pub/rhel6/rhel6.cfg

A sample kickstart file is given below, you can modify it according to your requirements.

Read Also: Automate PXE Client Installations with Kickstart

#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Install OS instead of upgrade
install
# Keyboard layouts
keyboard 'us'
# Root password
rootpw --iscrypted $1$vyNMLtgd$VmtByshddZSBK..uuFhoH0
# Use network installation
url --url="ftp://192.168.116.41/pub/rhel6"
# System language
lang en_US
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# SELinux configuration
selinux --enforcing
# Firewall configuration
firewall --enabled --ssh
# Network information
network  --bootproto=dhcp --device=eth0
# Reboot after installation
reboot
# System timezone
timezone Asia/Karachi
# System bootloader configuration
bootloader --location=mbr
autopart
# Partition clearing information
clearpart --none --initlabel
# Packages to be installed
%packages
@core
%end

Copy boot images to tftpboot directory

We need to copy initrd.img and vmlinuz files from RHEL 6 ISO to /var/lib/tftpboot/networkboot/rhel6 directory. These files will be later referenced in the menu entry of PXE boot menu.

mkdir /var/lib/tftpboot/networkboot/rhel6
cp /var/ftp/pub/rhel6/images/pxeboot/vmlinuz /var/lib/tftpboot/networkboot/rhel6/
cp /var/ftp/pub/rhel6/images/pxeboot/initrd.img /var/lib/tftpboot/networkboot/rhel6/

Create Linux Entry in PXE Menu

Edit PXE boot menu for BIOS based clients.

vi /var/lib/tftpboot/pxelinux.cfg/default

add a menu entry for RHEL 6 installation therein.

default menu.c32
prompt 0
timeout 30
menu title Ahmer's PXE Menu
label Install RHEL 7.5
kernel /networkboot/rhel7/vmlinuz
append initrd=/networkboot/rhel7/initrd.img inst.repo=ftp://192.168.116.41/pub/rhel7 ks=ftp://192.168.116.41/pub/rhel7/rhel7.cfg
label Install RHEL 6.0 (64-bit)
kernel /networkboot/rhel6/vmlinuz
append initrd=/networkboot/rhel6/initrd.img inst.repo=ftp://192.168.116.41/pub/rhel6 ks=ftp://192.168.116.41/pub/rhel6/rhel6.cfg

Edit PXE boot menu for UEFI based clients.

vi /var/lib/tftpboot/grub.cfg

add a menu entry for RHEL 6 installation therein.

set timeout=60

menuentry 'Install RHEL 7.5' {
        linuxefi /networkboot/rhel7/vmlinuz inst.repo=ftp://192.168.116.41/pub/rhel7/ inst.ks=ftp://192.168.116.41/pub/rhel7/rhel7.cfg
        initrdefi /networkboot/rhel7/initrd.img
}

menuentry 'Install RHEL 6.0' {
        linuxefi /networkboot/rhel6/vmlinuz inst.repo=ftp://192.168.116.41/pub/rhel6/ inst.ks=ftp://192.168.116.41/pub/rhel6/rhel6.cfg
        initrdefi /networkboot/rhel6/initrd.img
}

Now, connect a BIOS based PXE client to network and boot it. It will display the following PXE boot menu.

PXE Menu (BIOS)
PXE Menu (BIOS)

Similarly, connect a UEFI based PXE client to network and boot it. It will display the following PXE boot menu.

PXE Menu (UEFI)
PXE Menu (UEFI)

We have successfully added the RHEL 6 installation option to our PXE boot server. You can add other versions of RHEL or CentOS in similar manner.

Frequently Asked Questions (FAQs)

What is a PXE server, and why use it for Linux installation?
A PXE (Preboot eXecution Environment) server allows computers to boot and install an operating system over a network instead of using physical media like USB or DVD. It’s useful for installing Linux on multiple machines simultaneously without individual boot devices.

What do I need to set up a PXE server for Linux installation?
You’ll need a server (or a dedicated machine) with DHCP, TFTP, and an HTTP/FTP/NFS server to host the Linux installation files. The client machines must support PXE boot in their BIOS/UEFI settings.

Can I use any Linux distribution for PXE installation?
Most major Linux distributions (e.g., Ubuntu, CentOS, Debian) support PXE installation. Ensure the distro provides network bootable images (like netboot or pxeboot files) in its official repositories.

Do I need an internet connection for PXE installation?
Not necessarily. If the PXE server hosts all required files locally (kernel, initramfs, and OS packages), clients can install Linux without internet access. Otherwise, they may need internet to download packages during installation.

How do clients start the PXE boot process?
Enable “Network Boot” or “PXE Boot” in the client’s BIOS/UEFI settings. When the machine starts, it will fetch the boot files from the PXE server and begin the Linux installation automatically.

Final Thoughts

Installing Linux over a PXE server isn’t just a cool trick—it’s a scalable, time-saving solution for managing multiple machines efficiently. Now that you know how to configure a PXE server and deploy Linux seamlessly over the network, imagine the time you’ll save during future rollouts.

Whether you’re managing a lab, a data center, or just want to level up your sysadmin skills, this method gives you the edge. Don’t get left behind—others are already streamlining their deployments with PXE. Ready to join them? Set up your PXE server today and take control of your Linux installs like a pro!

Your Linux servers deserve expert care! I provide reliable management and optimization services tailored to your needs. Discover how I can help on Fiverr!

Looking for something?

2 responses to “How to install Linux over PXE Server”

  1. Patric Avatar

    Hi Ahmer Thanks for supporting article.
    My BIOS Boot works perfectly fine but I am unable to boot it from UEFI.. It throws error message EFI Network boot unsuccessful. (tried to fix but issue is not at VM end) I think some needful need at config end required. Much appreciate if you also address this thanks.

  2. Ahmer M Avatar

    Please discuss it with me on our Facebook page.

Leave a Reply