Questo contenuto non è disponibile nella lingua selezionata.
Chapter 24. Preparing for a Network Installation
A network installation using an installation server allows you to install Red Hat Enterprise Linux on multiple systems using a network boot server. This way, all systems configured to do so will boot using an image provided by this server and start the installation program automatically.
Note
Red Hat Satellite has the ability to automate the setup of a PXE server. See the Red Hat Satellite documentation for more information.
A minimum of two systems is required for a network installation:
- A server - a system running a DHCP server, a TFTP server to provide boot files, and an HTTP, FTP or NFS server which hosts the installation image. Theoretically, each of the servers can run on a different physical system; procedures in this section assume a single system runs all of them for simplicity.
- A client - the system which you are installing Red Hat Enterprise Linux to. When the installation begins, the client will query the DHCP server, obtain boot files from the TFTP server, and download the installation image from the HTTP, FTP or NFS server.
Unlike most other means of installation, no physical boot media is required to be plugged in the client (that is, the system you are installing into) in order to begin the installation. This chapter describes the steps you must take to prepare for network installations.
The following steps must be performed to prepare for a network installation:
- Configure the network server (
NFS
,HTTPS
,HTTP
, orFTP
) to export the installation tree or the installation ISO image. For procedures describing the configuration, see Section 3.3.3, “Installation Source on a Network”. - Configure the files on the tftp server necessary for network boot, configure
DHCP
, and start thetftp
service on the PXE server. See Section 24.1, “Configuring Network Boot Services” for details.Important
The GRUB2 boot loader supports network boot fromHTTP
in addition to a tftp server. However, obtaining boot files (the kernel and initial ram disk for the installer) over this protocol is very slow and suffers a risk of timeout failures. Using a tftp server to provide the boot files is recommended.This warning only applies to the kernel and initial ram disk (vmlinuz
andinitrd
). Obtaining the installation source from anHTTP
server does not carry this risk. - Boot the client (the system you want to install Red Hat Enterprise Linux on) and start the installation.
Note
The procedures in this chapter describe setting up a network boot server on a Red Hat Enterprise Linux 7 system. For details about configuring network boot on earlier releases of Red Hat Enterprise Linux, see the appropriate Installation Guide for that release.
24.1. Configuring Network Boot Services
After setting up a network server containing the package repositories to be used in the installation, the next step is to configure the PXE server itself. This server will contain files necessary to boot the Red Hat Enterprise Linux and start the installation. Additionally, a
DHCP
server must be configured, and all necessary services must be enabled and started.
Note
The network boot configuration procedure differs based on whether the AMD64/Intel 64 system you want to install Red Hat Enterprise Linux on uses BIOS or UEFI. Consult your hardware's documentation to see which system is used on your hardware, and then follow the appropriate procedure in this chapter.
A separate procedure is provided for booting IBM Power Systems from a network location with the GRUB2 boot loader. See Section 24.1.3, “Configuring Network Boot for IBM Power Systems Using GRUB2” for details.
For more information on configuring a network boot server for use with headless systems (systems without a directly connected display, keyboard and mouse), see Chapter 26, Headless Systems.
24.1.1. Configuring a TFTP Server for BIOS-based AMD64 and Intel 64 Clients
The following procedure will prepare the PXE server for booting BIOS-based AMD64 and Intel 64 systems. For information on UEFI-based systems, see Section 24.1.2, “Configuring a TFTP Server for UEFI-based AMD64/Intel 64 and ARM Clients”.
Procedure 24.1. Configuring a TFTP Boot Server for BIOS-based Systems
- Install the tftp-server package. To do this, enter the following command as
root
:#
yum install tftp-server
- Allow incoming connections to the
tftp
service in the firewall:#
firewall-cmd --add-service=tftp
Note
The above command only enables access until the next server reboot. To allow access permanently, add the--permanent
option. For more information about firewall configuration, see the Red Hat Enterprise Linux 7 Security Guide. - Configure your
DHCP
server to use the boot images packaged with SYSLINUX. If you do not have one installed, see the Red Hat Enterprise Linux 7 Networking Guide for instructions.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"; } } }
- You now need the
pxelinux.0
file from the SYSLINUX package in the ISO image file of the full installation DVD. To access it, enter the following commands as root:#
mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
#
cp -pr /mount_point/Packages/syslinux-version-architecture.rpm /publicly_available_directory
#
umount /mount_point
Extract the package:#
rpm2cpio syslinux-version-architecture.rpm | cpio -dimv
- Create a
pxelinux/
directory withintftpboot/
and copy thepxelinux.0
file into it:#
mkdir /var/lib/tftpboot/pxelinux
#
cp publicly_available_directory/usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/pxelinux
- Create the directory
pxelinux.cfg/
in thepxelinux/
directory:#
mkdir /var/lib/tftpboot/pxelinux/pxelinux.cfg
Add a configuration file nameddefault
to thepxelinux.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/RHEL-7.1/vmlinuz append initrd=images/RHEL-7.1/initrd.img ip=dhcp inst.repo=http://10.32.5.1/mnt/archive/RHEL-7/7.x/Server/x86_64/os/ label vesa menu label Install system with ^basic video driver kernel images/RHEL-7.1/vmlinuz append initrd=images/RHEL-7.1/initrd.img ip=dhcp inst.xdriver=vesa nomodeset inst.repo=http://10.32.5.1/mnt/archive/RHEL-7/7.x/Server/x86_64/os/ label rescue menu label ^Rescue installed system kernel images/RHEL-7.1/vmlinuz append initrd=images/RHEL-7.1/initrd.img rescue label local menu label Boot from ^local drive localboot 0xffff
Important
Theinst.repo=
Anaconda option, shown in the example above, must always be used to specify the installation program's image as well as the installation source. Without this option, the installation program will be unable to boot. For more information about boot options for Anaconda, see Section 23.1, “Configuring the Installation System at the Boot Menu”. - Create a subdirectory to store the boot image files within the
/var/lib/tftpboot/
directory, and copy the boot image files to it. In this example, we use the directory/var/lib/tftpboot/pxelinux/images/RHEL-release_number/
:#
mkdir -p /var/lib/tftpboot/pxelinux/images/RHEL-7.1/
#
cp /path_to_x86_64_images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/images/RHEL-release_number/
- Finally, start and enable the services:
- The
dhcpd
service:# systemctl start dhcpd # systemctl enable dhcpd
- The
xinetd
service, that manages the tftpd service:# systemctl start xinetd # systemctl enable xinetd
After finishing this procedure, the PXE boot server is ready to serve PXE clients. You can now start the system you want to install Red Hat Enterprise Linux on, select PXE Boot when prompted to specify a boot source, and start the network installation. For more information, see Section 7.1.2, “Booting from the Network Using PXE”.
24.1.2. Configuring a TFTP Server for UEFI-based AMD64/Intel 64 and ARM Clients
The following procedure will prepare the PXE server for booting UEFI-based AMD64/Intel 64 and ARM systems. For information on BIOS-based systems, see Section 24.1.1, “Configuring a TFTP Server for BIOS-based AMD64 and Intel 64 Clients”.
Procedure 24.2. Configuring TFTP Boot for UEFI-based Systems
Note
Red Hat Enterprise Linux 7 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
- Install the tftp-server package. To do this, enter the following command as
root
:#
yum install tftp-server
- Allow incoming connections to the
tftp
service in the firewall:#
firewall-cmd --add-service=tftp
Note
The above command only enables access until the next server reboot. To allow access permanently, add the--permanent
option. For more information about firewall configuration, see the Red Hat Enterprise Linux 7 Security Guide. - Configure your
DHCP
server to use the EFI boot images packaged with shim. If you do not have one installed, see the Red Hat Enterprise Linux 7 Networking Guide for instructions.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"; } } }
- You now need the
shim.efi
file from the shim package and thegrubx64.efi
file from the grub2-efi package in the ISO image file. To access them, enter the following commands as root:#
mount -t iso9660 /path_to_image/name_of_image.iso /mount_point -o loop,ro
#
cp -pr /mount_point/Packages/shim-version-architecture.rpm /publicly_available_directory
#
cp -pr /mount_point/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/shim.efi /var/lib/tftpboot/
#
cp publicly_available_directory/boot/efi/EFI/redhat/grubx64.efi /var/lib/tftpboot/
- Add a configuration file named
grub.cfg
to thetftpboot/
directory. A sample configuration file at/var/lib/tftpboot/grub.cfg
might look like:set timeout=60 menuentry 'RHEL 7' { linuxefi images/RHEL-7.1/vmlinuz ip=dhcp inst.repo=http://10.32.5.1/mnt/archive/RHEL-7/7.1/Server/x86_64/os/ initrdefi images/RHEL-7.1/initrd.img }
Important
Theinst.repo=
Anaconda option, shown in the example above, must always be used to specify the installation program's image as well as the installation source. Without this option, the installation program will be unable to boot. For more information about boot options for Anaconda, see Section 23.1, “Configuring the Installation System at the Boot Menu”. - Create a subdirectory to store the boot image files within the
/var/lib/tftpboot/
directory, and copy the boot image files to it. In this example, we use the directory/var/lib/tftpboot/images/RHEL-7.1/
:#
mkdir -p /var/lib/tftpboot/images/RHEL-7.1/
#
cp /path_to_x86_64_images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/images/RHEL-7.1/
- Finally, start and enable the services:
- The
dhcpd
service:# systemctl start dhcpd # systemctl enable dhcpd
- The
xinetd
service, that manages the tftpd service:# systemctl start xinetd # systemctl enable xinetd
After finishing this procedure, the PXE boot server is ready to serve PXE clients. You can now start the system you want to install Red Hat Enterprise Linux on, select PXE Boot when prompted to specify a boot source, and start the network installation. For more information, see Section 7.1.2, “Booting from the Network Using PXE”.
24.1.3. Configuring Network Boot for IBM Power Systems Using GRUB2
Procedure 24.3. Configuring a Network Boot Server for IBM Power Systems Using GRUB2
- Install the tftp-server package. To do this, enter the following command as
root
:#
yum install tftp-server
- Allow incoming connections to the
tftp
service in the firewall:#
firewall-cmd --add-service=tftp
Note
The above command only enables access until the next server reboot. To allow access permanently, add the--permanent
option. For more information about firewall configuration, see the Red Hat Enterprise Linux 7 Security Guide. - Create a GRUB2 network boot directory inside the tftp root:
#
grub2-mknetdir --net-directory=/var/lib/tftpboot
Netboot directory for powerpc-ieee1275 created. Configure your DHCP server to point to /boot/grub2/powerpc-ieee1275/core.elfNote the command's output, which informs you about which file needs to be configured as thefilename
in yourDHCP
configuration. This will become important further in the procedure. - Create a GRUB2 configuration file:
/var/lib/tftpboot/boot/grub2/grub.cfg
. Thegrub.cfg
syntax is described in the Red Hat Enterprise Linux 7 System Administrator's Guide.Below is an example configuration file:set default=0 set timeout=5 echo -e "\nWelcome to the Red Hat Enterprise Linux 7 installer!\n\n" menuentry 'Red Hat Enterprise Linux 7' { linux grub2-ppc64/vmlinuz ro ip=dhcp inst.repo=http://10.32.5.1/mnt/archive/RHEL-7/7.6-Beta/Server/ppc64/os/ initrd grub2-ppc64/initrd.img }
Important
Theinst.repo=
Anaconda option, shown in the example above, must always be used to specify the installation program's image as well as the installation source. Without this option, the installation program will be unable to boot. For more information about boot options for Anaconda, see Section 23.1, “Configuring the Installation System at the Boot Menu”. - Configure your
DHCP
server to use the boot images packaged with GRUB2. If you do not have one installed, see the Red Hat Enterprise Linux 7 Networking Guide for instructions.A sample configuration in the/etc/dhcp/dhcpd.conf
file might look like:subnet 192.168.0.1 netmask 255.255.255.0 { allow bootp; option routers 192.168.0.5; group { #BOOTP POWER clients filename "boot/grub2/powerpc-ieee1275/core.elf"; host client1 { hardware ethernet 01:23:45:67:89:ab; fixed-address 192.168.0.112; } } }
Adjust the sample parameters (subnet
,netmask
,routers
,fixed-address
andhardware ethernet
) to fit your network configuration. Also note thefilename
parameter; this is the file name which was output by thegrub2-mknetdir
command earlier in the procedure. - Finally, start and enable the services:
- The
dhcpd
service:# systemctl start dhcpd # systemctl enable dhcpd
- The
xinetd
service that manages the tftpd service:# systemctl start xinetd # systemctl enable xinetd
After finishing this procedure, the PXE boot server is ready to serve PXE clients. You can now follow the steps described in Chapter 12, Booting the Installation on IBM Power Systems to boot your Power Systems client from this server.
Additional information about setting up network boot for IBM Power Systems clients can be found in the Netbooting on POWER - An Introduction at the IBM DeveloperWorks website.