PXE Boot File
Pxelinux or Grub4dos can both be used as PXE boot files - either can be used to load boot menus with multiple options. Pxelinux and grub4dos both load configuration files with filenames based on the client PCs MAC address, IP address or a default file loaded by all PCs connecting to the PXE server.
Pxelinux
The PXE boot file pxelinux.0 must be present in the tftp root directory - e.g. C:\PXE\tftpboot\ and must be set as the DHCP Server Boot File (see tftpd32 section here)
The following is a simplified explanation of the boot process -
- The pxelinux boot file pxelinux.0 is loaded.
- The tftp root pxelinux.cfg directory (e.g. C:\PXE\tftpboot\pxelinux.cfg\ ) is scanned for a configuration file.
- If a configuration file is located then the commands within it will be executed (e.g. a boot menu will be displayed; default option executed; etc).
- If a configuration file is not found the boot process will halt with error Boot failed: press a key to retry, or wait for reset...
Grub4dos
The PXE boot file grldr must be present in the tftp root directory - e.g. C:\PXE\tftpboot\ and must be set as the DHCP Server Boot File (see tftpd32 section here)
The following is a simplified explanation of the boot process -
- The grub4dos boot file grldr is loaded.
- The tftp root menu.lst directory (e.g. C:\PXE\tftpboot\menu.lst\ ) is scanned for a configuration file.
- If a configuration file is located then the commands within it will be executed (e.g. a boot menu will be displayed; default option executed; etc).
- If a configuration file is not found -
- an embedded menu is executed which will scan the client PC for the configuration file menu.lst
- If menu.lst is not found on the client PC then a command line interface is loaded.
Configuration File(s)
The following is quoted from pxelinux documentation but also applies to grub4dos -
"...Because more than one
system may be booted from the same server, the configuration file name
depends on the IP address of the booting machine..."
In addition to using a configuration filename based on the client's IP address it is also possible to use a filename based on the client PCs GUID (pxelinux only) or MAC address. A default configuration file loaded by all clients connecting to the server can also be used. Configuration files are searched for in a specific order - as soon as a configuration file is located the scanning process ends and the file is loaded. The search order/priority for configuration files is as follows -
- GUID based filename - only applies to pxelinux. E.g C:\PXE\tftpboot\pxelinux.cfg\f3fd11ec-414d-4b04-9f80-106aea6a4a43
- MAC address based filename - the hardware type (using it's ARP type code) is prefixed to the MAC address. E.g. if the client PC's MAC address (in hexadecimal format) = 08:00:27:ea:d4:1c and it's ARP type is 01, use file C:\PXE\tftpboot\pxelinux.cfg\01-08-00-27-ea-d4-1c (pxelinux) or C:\PXE\tftpboot\menu.lst\01-08-00-27-ea-d4-1c (grub4dos).
- IP address based filename (in hexadecimal format). IP address 192.168.2.3 = C0A80203 in hexadecimal, we would therefore use file C:\PXE\tftpboot\pxelinux.cfg\C0A80203 (pxelinux) or C:\PXE\tftpboot\menu.lst\C0A80203 (grub4dos). If C0A80203 is not found one hex digit will be removed until a filename using only the first digit is searched for - e.g. C0A80203 followed by C0A8020, then C0A802, etc, until C is searched for.
- default - loaded by any PC's connecting to the server. E.g. C:\PXE\tftpboot\pxelinux.cfg\default (pxelinux) or C:\PXE\tftpboot\menu.lst\default (grub4dos).
- pxelinux screenshot -
- grub4dos screenshot -