Setting Up an Installation Server

This appendix is intended for users with previous Linux experience. If you are a new user, you may want to install using minimal boot media or the distribution DVD instead.

PXE Installation Overview

Preboot Execution Environment, or PXE, is a techonology that allows computers to boot directly from resources provided over the network. Installing Fedora over the network means you don’t have to create media, and you can install to multiple computers or virtual machine simultaneously. The process involves a number of components and features working together to provide the resources required.

PXE-capable computer

Most modern computers have the capability to network boot. Typically, a function key pressed during boot will bring up a boot selection menu. In environments designed for unattended administration, systems will often be configured to first attempt booting from the network, then boot from local storage, and the installation server is configured to only offer the installation when required. Your computer’s manual will provide specific instructions on setting boot priorities.

DHCP Server

When a system requests an address during network booting, the DHCP server also provides the location of files to boot. A network should have only one DHCP server.

TFTP Server

Because the pre-boot environment is very simple, files must be provided in a very simple way. Trivial File Transfer Protocol, or TFTP, provides the system with the bootloader required to continue the installation process.

Bootloader

Because the job of booting an operating system is too complex for the pre-boot environment, a bootloader is used to load the kernel and related files. It also provides configuration information to the installer, and can offer a menu to select from different configurations.

Kernel and Initramfs

The kernel is the core of any Linux operating system, and the initramfs provides the kernel with required tools and resources. These files are also provided by tftp.

Package repository

A Fedora repository must be available for the installation. The example in this section uses the public Fedora mirrors as the repository source, but you can also use a repo on the local network provided by NFS, FTP, or HTTP. Repositories can be configured using the inst.repo= boot option; see Specifying the Installation Source for details.

DHCP Server Configuration

