Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


CentOS 7 - UEFI PXE server

Installs a UEFI PXE server with Arch Linux installer and UEFI shell boot options.

  • Install prerequisites:
    yum install tftp-server dhcp xinetd grub2-efi grub2-efi-modules
  • Configure DHCPd /etc/dhcp/dhcpd.conf
    subnet netmask {
      option domain-name "<domain>";
      option domain-name-servers <nameserver1>, <nameserver2>;
      option ntp-servers <ntp1>, <ntp2>;
      option routers;
      next-server <this_pxeserver>;
      filename "/boot/grub/x86_64-efi/core.efi";
      default-lease-time 600;
      max-lease-time 7200;
  • Enable and start DHCPd:
    systemctl enable dhcpd
    systemctl start dhcpd
  • Configure the firewall:
    firewall-cmd --zone public --add-service=dhcp --permanent
    firewall-cmd --zone public --add-service=tftp --permanent
    firewall-cmd --zone public --add-service=http --permanent
    firewall-cmd --reload
  • Configure xinetd /etc/xinetd.d/tftp
    	disable			= no
  • Enable and start xinetd:
    systemctl enable xinetd
    systemctl start xinetd
  • Create grub configuration, this is een Arch linux install example:
    mkdir -p /var/lib/tftpboot/boot/grub/
    vi /var/lib/tftpboot/boot/grub/grub.cfg
    set timeout=5
    menuentry 'archlinux-2017.07.01-x86_64' --class os {
         insmod all_video
         echo 'Network config:'
         set root=http,<this_pxeserver>
         echo 'Loading Linux...'
         linuxefi /arch/boot/x86_64/vmlinuz archisobasedir=arch archiso_http_srv=http://<this_pxeserver>/ archisobasedir=arch ip=:::::eth0:dhcp
         echo 'Loading Intel micro code, initrd...'
         initrdefi /arch/boot/intel_ucode.img /arch/boot/x86_64/archiso.img
    menuentry 'UEFI Shell' {
      chainloader ($root)/boot/uefishell/Shell.efi
  • Create network bootable grub:
    grub2-mknetdir --net-directory=/var/lib/tftpboot --subdir=/boot/grub -d /usr/lib/grub/x86_64-efi/
  • Add Arch ISO:
    curl -O
    mount archlinux-2017.07.01-x86_64.iso /mnt
    cp -R /mnt/* /var/www/html
  • Add UEFI Shell:
    mkdir -p /var/lib/tftpboot/boot/uefishell
    curl -OL
pxe_uefi.txt · Last modified: 2021/10/09 15:14 by