Documentation for a newer release is available. View Latest

Einrichten eines Installationsservers

Dieser Anhang richtet sich an Benutzer mit Linux-Erfahrung. Wenn Sie ein neuer Benutzer sind, sollten Sie möglicherweise stattdessen ein minimales Bootmedium oder die Distributions-DVD verwenden.

Übersicht über die PXE-Installation

Preboot Execution Environment, oder PXE, ist eine Technologie, die es Computern ermöglicht, direkt von Ressourcen zu booten, die über das Netzwerk bereitgestellt werden. Die Installation von Fedora über das Netzwerk bedeutet, dass Sie keine Medien erstellen müssen und dass Sie auf mehreren Computern oder virtuellen Maschinen gleichzeitig installieren können. Der Prozess umfasst eine Reihe von Komponenten und Funktionen, die zusammenarbeiten, um die erforderlichen Ressourcen bereitzustellen.

PXE-fähiger Computer

Die meisten modernen Computer verfügen über die Fähigkeit, über das Netzwerk zu booten. Normalerweise wird durch Drücken einer Funktionstaste während des Bootens ein Boot-Auswahlmenü angezeigt. In Umgebungen, die für eine unbeaufsichtigte Administration ausgelegt sind, werden die Systeme oft so konfiguriert, dass sie zuerst versuchen, vom Netzwerk zu booten, und dann vom lokalen Speicher booten. Im Handbuch Ihres Computers finden Sie spezifische Anweisungen zum Einstellen der Boot-Prioritäten.

DHCP-Server

Wenn ein System beim Booten im Netzwerk eine Adresse anfordert, gibt der DHCP-Server auch den Speicherort der zu bootenden Dateien an. Ein Netzwerk sollte nur einen DHCP-Server haben.

TFTP-Server

Da die Pre-Boot-Umgebung sehr einfach ist, müssen die Dateien auf eine sehr einfache Weise bereitgestellt werden. Das Trivial File Transfer Protocol, kurz TFTP, stellt dem System den Bootloader zur Verfügung, der für die Fortsetzung des Installationsvorgangs erforderlich ist.

Bootloader

Da die Aufgabe, ein Betriebssystem zu booten, zu komplex für die Pre-Boot-Umgebung ist, wird ein Bootloader zum Laden des Kernels und der zugehörigen Dateien verwendet. Er stellt dem Installationsprogramm auch Konfigurationsinformationen zur Verfügung und kann ein Menü zur Auswahl aus verschiedenen Konfigurationen anbieten.

Kernel und Initramfs

Der Kernel ist der Kern jedes Linux-Betriebssystems, und initramfs versorgt den Kernel mit den erforderlichen Tools und Ressourcen. Diese Dateien werden auch von tftp bereitgestellt.

Paket-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-Serverkonfiguration