Installing and configuring dhcpd

  1. Install the dhcp server package.

    1. # dnf install dhcp
  2. Create a simple configuration for the dhcp server at /etc/dhcp/dhcpd.conf

    1. subnet 192.168.1.0 netmask 255.255.255.0 {
    2. authoritative;
    3. default-lease-time 600;
    4. max-lease-time 7200;
    5. ddns-update-style none;
    6. option domain-name-servers 192.168.1.1;
    7. option routers 192.168.1.1;
    8. }
  3. Test your configuration and address any problems you discover.

    1. systemctl start dhcpd
    2. journalctl --unit dhcpd --since -2m --follow
  4. Add entries to point clients to their bootloader and the server that provides it to your subnet configuration in /etc/dhcp/dhcpd.conf. Because DHCP clients provide the server with identifying information along with their address request, BIOS clients and UEFI clients can each be directed to the correct bootloader.

    1. # refer to RFC4578 for possible arch option values
    2. option arch code 93 = unsigned integer 16;
    3. subnet 192.168.1.0 netmask 255.255.255.0 {
    4. if option arch = 00:07 {
    5. filename "uefi/shimx64.efi";
    6. } else {
    7. filename "pxelinux.0";
    8. }
    9. next-server 192.168.1.2;
    10. ...
  5. Restart the dhcp service to check the configuration and make changes as needed.

    1. systemctl restart dhcpd
    2. journalctl --unit dhcpd --since -2m --follow

Installing the tftp server

Installing the tftp server

  1. Install the tftp server package.

    1. # dnf install tftp-server
  2. Start and enable the tftp socket. systemd will automatically start the tftpd service when required.

    1. # systemctl start tftp.socket
    2. # systemctl enable tftp.socket

Providing and configuring bootloaders for PXE clients

Getting the bootloader files

  1. Get the syslinux bootloader for BIOS clients.

    1. Install the syslinux package.

      1. # dnf install syslinux
    2. Create a directory for the bootloader files, and make them available there.

      1. # mkdir -p /var/lib/tftpboot/pxelinux.cfg
      2. # cp /usr/share/syslinux/{pxelinux.0,menu.c32,vesamenu.c32,ldlinux.c32,libcom32.c32,libutil.c32} /var/lib/tftpboot/
  2. Get the bootloader files for UEFI systems

    1. Install the shim-x64 and grub2-efi-x64 packages. If your server is a BIOS system, you must install the packages to a temporary install root. Installing them directly on a BIOS machine will attempt to configure the system for UEFI booting and cause problems.

      1. # dnf install shim-x64 grub2-efi-x64 --installroot=/tmp/fedora --releasever 34
    2. Create a directory for the bootloader files, and make them available there.

      1. # mkdir -p /var/lib/tftpboot/uefi
      2. # cp /tmp/fedora/boot/efi/EFI/fedora/{shimx64.efi,grubx64.efi} /var/lib/tftpboot/uefi/

Configuring client bootloaders

  1. Create a boot menu for BIOS clients at /var/lib/tftpboot/pxelinux.cfg/default.

    1. default vesamenu.c32
    2. prompt 1
    3. timeout 600
    4. label local
    5. menu label Boot from ^local drive
    6. menu default
    7. localboot 0xffff
    8. label linux
    9. menu label ^Install Fedora 34 64-bit
    10. kernel f34/vmlinuz
    11. append initrd=f34/initrd.img inst.stage2=https://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/x86_64/os/ ip=dhcp
    12. label server
    13. menu label ^Install Fedora 34 ( Minimal Image )
    14. kernel f34/vmlinuz
    15. append initrd=f34/initrd.img inst.stage2=https://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/x86_64/os/ ip=dhcp ks=https://example.com/fedora/kickstarts/minimal.ks
  2. Create a boot menu for UEFI clients at /var/lib/tftpboot/uefi/grub.cfg.

    1. function load_video {
    2. insmod efi_gop
    3. insmod efi_uga
    4. insmod video_bochs
    5. insmod video_cirrus
    6. insmod all_video
    7. }
    8. load_video
    9. set gfxpayload=keep
    10. insmod gzio
    11. menuentry 'Exit this grub' {
    12. exit
    13. }
    14. menuentry 'Install Fedora 64-bit' --class fedora --class gnu-linux --class gnu --class os {
    15. linuxefi f34/vmlinuz ip=dhcp inst.repo=https://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/x86_64/os/
    16. initrdefi f34/initrd.img
    17. }
    18. menuentry 'Install Fedora 34 Server' --class fedora --class gnu-linux --class gnu --class os {
    19. kernel f34/vmlinuz
    20. append initrd=f34/initrd.img inst.repo=https://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/x86_64/os/ ip=dhcp ks=https://git.fedorahosted.org/cgit/spin-kickstarts.git/plain/fedora-install-server.ks?h=f21
    21. }

Getting the kernel and initrd

Downloading the kernel and initrd

  1. Create a directory for the files.

    1. # mkdir -p /var/lib/tftpboot/f34
  2. Download the kernel.

    1. # wget https://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/x86_64/os/images/pxeboot/vmlinuz -O /var/lib/tftpboot/f34/vmlinuz
  3. Download the initrd

    1. # wget https://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/x86_64/os/images/pxeboot/initrd.img -O /var/lib/tftpboot/f34/initrd.img

Providing repositories

The examples in this section use the public Fedora mirrors as the package source. For faster installations, installing to many systems, or more isolated environments, you may wish to maintain a local repository.

Fedora Infrastructure maintains instructions for configuring a local mirror at https://fedoraproject.org/wiki/Infrastructure/Mirroring. The preferred method for providing repositories is via HTTP, and you can refer to the Fedora System Administrator’s Guide, available at https://docs.fedoraproject.org/, to configure httpd.

Advanced network installations with Cobbler

For more complex environments, Fedora offers the cobbler installation server. Tasks like managing kickstart configurations, coordinating repositories, maintaining dns records, dhcp servers, and even puppet manifests are effectively automated by cobbler.

While levaraging all of the features provided by cobbler can be relatively simple, the full functionality of this powerful tool is too broad to be documented in this guide. The cobbler community provides documentation at https://cobbler.github.io/ to accompany the packages in the Fedora repository.

Alternatively, you may also be interested in Foreman. You can find official documentation as well as downloads on the project website at https://www.theforeman.org/.