From Fedora Project Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

network booting

This describes how to set up a server for network booting of both UEFI and BIOS clients.

packages

On the server, you'll need several packages:

  1. dhcpd
  2. tftp-server
  3. grub-efi
  4. syslinux

setup

  1. Make sure tftp is enabled in /etc/xinetd.d/tftp
  2. Copy necessary files:
    • mkdir /var/lib/tftpboot/efi/ /var/lib/tftpboot/pxelinux/ /var/lib/tftpboot/pxelinux/pxelinux.cfg
    • cp /boot/efi/EFI/redhat/grub.efi /var/lib/tftpboot/efi/bootx64.efi
    • cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/pxelinux/pxelinux.0
  3. Configure your dhcpd server to use the EFI boot images packaged with grub, and configure a test system to boot using the EFI boot image. A sample configuration in /etc/dhcpd.conf might look like:
  option space PXE;
  option PXE.mtftp-ip    code 1 = ip-address;
  option PXE.mtftp-cport code 2 = unsigned integer 16;
  option PXE.mtftp-sport code 3 = unsigned integer 16;
  option PXE.mtftp-tmout code 4 = unsigned integer 8;
  option PXE.mtftp-delay code 5 = unsigned integer 8;
  option arch code 93 = unsigned integer 16;

  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;

  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 arch = 00:07 {
                          filename "efi/bootx64.efi";
                  } else {
                          filename "pxelinux/pxelinux.0";
                  }
          }

          host example-ia32 {
                  hardware ethernet XX:YY:ZZ:11:22:33;
                  fixed-address 10.0.0.2;
          }
  }
  1. Add a grub config file to /var/lib/tftpboot/efi/efidefault and a syslinux config file to /var/lib/tftpboot/pxelinux/pxelinux.cfg/default.
    • A sample grub config file at /var/lib/tftpboot/efi/efidefault might look like:
default=0
timeout=1
splashimage=(nd)/splash.xpm.gz
hiddenmenu
title Fedora
        root (nd)
        kernel /rawhide-x86_64/vmlinuz
        initrd /rawhide-x86_64/initrd.img
    • A sample syslinux config file at /var/lib/tftpboot/pxelinux/pxelinux.cfg/default might look like:
default vesamenu.c32
IPAPPEND 2
timeout 100

label Fedora
	MENU rawhide x86_64
	kernel /rawhide-x86_64/vmlinuz
	append initrd=/rawhide-x86_64/initrd.img
Warning.png
It's fine not to have a background image on BIOS, but you'll need one in UEFI or else you won't get a console device set up properly.
  1. Copy the splash and boot images into your tftp directory:
    • cp /boot/grub/splash.xpm.gz /var/lib/tftpboot/pxelinux/splash.xpm.gz
    • cp /path/to/x86_64/os/images/pxeboot/{vmlinuz,initrd.img} /var/lib/tftpboot/pxelinux/rawhide-x86_64/
    • cp -al /var/lib/tftpboot/pxelinux/rawhide-x86_64/ /var/lib/tftpboot/efi/rawhide-x86_64/