The following instructions only work on PC BIOS systems where the Preboot eXecution Environment (PXE) is available.
To generate a PXE boot image, run:
grub-mkimage --format=i386-pc-pxe --output=grub.pxe --prefix='(pxe)/boot/grub' pxe pxecmd
Copy grub.pxe, /boot/grub/*.mod, and /boot/grub/*.lst to the PXE (TFTP) server, ensuring that *.mod and *.lst are accessible via the /boot/grub/ path from the TFTP server root. Set the DHCP server configuration to offer grub.pxe as the boot file (the ‘filename’ option in ISC dhcpd).
You can also use the grub-mknetdir utility to generate an image and a GRUB directory tree, rather than copying files around manually.
After GRUB has started, files on the TFTP server will be accessible via the ‘(pxe)’ device.
The server and gateway IP address can be controlled by changing the ‘(pxe)’ device name to ‘(pxe:server-ip)’ or ‘(pxe:server-ip:gateway-ip)’. Note that this should be changed both in the prefix and in any references to the device name in the configuration file.
GRUB provides several environment variables which may be used to inspect or change the behaviour of the PXE device: