Configurazione di un server d’installazione
Questa appendice è destinata agli utenti con esperienza precedente in Linux. Se sei un nuovo utente, potresti voler installare utilizzando un supporto di avvio minimale o il DVD della distribuzione. |
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.
La maggior parte dei computer moderni ha la capacità di avviarsi tramite rete. Solitamente, premendo un tasto funzione durante l’avvio, si apre un menu di selezione dell’avvio. In ambienti progettati per l’amministrazione non assistita, i sistemi sono spesso configurati per tentare prima l’avvio dalla rete e poi dall’archiviazione locale. Il server di installazione è configurato per offrire l’installazione solo quando necessario. Il manuale del tuo computer fornirà istruzioni specifiche su come impostare le priorità di avvio.
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.
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.
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.
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.
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.
Configurazione del Server DHCP
-
Install the dhcp server package.
# dnf install dhcp-server
-
Create a simple configuration for the dhcp server at
/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; }
-
Test your configuration and address any problems you discover.
systemctl start dhcpd systemctl enable dhcpd journalctl --unit dhcpd --since -2m --follow
-
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. Using latest processor architecture option codes, which may be found on the IANA DHCPv6 registration page, allows multiple architectures to share a single DHCP server.# refer to RFC4578 & IANA DHCPv6 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 { # x64 UEFI filename "uefi/shimx64.efi"; next-server 192.168.1.2; } else if option arch = 00:0b { # aarch64 UEFI filename "uefi/shimaa64.efi"; server-name "192.168.1.2"; } else { filename "pxelinux.0"; next-server 192.168.1.2; } ...
-
Restart the dhcp service to check the configuration and make changes as needed.
systemctl restart dhcpd journalctl --unit dhcpd --since -2m --follow
Installing the tftp server
-
Install the tftp server package.
# dnf install tftp-server
-
Start and enable the
tftp socket
.systemd
will automatically start thetftpd
service when required.# systemctl start tftp.socket # systemctl enable tftp.socket
Providing and configuring bootloaders for PXE clients
-
Get the syslinux bootloader for BIOS clients.
-
Install the syslinux package.
# dnf install syslinux
-
Create a directory for the bootloader files, and make them available there.
# mkdir -p
/var/lib/tftpboot/pxelinux.cfg
# cp/usr/share/syslinux/{pxelinux.0,menu.c32,vesamenu.c32,ldlinux.c32,libcom32.c32,libutil.c32}
/var/lib/tftpboot/
-
-
Get the bootloader files for UEFI systems
-
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.
# dnf install shim-x64 grub2-efi-x64 --installroot=/tmp/fedora --releasever 34
-
Create a directory for the bootloader files, and make them available there.
# mkdir -p
/var/lib/tftpboot/uefi
# cp/tmp/fedora/boot/efi/EFI/fedora/{shimx64.efi,grubx64.efi}
/var/lib/tftpboot/uefi/
-
-
Create a boot menu for BIOS clients at
/var/lib/tftpboot/pxelinux.cfg/default
.default vesamenu.c32 prompt 1 timeout 600 label local menu label Boot from ^local drive menu default localboot 0xffff label linux menu label ^Install Fedora 34 64-bit kernel f34/vmlinuz append initrd=f34/initrd.img inst.stage2=https://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/x86_64/os/ ip=dhcp label server menu label ^Install Fedora 34 ( Minimal Image ) kernel f34/vmlinuz 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
-
Create a boot menu for UEFI clients at
/var/lib/tftpboot/uefi/grub.cfg
.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 'Exit this grub' { exit } menuentry 'Install Fedora 64-bit' --class fedora --class gnu-linux --class gnu --class os { linux $fw_path/f34/vmlinuz ip=dhcp inst.repo=https://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/x86_64/os/ initrd $fw_path/f34/initrd.img } menuentry 'Install Fedora 34 Server' --class fedora --class gnu-linux --class gnu --class os { kernel f34/vmlinuz 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 }
Getting the kernel and initrd
-
Create a directory for the files.
# mkdir -p
/var/lib/tftpboot/f34
-
Download the kernel.
# wget https://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/x86_64/os/images/pxeboot/vmlinuz -O /var/lib/tftpboot/f34/vmlinuz
-
Download the initrd
# 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
HTTP Installation Overview
Il boot HTTP/HTTPS è una tecnologia che permette ai computer di avviarsi direttamente da risorse fornite tramite la rete. Quando viene utilizzato insieme a HTTPS, l’autenticità del server viene validata, e l’uso di HTTP offre un meccanismo di trasporto più affidabile rispetto al TFTP di PXE. Installare Fedora in questo modo evita di creare supporti di installazione e permette a più computer di installare simultaneamente. Molte implementazioni UEFI attuali, inclusi i firmware basati su EDK2 forniti con le soluzioni di virtualizzazione di Fedora, possono avviarsi direttamente da fonti HTTP. Un’entrata di avvio UEFI può essere aggiunta manualmente specificando una fonte HTTP tramite i menu del firmware. In alternativa, un server DHCP può fornire automaticamente il percorso HTTP richiesto.
Sebbene molte macchine siano in grado di avviarsi tramite HTTPS oltre che HTTP, spesso è necessario prima registrare un’autorità di certificazione (CA). La CA viene utilizzata per convalidare i certificati presentati dal server HTTPS. Questo può essere fatto registrando i file appropriati dai certificati CA forniti da Fedora per i mirror pubblici o il certificato del server di avvio HTTPS locale.
DHCP Server Configuration for HTTP
The installation and configuration of a DHCP server for HTTP boot is identical to its configuration for PXE except that we need to amend the option arch conditions for HTTP clients
.... if option arch = 00:07 { # x64 UEFI filename "uefi/shim64.efi"; next-server 192.168.1.2; } else if option arch = 00:0b { # aarch64 UEFI filename "uefi/shimaa64.efi"; server-name "192.168.1.2"; } else if option arch = 00:13 { # aarch64 UEFI HTTP option vendor-class-identifier "HTTPClient"; filename "http://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/aarch64/os/images/boot.iso"; } else if option arch = 00:10 { # x64 UEFI HTTP option vendor-class-identifier "HTTPClient"; filename "http://download.fedoraproject.org/pub/fedora/linux/releases/34/Server/x86_64/os/images/boot.iso"; } else { filename "pxelinux.0"; next-server 192.168.1.2; } ...
Fornitura di repository
Gli esempi in questa sezione utilizzano i mirror pubblici di Fedora come fonte dei pacchetti. Per installazioni più rapide, l’installazione su molti sistemi o ambienti più isolati, potresti voler mantenere un repository locale.
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
.
Installazioni di rete avanzate con 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/.
Want to help? Learn how to contribute to Fedora Docs ›