PXE booting a Debian Squeeze install

Update: I’ve not tested myself, but the comment from Sombunall below points out that package names for the TFTP server and the DHCP server have changed since I wrote this post!

It’s often the case that there’s no easy way of installing a machine that doesn’t have any removable media. For instance, I have an old Compaq Deskpro EN that’s too old to support booting from USB, so using something like UNetbootin is out of the question. Luckily, there’s an an alternative, which is to PXE boot an installer over the network.

PXE (or Preboot eXecution Environment) is a means of booting a machine over a network,which conveniently removes any requirement for anything special on the machine that’s to be installed other than an network card. PXE boot (or network boot) support tends to be available in older machines that don’t support booting from USB, so it’s a very useful feature to be able to use.

There’s a very useful article on Debian Administration that covers configuring a Debian machine to act as a PXE boot server to serve out an etch installer. I personally run squeeze, so I’ve used the article as a basis for setting up a Debian squeeze machine to serve out a squeeze installer.

Installing the prerequisites

To start with, we need a TFTP server and a DHCP server. You might already have one (or both) of these installed already, but for the purposes of this we’ll assume that you haven’t. So, to get started, install the tftpd-hpa and dhcp3-server packages:-

apt-get install tftpd-hpa dhcp3-server

Configuring DHCPd

First, make sure that the tftpboot directory exists. This used to be /var/lib/tftpboot, but Debian now uses /srv/tftpboot. The installer should have created it, but just in case, check it exists and if create it if not.

The next step is to add a subnet declaration to /etc/dhcp3/dhcpd.conf for your network. A simple one will be something like this:-

subnet netmask {
       filename "pxelinux.0";
       option routers;

If you’ve already got DHCPd installed and configured, the two lines highlighted in green are the ones you need to add to your existing subnet declaration. The filename option tells PXE clients which file they need to request via TFTP, and the next-server option tells the clients the TFTP server they should use to get it.

Creating the PXE boot environment

Before we pull down any of the installer files, we need to create somewhere for those files to go, along with the PXE boot configuration. So, create the pxelinux.cfg and debian/squeeze/i386 directories:-

mkdir -pv /srv/tftpboot/pxelinux.cfg
mkdir -pv /srv/tftpboot/debian/squeeze/i386

Next, create the config for pxelinux in pxelinux.cfg/default:-

DISPLAY boot.txt

DEFAULT squeeze_i386_install

LABEL squeeze_i386_install
     kernel debian/squeeze/i386/linux
     append vga=normal initrd=debian/squeeze/i386/initrd.gz  --
LABEL squeeze_i386_linux
     kernel debian/squeeze/i386/linux
     append vga=normal initrd=debian/squeeze/i386/initrd.gz  --
LABEL squeeze_i386_expert
     kernel debian/squeeze/i386/linux
     append priority=low vga=normal initrd=debian/squeeze/i386/initrd.gz  --
LABEL squeeze_i386_rescue
     kernel debian/squeeze/i386/linux
     append vga=normal initrd=debian/squeeze/i386/initrd.gz  rescue/enable=true --

Then, create boot.txt in pxelinux.cfg, which is our boot menu:-

- Boot Menu -


Finally, download the installer parts from the Debian FTP mirror:-

cd /srv/tftpboot/
cd /srv/tftpboot/debian/squeeze/i386

Final steps

Make sure that tftpd-hpa and dhcp3-server are running:-

service tftpd-hpa restart
service dhcp3-server restart

You should now be able to network boot machines into the Debian squeeze installer.

I’ve also put this on the Bits Wiki as a guide – feel free to have a look and add any notes you feel may be useful!

8 comments to PXE booting a Debian Squeeze install

Leave a Reply to Vidar Normann Cancel reply




You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>