Guide:PXE network booting Debian install

From Bits Wiki

Jump to: navigation, search

⇒ By Andy Smith | Last updated: Tue, 16 Aug 2011 13:46:29 +0000 by Andys

This page is related to the Bits post at http://andys.org.uk/bits/2010/03/22/pxe-booting-a-debian-squeeze-install/.

Contents

Introduction

This describes how to use tftpd-hpa and dhcp3-server under Debian Squeeze to PXE boot a squeeze install.

This is based on the article on Debian Administration here, and updated to use squeeze instead of etch.

Guide

Install TFTPd

  • Install tftpd-hpa
Example: Install the tftpd-hpa package
apt-get install tftpd-hpa

Install DHCPd

  • Install dhcp3-server
Example: Install the dhcp3-server package
apt-get install dhcp3-server

Configure DHCPd for PXE boot

  • Either add the following to an existing subnet declaration in /etc/dhcp3/dhcpd.conf:-
Example: PXE boot additions to dhcpd.conf
filename "pxelinux.0";
next-server 192.168.51.1;
  • ...or create a subnet declaration for your network if you didn't previously have DHCPd set up:-
Example: Example subnet declaration for dhcpd.conf
subnet 192.168.51.0 netmask 255.255.255.0 {
       range 192.168.51.64 192.168.51.80;
       filename "pxelinux.0";
       next-server 192.168.51.1;
       option routers 192.168.51.1;
}
  • Note: The next-server option points to our TFTPd server.

Setting up the PXE boot environment

  • Create the required directories under </code>/srv/tftpboot</code>:-
Example: Create the required directories
mkdir -v /srv/tftpboot/pxelinux.cfg
mkdir -pv /srv/tftpboot/debian/squeeze/i386
  • Create the /srv/tftpboot/pxelinux.cfg/default file:-
Example: Create the pxelinux.cfg/default file
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 --
PROMPT 1
TIMEOUT 0
  • Create /srv/tftpboot/pxelinux.cfg/boot.txt:-
Example: Create boot.txt
- Boot Menu -
=============

squeeze_i386_install
squeeze_i386_linux
squeeze_i386_expert
squeeze_i386_rescue
  • Download the installer components:-
Example: Download the Debian Squeeze installer components
cd /srv/tftpboot/
wget http://ftp.uk.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/pxelinux.0
cd /srv/tftpboot/debian/squeeze/i386
wget http://ftp.uk.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/linux
wget http://ftp.uk.debian.org/debian/dists/squeeze/main/installer-i386/current/images/netboot/debian-installer/i386/initrd.gz

Finishing steps

  • Make sure TFTPd and DHCPd are both running:-
Example: (Re)start tftpd-hpa and dhcp3-server
service tftpd-hpa restart
service dhcp3-server restart
elsewhere