PXE boot notes (part 3, TFTP)

So in part 2 we setup the DHCP server. It referenced a TFTP server in its configuration, so now we need to configure the TFTP server ready to do some neat stuff.

In Centos 7, the service starts by default from xinetd, so we need to edit /etc/xinetd.d/tftp and set ‘disable’ to ‘no’. Kick the xinetd service:

systemctl enable xinetd
systemctl xinetd start

And now we need some extra help, starting with another package – syslinux.

yum -y install syslinux

…and we need some files from that copying to the TFTP server directory, in our case /var/lib/tftpboot:

cd /usr/share/syslinux
cp -p pxelinux.0 menu.c32 memdisk mboot.c32 chain.c32 /var/lib/tftpboot/

Now that bit’s done (and see there, that pxelinux.0 file is the one referenced in the last post by the DHCP server) we also need a config file. There are several places under the TFTP root that PXE boot systems will look for which I won’t go into here, as we’re going to use the default. So we:

mkdir -p /var/lib/tftpboot/pxelinux.cfg/

In there, we need a file called ‘default’. That contains the following (for an automated installation, anyway):

default menu.c32
prompt 0
timeout 50
ONTIMEOUT kickstart


LABEL kickstart
 MENU LABEL Kickstart
 kernel /centos/images/pxeboot/vmlinuz
 append initrd=/centos/images/pxeboot/initrd.img inst.ks= ip=dhcp

 MENU LABEL run (local boot)

But… where do all those other files come from? You know, the kernel, initrd, and that pesky ks.cfg? Read on!



  1. Pingback: PXE boot notes (part 5, kickstart config) « Random Ramblings

  2. Pingback: PXE boot notes (part 2, DHCP) « Random Ramblings

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s