Setting up the TFTP Server and Syslinux
I installed a second NIC in PiXiE so I can make it play nice on my network where I have a DHCP server already as well as being able to handle DHCP on a network if need be. To set the new NIC to a static address, we do the following as root or a sudoer:
nano /etc/network/interfaces
Append the following:
auto eth2
iface eth2 inet static
address 172.16.100.100
netmask 255.255.255.0
network 172.16.100.0
broadcast 172.16.100.255
Note: Be sure to use whatever interface name is assigned to your new NIC and network settings correct for your network if necessary.
and finally restart networking to apply the settings changes:
/etc/init.d/networking restart
Now on to the good stuff: we need to install TFTP server and syslinux:
mkdir /tftpboot
aptitude install tftpd-hpa syslinux
Note: Change the path for tftpd-hpa to the /tftpboot directory we made prior to installing. If you need to change this later, the config is in /etc/default/tftp-hta as parameter TFTP_DIRECTORY=”/tftpboot”.
cp /usr/lib/syslinux/pxelinux.0 /tfptboot
cp /usrlib/syslinux/vesamenu.c32 /tftpboot
mkdir /tftpboot/pxelinux.cfg
cd /tftpboot/pxelinux.cfg
In here we need to make a default menu file named “default” and a configuration file “pxe.conf”
Note: From here on it will be configuration, menus, and such which will be mainly up to you. I will show you what I did for this part so you can reference it if need be.
My “default” menu file in /tftpboot/pxelinux.cfg/
DEFAULT vesamenu.c32
TIMEOUT 0
ONTIMEOUT Local
PROMPT 0
MENU INCLUDE pxelinux.cfg/pxe.conf
NOESCAPE 1
LABEL Local
localboot 0
MENU BEGIN Ubuntu
MENU TITLE Ubuntu
LABEL Previous
MENU SEPERATOR
MENU LABEL Previous
MENU EXIT
MENU SEPARATOR
MENU INCLUDE ubuntu/ubuntu.menu
MENU END
MENU BEGIN Xubuntu
MENU TITLE Xubuntu
LABEL Previous
MENU LABEL Previous
MENU EXIT
MENU SEPARATOR
MENU INCLUDE xubuntu/xubuntu.menu
MENU END
MENU BEGIN Kubuntu
MENU TITLE Kubuntu
LABEL Previous
MENU LABEL Previous
MENU EXIT
MENU SEPARATOR
MENU INCLUDE kubuntu/kubuntu.menu
MENU END
The line “MENU INCLUDE pxelinux.cfg/pxe.conf” adds the following file which defines the menu layout, colors, and background.
MENU TITLE PiXiE Server
MENU BACKGROUND pxelinux.cfg/dlug-pxe.png
NOESCAPE 1
ALLOWOPTIONS 1
PROMPT 0
menu width 80
menu rows 14
MENU TABMSGROW 24
MENU MARGIN 10
menu color border 30;47 #00ffffff #00000000 none
Also, you may have noticed that I used menu includes to make sure that removing and adding a new distro wasn’t a PITA. Here is a sample of my “ubuntu.menu” file:
LABEL 11
MENU LABEL Ubuntu 11.10 Desktop x86
KERNEL /ubuntu/11/10/desktop/x86/casper/vmlinuz
APPEND initrd=/ubuntu/11/10/desktop/x86/casper/initrd.lz boot=casper text vga=789 netboot=nfs nfsroot=172.16.100.100:/tftpboot/ubuntu/11/10/desktop/x86
LABEL 12
MENU LABEL Ubuntu 11.10 Desktop x64
KERNEL /ubuntu/11/10/desktop/x64/casper/vmlinuz
APPEND initrd=/ubuntu/11/10/desktop/x64/casper/initrd.lz boot=casper text vga=789 netboot==nfs nfsroot=172.16.100.100:/tftpboot/ubuntu/11/10/desktop/x64
It may seem confusing, but there is a great deal of documentation over here. Here is what I ended up with!
So far it is working perfectly here and I think I may be building one of these to add to my lab. In part 3, we’ll wrap up with unpacking the ISOs, finishing configuration, and doing whatever tweaks I find are useful or necessary.
