Booting with gPXE

May 2009


The Etherboot crew and H. Peter Anvin of SysLinux have sort of merged PXELinux into Etherboot. This has resulted in gPXE, a boot loader that has all the features a humble sysadmin like me can dream up. In order to boot e.g. the Ubuntu Jaunty installer from the network, all that is needed is this:

Procedure 71.  Booting Jaunty installer from gPXE

  1. Preparations

    Have a TFTP server, a DHCP server and an HTTP server ready. I assume you know how to do that. We assume that the DHCP server is in the broadcast domain of the booting host, the TFTP server is at 129.125.21.23 and the HTTP server is at 129.125.21.21.

  2. Serving DHCP

    On the DHCP server, configure a group thusly:

    group osis-gpxe
          {
          if exists user-class and option user-class = "gPXE"
            { # This is when gPXE is already loaded
              next-server 129.125.21.21;
              filename "http://boot.loader.rug.nl/boot/jaunty.php";
            }
          else
            { # This is the first step: the PXE bootROM loads the gPXE second stage bootloader
              next-server 129.125.21.23;
              filename "/tftpboot/undionly.kpxe";
            }
       host sandbox201  { hardware ethernet 00:11:22:33:44:55 ; fixed-address 10.0.34.201 ; }
           } # end group osis-gpxe
    	

  3. Serving TFTP

    Apart from the usual requirements for serving TFTP to booting machines (those can be found all over the Web), the file tftpboot/undionly.kpxe must exist, relative to the TFTP root. The gPXE folks have put up a nice nice HOWTO.

  4. Serving HTTP

    On the HTTP server, have the following ready so that it gets served at the URL indicated in the DHCP config (i.c. http://boot.loader.rug.nl/boot/jaunty.php):

    
    	

    [Note]Note

    Note that the kernel and initrd lines were just stolen from the pxelinux.cfg/default file in the Jaunty network boot dir, and that the URLs mentioned in jaunty.php should of course be places where the files can actually be downloaded.

    [Note]Note

    Also note that copy-pasting this example will not actually work, as boot.loader.rug.nl doesn't exist.

    [Warning]Warning

    The machine I booted was behind a PF firewall with the booting client on interface sis2 and the outside world (including the TFTP and the HTTP servers) on sis1. The DHCP server was running on the firewall. Please be warned that with

    scrub in all

    in /etc/pf.conf the setup described here will not work: the HTTP download of the gPXE config file (jaunty.php) will fail, perhaps because of ill-numbered frames (???) It is sufficient to not scrub on the local interface (i.c. sis2) to make the HTTP download of config file (and kernel and ramdisk) succeed.