Installing your own PXE server is a fairly easy task if you control your own DHCP server.
The reason for this is that you need to add a couple of lines to the DHCP configuration to ensure that it points to the PXE server for the bootfiles and the menu of options you want to create.
First you need to install the following packages
syslinux
tftp-server
PXELINUX is a SYSLINUX derivative, for booting Linux off a network server, using a network ROM conforming to the Intel PXE (Pre-Execution Environment) specification. So installing syslinux will give you the pxelinux environment.
tftp-server is needed as this is how your client PC downloads the boot files and menus from your server.
Once you have installed both of the above packages then you need to edit the file /etc/xinetd.d/tftp so that it is not disabled.
If when you installed syslinux and tftp-server it also installed the xinetd server you will need to restart your linux box for tftp-server to work. Otherwise just restart the xinetd service.
At this point you have all the packages required for network installation, now we need to customize it to allow you to have menus.
Copy the following files to /tftpboot
/usr/lib/syslinux/pxelinux.0
/usr/lib/syslinux/chain.c32
/usr/lib/syslinux/mboot.c32
/usr/lib/syslinux/memdisk
/usr/lib/syslinux/menu.c32
These are the files that will be downloaded to your client PC when you first boot.
Next you need to create a directory /tftpboot/pxelinux.cfg, this is where we will put the menu files for your system. These are just simple text files.
Lets say we want to create a simple menu with one option that allows you to boot from the local hard drive. I know this is pretty useless as the system wil automatically boot from the hard drive, but as you go on you can add new menu items to the menu to carry out other tasks.
Edit a file in the /tftpboot/pxelinux.cfg are and call it default.
# Default boot option to use
DEFAULT menu.c32
# Prompt user for selection
PROMPT 0
# Menu Configuration
MENU TITLE Main Menu
# If you don't want users to modify the boot options use this command
# NOESCAPE 1
# Menus
# Local Boot
LABEL Local
MENU LABEL Boot local device
# If you want this to be the default option then use this
# MENU DEFAULT
LOCALBOOT 0
timeout 100
This is a simple menu just to check things are working.
Next you need to add the following lines to your DHCP server to ensure that it boots the pxe server
next-server <IP-Address of the PXE boot server>;
filename "pxe-linux.0";
This could be added to specific hosts in your dhcp file or as part of the subnet definition.
This just tells your client that when it receives it’s IP information from the DHCP server it will then go to the next-server and download the network boot file pxe-linux.0 which then automatically downloads the default menu to your client.
You will probably have to restart/reload your dhcp server for this to work.
Once restarted you should simply have to network boot a client and see the menu.