Preparing to install from the network using PXE
This section describes how to configure TFTP and DHCP on a PXE server to enable PXE boot and network installation.
Network install overview
A network installation allows you to install Circle Linux to a system that has access to an installation server. At a minimum, two systems are required for a network installation:
PXE Server: A system running a DHCP server, a TFTP server, and an HTTP, HTTPS, FTP, or NFS server. While 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 Circle Linux. Once installation starts, the client queries the DHCP server, receives the boot files from the 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, configure it in BIOS/UEFI or a quick boot menu. On some hardware, the option to boot from a network might be disabled, or not available. |
The workflow steps to prepare to install Circle Linux from a network using PXE are as follows:
-
Export the installation ISO image (or the installation tree) to an NFS, HTTPS, HTTP, or FTP server.
-
Configure the TFTP server and DHCP server, and start the TFTP service on the PXE server.
-
Boot the client, and start the installation.
The GRUB2 boot loader supports a network boot from HTTP in addition to a TFTP server. Sending the boot files (the kernel and initial RAM disk - vmlinuz and initrd) over this protocol might be slow and result in timeout failures. An HTTP server does not carry this risk, but it is recommended that you use a TFTP server when sending the boot files. |
Configuring a TFTP server for BIOS-based clients
This procedure describes how to 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
tftp-server
package:# yum 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. To enable permanent access, add the
--permanent
option to the command. -
Configure your DHCP server to use the boot images packaged with SYSLINUX. A sample configuration in the
/etc/dhcp/dhcpd.conf
file might look like:option space pxelinux; option pxelinux.magic code 208 = string; option pxelinux.configfile code 209 = text; option pxelinux.pathprefix code 210 = text; option pxelinux.reboottime code 211 = unsigned integer 32; option architecture-type code 93 = unsigned integer 16; subnet 10.0.0.0 netmask 255.255.255.0 { option routers 10.0.0.254; range 10.0.0.2 10.0.0.253; class "pxeclients" { match if substring (option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 10.0.0.1; if option architecture-type = 00:07 { filename "uefi/shim.efi"; } else { filename "pxelinux/pxelinux.0"; } } }
-
Access the
pxelinux.0
file from theSYSLINUX
package in the DVD1 ISO image file:# mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
# cp -pr /mount_point/BaseOS/Packages/syslinux-tftpboot-version-architecture.rpm /publicly_available_directory
# umount /mount_point
-
Extract the package:
# rpm2cpio syslinux-tftpboot-version-architecture.rpm | cpio -dimv
-
Create a
pxelinux/
directory withintftpboot/
and copy the required files, for example:pxelinux.0
libcom.c32
,ldlinux.c32
,vesamenu.c32
into it:# mkdir /var/lib/tftpboot/pxelinux
# cp publicly_available_directory/tftpboot/pxelinux.0 /var/lib/tftpboot/pxelinux
-
Create the directory
pxelinux.cfg/
in thepxelinux/
directory:# mkdir /var/lib/tftpboot/pxelinux/pxelinux.cfg
-
Add a default configuration file to the
pxelinux.cfg/
directory. A sample configuration file at/var/lib/tftpboot/pxelinux/pxelinux.cfg/default
might look like:default vesamenu.c32 prompt 1 timeout 600 display boot.msg label linux menu label ^Install system menu default kernel images/Circle Linux-8.4/vmlinuz append initrd=images/Circle Linux-8.4/initrd.img ip=dhcp inst.repo=http://10.32.5.1/Circle Linux-8.4/x86_64/iso-contents-root/ label vesa menu label Install system with ^basic video driver kernel images/Circle Linux-8.4/vmlinuz append initrd=images/Circle Linux-8.4/initrd.img ip=dhcp inst.xdriver=vesa nomodeset inst.repo=http://10.32.5.1/Circle Linux-8.4/x86_64/iso-contents-root/ label rescue menu label ^Rescue installed system kernel images/Circle Linux-8.4/vmlinuz append initrd=images/Circle Linux-8.4/initrd.img rescue 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 Circle Linux 8 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.
-
-
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, we use the directory/var/lib/tftpboot/pxelinux/images/Circle Linux-8.4/
:# mkdir -p /var/lib/tftpboot/pxelinux/images/Circle Linux-8.4/ # cp /path_to_x86_64_images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/images/Circle Linux-8.4/
-
Start and enable the
dhcpd
service:# systemctl start dhcpd # systemctl enable dhcpd
-
Start and enable the
xinetd
service that manages thetftp
service:# systemctl start xinetd # systemctl enable xinetd
The PXE boot server is now ready to serve PXE clients. You can start the client (the system to which you are installing Circle Linux), select PXE Boot when prompted to specify a boot source, and start the network installation.
Configuring a TFTP server for UEFI-based clients
This procedure describes how to 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.
Procedure
-
As root, install the
tftp-server
package:# yum 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. To enable permanent access, add the
--permanent
option to the command. -
Configure your DHCP server to use the boot images packaged with shim. A sample configuration in the
/etc/dhcp/dhcpd.conf
file might look like:option space pxelinux; option pxelinux.magic code 208 = string; option pxelinux.configfile code 209 = text; option pxelinux.pathprefix code 210 = text; option pxelinux.reboottime code 211 = unsigned integer 32; option architecture-type code 93 = unsigned integer 16; subnet 10.0.0.0 netmask 255.255.255.0 { option routers 10.0.0.254; range 10.0.0.2 10.0.0.253; class "pxeclients" { match if substring (option vendor-class-identifier, 0, 9) = "PXEClient"; next-server 10.0.0.1; if option architecture-type = 00:07 { filename "shim.efi"; } else { filename "pxelinux/pxelinux.0"; } } }
-
Access the
shim.efi
file from theshim
package, and thegrubx64.efi
file from thegrub2-efi
package in the DVD1 ISO image file:# mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
# cp -pr /mount_point/BaseOS/Packages/shim-version-architecture.rpm /publicly_available_directory
# cp -pr /mount_point/BaseOS/Packages/grub2-efi-version-architecture.rpm /publicly_available_directory
# umount /mount_point
-
Extract the packages:
# rpm2cpio shim-version-architecture.rpm | cpio -dimv
# rpm2cpio grub2-efi-version-architecture.rpm | cpio -dimv
-
Copy the EFI boot images from your boot directory.
# cp publicly_available_directory/boot/efi/EFI/redhat/shimx64.efi /var/lib/tftpboot/uefi/
# cp publicly_available_directory/boot/efi/EFI/redhat/grubx64.efi /var/lib/tftpboot/uefi
You must rename the
shimx64.efi
file toshim.efi
after it is copied. -
Add a configuration file named
grub.cfg
to thetftpboot/
directory. A sample configuration file at/var/lib/tftpboot/uefi/grub.cfg
may look like:set timeout=60 menuentry 'Circle Linux 8' { linuxefi images/Circle Linux-8.4/vmlinuz ip=dhcp inst.repo=http://10.32.5.1/Circle Linux-8.4/x86_64/iso-contents-root/ initrdefi images/Circle Linux-8.4/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 Circle Linux 8 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.
-
-
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, we use the directory/var/lib/tftpboot/images/Circle Linux-8.4/
:# mkdir -p /var/lib/tftpboot/images/Circle Linux-8.4/ # cp /path_to_x86_64_images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/images/Circle Linux-8.4/
-
Start and enable the
dhcpd
service:# systemctl start dhcpd # systemctl enable dhcpd
-
Start and enable the
xinetd
service that manages thetftp
service:# systemctl start xinetd # systemctl enable xinetd
The PXE boot server is now ready to serve PXE clients. You can start the client (the system to which you are installing Circle Linux), select PXE Boot when prompted to specify a boot source, and start the network installation.
Additional resources
-
For more information about
shim
, see the upstream documentation: Using the Shim Program.