Chapter 7. Preparing a PXE installation source
You must configure TFTP and DHCP on a PXE server to enable PXE boot and network installation.
7.1. Network install overview
A network installation allows you to install Red Hat Enterprise Linux to a system that has access to an installation server. At a minimum, two systems are required for a network installation:
- Server
- A system running a DHCP server, an HTTP, HTTPS, FTP, or NFS server, and in the PXE boot case, a TFTP server. Although each server can run on a different physical system, the procedures in this section assume a single system is running all servers.
- Client
- The system to which you are installing Red Hat Enterprise Linux. Once installation starts, the client queries the DHCP server, receives the boot files from the HTTP or TFTP server, and downloads the installation image from the HTTP, HTTPS, FTP or NFS server. Unlike other installation methods, the client does not require any physical boot media for the installation to start.
To boot a client from the network, enable network boot in the firmware or in a quick boot menu on the client. On some hardware, the option to boot from a network might be disabled, or not available.
The workflow steps to prepare to install Red Hat Enterprise Linux from a network by using HTTP or PXE are as follows:
Procedure
- Export the installation ISO image or the installation tree to an NFS, HTTPS, HTTP, or FTP server.
- Configure the HTTP or TFTP server and DHCP server, and start the HTTP or TFTP service on the server.
- Boot the client and start the installation.
You can choose between the following network boot protocols:
- HTTP
- Use the HTTP boot if your client UEFI supports it. HTTP boot is usually more reliable.
- PXE (TFTP)
- PXE boot is more widely supported by client systems, but sending the boot files over this protocol might be slow and result in timeout failures.
Additional resources
7.2. Configuring a TFTP server for BIOS-based clients
You must configure a TFTP server and DHCP server and start the TFTP service on the PXE server for BIOS-based AMD and Intel 64-bit systems.
Procedure
As root, install the following package.
# dnf install tftp-server
Allow incoming connections to the
tftp service
in the firewall:# firewall-cmd --add-service=tftp
This command enables temporary access until the next server reboot.
optional: To enable permanent access, add the
--permanent
option to the command.Depending on the location of the installation ISO file, you might have to allow incoming connections for HTTP or other services.
Access the
pxelinux.0
file from theSYSLINUX
package in the DVD ISO image file, where my_local_directory is the name of the directory that you create:# mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
# cp -pr /mount_point/AppStream/Packages/syslinux-tftpboot-version-architecture.rpm /my_local_directory
# umount /mount_point
Extract the package:
# rpm2cpio syslinux-tftpboot-version-architecture.rpm | cpio -dimv
Create a
pxelinux/
directory intftpboot/
and copy all the files from the directory into thepxelinux/
directory:# mkdir /var/lib/tftpboot/pxelinux
# cp /my_local_directory/tftpboot/* /var/lib/tftpboot/pxelinux
Create the directory
pxelinux.cfg/
in thepxelinux/
directory:# mkdir /var/lib/tftpboot/pxelinux/pxelinux.cfg
Create a configuration file named
default
and add it to thepxelinux.cfg/
directory as shown in the following example:default vesamenu.c32 prompt 1 timeout 600 display boot.msg label linux menu label ^Install system menu default kernel images/RHEL-10/vmlinuz append initrd=images/RHEL-10/initrd.img ip=dhcp inst.repo=http://192.168.124.2/RHEL-10/x86_64/iso-contents-root/ label vesa menu label Install system with ^basic video driver kernel images/RHEL-10/vmlinuz append initrd=images/RHEL-10/initrd.img ip=dhcp nomodeset inst.repo=http://192.168.124.2/RHEL-10/x86_64/iso-contents-root/ label rescue menu label ^Rescue installed system kernel images/RHEL-10/vmlinuz append initrd=images/RHEL-10/initrd.img inst.rescue inst.repo=http:///192.168.124.2/RHEL-8/x86_64/iso-contents-root/ label local menu label Boot from ^local drive localboot 0xffff
-
The installation program cannot boot without its runtime image. Use the
inst.stage2
boot option to specify location of the image. Alternatively, you can use theinst.repo=
option to specify the image as well as the installation source. -
The installation source location used with
inst.repo
must contain a valid.treeinfo
file. -
When you select the RHEL10 installation DVD as the installation source, the
.treeinfo
file points to the BaseOS and the AppStream repositories. You can use a singleinst.repo
option to load both repositories.
-
The installation program cannot boot without its runtime image. Use the
Create a subdirectory to store the boot image files in the
/var/lib/tftpboot/
directory, and copy the boot image files to the directory. In this example, the directory is/var/lib/tftpboot/pxelinux/images/RHEL-10/
:# mkdir -p /var/lib/tftpboot/pxelinux/images/RHEL-10/ # cp /path_to_x86_64_images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/images/RHEL-10/
Start and enable the
tftp.socket
service:# systemctl enable --now tftp.socket
The PXE boot server is now ready to serve PXE clients. You can start the client, which is the system to which you are installing Red Hat Enterprise Linux, select PXE Boot when prompted to specify a boot source, and start the network installation.
7.3. Configuring a TFTP server for UEFI-based clients
You must configure a TFTP server and DHCP server and start the TFTP service on the PXE server for UEFI-based AMD64, Intel 64, and 64-bit ARM systems.
Red Hat Enterprise Linux 10 UEFI PXE boot supports a lowercase file format for a MAC-based grub menu file. For example, the MAC address file format for grub2 is grub.cfg-01-aa-bb-cc-dd-ee-ff
Procedure
As root, install the following package.
# dnf install tftp-server
Allow incoming connections to the
tftp service
in the firewall:# firewall-cmd --add-service=tftp
This command enables temporary access until the next server reboot.
Optional: To enable permanent access, add the
--permanent
option to the command.Depending on the location of the installation ISO file, you might have to allow incoming connections for HTTP or other services.
Access the EFI boot image files from the DVD ISO image:
# mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
Copy the EFI boot images from the DVD ISO image:
# mkdir /var/lib/tftpboot/redhat # cp -r /mount_point/EFI /var/lib/tftpboot/redhat/ # umount /mount_point
Fix the permissions of the copied files:
# chmod -R 755 /var/lib/tftpboot/redhat/
Replace the content of
/var/lib/tftpboot/redhat/EFI/BOOT/grub.cfg
with the following example:set timeout=60 menuentry 'RHEL 10' { linux images/RHEL-10/vmlinuz ip=dhcp inst.repo=http://192.168.124.2/RHEL-10/x86_64/iso-contents-root/ initrd images/RHEL-10/initrd.img }
-
The installation program cannot boot without its runtime image. Use the
inst.stage2
boot option to specify location of the image. Alternatively, you can use theinst.repo=
option to specify the image as well as the installation source. -
The installation source location used with
inst.repo
must contain a valid.treeinfo
file. -
When you select the RHEL10 installation DVD as the installation source, the
.treeinfo
file points to the BaseOS and the AppStream repositories. You can use a singleinst.repo
option to load both repositories.
-
The installation program cannot boot without its runtime image. Use the
Create a subdirectory to store the boot image files in the
/var/lib/tftpboot/
directory, and copy the boot image files to the directory. In this example, the directory is/var/lib/tftpboot/images/RHEL-10/
:# mkdir -p /var/lib/tftpboot/images/RHEL-10/ # cp /path_to_x86_64_images/pxeboot/{vmlinuz,initrd.img}/var/lib/tftpboot/images/RHEL-10/
Start and enable the
tftp.socket
service:# systemctl enable --now tftp.socket
The PXE boot server is now ready to serve PXE clients. You can start the client, which is the system to which you are installing Red Hat Enterprise Linux, select PXE Boot when prompted to specify a boot source, and start the network installation.
Additional resources