dhcpd installieren und konfigurieren
  1. Installieren Sie das DHCP-Serverpaket.

    # dnf install dhcp
  2. Erstellen Sie eine einfache Konfiguration für den DHCP-Server unter /etc/dhcp/dhcpd.conf

    subnet 192.168.1.0 netmask 255.255.255.0 {
    authoritative;
    default-lease-time 600;
    max-lease-time 7200;
    ddns-update-style none;
    
    option domain-name-servers 192.168.1.1;
    option routers 192.168.1.1;
    
    }
  3. Testen Sie Ihre Konfiguration und beheben Sie alle Probleme, die Sie entdecken.

    systemctl start dhcpd
    journalctl --unit dhcpd --since -2m --follow
  4. Fügen Sie in /etc/dhcp/dhcpd.conf Einträge hinzu, um Clients auf ihren Bootloader und den Server zu verweisen, der ihn in Ihrer Subnetzkonfiguration bereitstellt. Da DHCP-Clients dem Server zusammen mit ihrer Adressanforderung identifizierende Informationen liefern, können BIOS-Clients und UEFI-Clients jeweils zum richtigen Bootloader geleitet werden.

    # refer to RFC4758 for possible arch option values
    option arch code 93 = unsigned integer 16;
    
    subnet 192.168.1.0 netmask 255.255.255.0 {
    if option arch = 00:07 {
    filename "uefi/shim.efi";
    } else {
    filename "pxelinux.0";
    }
    
    next-server 192.168.1.2;
    
    ...
  5. Starten Sie den dhcp-Dienst neu, um die Konfiguration zu überprüfen und bei Bedarf Änderungen vorzunehmen.

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

Installation des tftp-Servers

Installation des tftp-Servers
  1. Installieren Sie das tftp-Serverpaket.

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

    # systemctl start tftp.socket
    # systemctl enable tftp.socket

Bereitstellen und Konfigurieren von Bootloadern für PXE-Clients

Abrufen der Bootloader-Dateien
  1. Holen Sie sich den Bootloader syslinux für BIOS-Clients.

    1. Installieren Sie das Paket syslinux.

      # dnf install syslinux
    2. Erstellen Sie ein Verzeichnis für die Bootloader-Dateien und stellen Sie sie dort zur Verfügung.

      # mkdir -p /var/lib/tftpboot/pxelinux.cfg
      # cp /usr/share/syslinux/{pxelinux.0,vesamenu.c32,ldlinux.c32,libcom32.c32,libutil.c32} /var/lib/tftpboot/
  2. Holen Sie sich die Bootloader-Dateien für UEFI-Systeme

    1. Install the shim and grub2-efi 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.

      # dnf install shim grub2-efi --installroot=/tmp/fedora --releasever 27
    2. Erstellen Sie ein Verzeichnis für die Bootloader-Dateien und stellen Sie sie dort zur Verfügung.

      # mkdir -p /var/lib/tftpboot/uefi
      # cp /tmp/fedora/boot/efi/EFI/fedora/{shim.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.

    default vesamenu.c32
    prompt 1
    timeout 600
    
    label linux
    menu label ^Install Fedora 27 64-bit
    menu default
    kernel f27/vmlinuz
    append initrd=f27/initrd.img inst.stage2=http://download.fedoraproject.org/pub/fedora/linux/releases/27/Server/x86_64/os/ ip=dhcp
    
    label server
    menu label ^Install Fedora 27 ( Minimal Image )
    menu default
    kernel f27/vmlinuz
    append initrd=f27/initrd.img inst.stage2=http://download.fedoraproject.org/pub/fedora/linux/releases/27/Server/x86_64/os/ ip=dhcp ks=https://example.com/fedora/kickstarts/minimal.ks
    
    label rescue
    menu label ^Rescue installed system
    kernel f27/vmlinuz
    append initrd=f27initrd.img ip=dhcp root=live:http://download.fedoraproject.org/pub/fedora/linux/releases/27/Server/x86_64/os/LiveOS/squashfs.img rescue
    
    label local
    menu label Boot from ^local drive
    localboot 0xffff
  2. Create a boot menu for UEFI clients at /var/lib/tftpboot/pxelinux/uefi.

    function load_video {
    	insmod efi_gop
    	insmod efi_uga
    	insmod video_bochs
    	insmod video_cirrus
    	insmod all_video
    }
    
    load_video
    set gfxpayload=keep
    insmod gzio
    
    menuentry 'Install Fedora 64-bit'  --class fedora --class gnu-linux --class gnu --class os {
    	linuxefi f27/vmlinuz ip=dhcp inst.repo=http://download.fedoraproject.org/pub/fedora/linux/releases/27/Server/x86_64/os/
    	initrdefi f27/initrd.img
    }
    
    menuentry 'Install Fedora 27 Server'  --class fedora --class gnu-linux --class gnu --class os {
    	kernel f27/vmlinuz
    	append initrd=f27/initrd.img inst.repo=http://download.fedoraproject.org/pub/fedora/linux/releases/27/Server/x86_64/os/ ip=dhcp ks=https://git.fedorahosted.org/cgit/spin-kickstarts.git/plain/fedora-install-server.ks?h=f21
    }
    
    menuentry 'Rescue installed system'  --class fedora --class gnu-linux --class gnu --class os {
    	kernel f27/vmlinuz
    	append f27/initrd=initrd.img root=live:http://download.fedoraproject.org/pub/fedora/linux/releases/27/Server/x86_64/os/LiveOS/squashfs.img rescue
    }

Getting the kernel and initrd

Downloading the kernel and initrd
  1. Create a directory for the files.

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

    # wget http://download.fedoraproject.org/pub/fedora/linux/releases/27/Server/x86_64/os/images/pxeboot/vmlinuz -O /var/lib/tftpboot/f27/vmlinuz
  3. Download the initrd

    # wget http://download.fedoraproject.org/pub/fedora/linux/releases/27/Server/x86_64/os/images/pxeboot/initrd.img -O /var/lib/tftpboot/f27/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 a 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 http://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 configurtations, 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/.