Recent Changes - Search:

Bob Brandt

Linux Projects


Server Projects

Desktop Projects

Novell Projects


VMware Projects


N900 (Maemo) Projects


Python Projects


OpenOffice.org Projects


Other Projects


PmWiki

edit SideBar

Setting up a PXE Boot Server

PXE (or Pre-eXecution Environment) Booting is where a machine BIOS uses DHCP and TFTP information to boot into an environment independent of the media on the server

To create a PXE Boot Server you need four things:

  1. A properly configured DHCP server.
  2. A properly configured TFTP server.
  3. A PXELINUX install properly setup.
  4. A Network Repository

Creating a properly configured DHCP server.

So, the first thing that needs to be done is to create a properly configured DHCP server for PXE booting. This is normally not too hard, however for PXE booting, you need to make sure that in addition to the normal IP information you also send the PXE boot information to the workstation as well.

To do this using a Netware DHCP server, following the steps below:

  1. On the Subnet Options Tab of the Subnet object property page, check the "Set Boot Parameter Option"
  2. Add the IP Address and Server Name of the TFTP server
  3. Add the filename of the PXELINUX.0 configuration file

On a Linux DHCP server you need to add three options to the dhcpd.conf file (either through YaST or manually). I recently found myself in a position where I needed to setup a PXEBoot Server on a client site where use of DHCP was forbidden. Fun! So in order to solve this problem I needed to create a DHCP server that would only respond to PXE requests but not normal DHCP requests. Below is the dhcpd.conf file I used:

# Custom dhcpd.conf file
#
# This configuration will only respond to PXE requests

default-lease-time 14400;
max-lease-time 7200;
ddns-update-style none;
ddns-updates off;
allow booting;
option domain-name "domain.name";
option domain-name-servers 192.168.99.40, 192.168.99.41;
option routers 192.168.1.1;

# Define rules to identify DHCP Requests from PXE devices
class "pxe" {
  match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
}

subnet 192.168.0.0 netmask 255.255.0.0 {
  pool {
    default-lease-time 180;      # no long lease time required for booting
    max-lease-time 360;          # booted system does its own dhcp request
    server-name "pxeservername.domain.name";
    next-server pxeservername.;  # in case your local DNS only handles
                                 # unqualified domains keep trailing '.'
    filename "pxelinux.0";
    allow members of "pxe";      # only allow pxe class to receive dhcp
    range 192.168.99.30 192.168.99.39;
  }
}

Creating a properly configured TFTP server.

Once you have a DHCP server that is providing the PXE Boot information, you need to insure that the specified server is responding to TFTP (Trivial FTP) requests. Setting up a TFTP server on SLES10 is almost too simple!

  1. Make sure you have the TFTP package installed:
yast2 -i tftp
  1. Configure the server
yast2 tftp-server
  1. Make sure that the service is Enabled and that the "Boot Image Directory" is /tftpboot. The default is /srv/ftp.

Setting up a PXELINUX install properly.

PXELinux is a package include in the SYSLinux suite which is a SYSLINUX derivative, used for booting Linux off a network server. The process of installing PXELinux and configuring it to work with the TFTP server we setup above is detailed below:

  1. Make sure that you have the SYSLINUX package installed
yast2 -i syslinux
  1. Copy the default PXE files to the Boot Image Directory specified above
cp /usr/share/syslinux/pxelinux.0 /tftpboot
  1. Copy the kernel and initrd files from your SLED10 installation media to the Boot Image Directory directory:
cp /(path to SLED10 media)/boot/i386/loader/memtest /tftpboot/memtest
cp /(path to SLED10 media)/boot/i386/loader/linux /tftpboot/sled10.linux
cp /(path to SLED10 media)/boot/i386/loader/initrd /tftpboot/sled10.initrd
  1. Copy the kernel and initrd files from your SLES10 installation media to the Boot Image Directory directory:
cp /(path to SLES10 media)/boot/i386/loader/linux /tftpboot/sles10.linux
cp /(path to SLES10 media)/boot/i386/loader/initrd /tftpboot/sles10.initrd
  1. Copy the kernel and initrd files from your DSL initrd ISO image to the Boot Image Directory directory:
cp /(path to DSL initrd image files)/boot/isolinux/linux24 /tftpboot/dsl.linux24
cp /(path to DSL initrd image files)/boot/isolinux/minirt24.gz /tftpboot/dsl.minirt24.gz
  1. Create a pxelinux.cfg subdirectory under the tftp directory:
mkdir /tftpboot/pxelinux.cfg
  1. Copy the isolinux.cfg file from the installation media to this subdirectory and renaming it to default:
cp /(path to media)/boot/i386/loader/isolinux.cfg /tftpboot/pxelinux.cfg/default
  1. Copy the message file from the installation media to the pxelinux.cfg directory:
cp /(path to media)/boot/i386/loader/message /tftpboot/boot.msg

Note: I have an archive file with all the relevant test and message files in it. But you can get an idea from the files in the DSL initrd ISO image.

The benefit of renaming the linux and initrd files is that it allows you to copy additional kernels and make then available for booting. For instance, I created a this PXE Boot server to allow booting of the SLED and SLES installation programs (even thought they really aren't that different) and a DSL (Damn Small Linux) distribution. The DSL distribution allows administrators to boot a machine directly into DSL much as they would with a Live CD. Allowing them to perform maintenance on the machine without booting the physical hard drive.

References:

Edit - History - Print - Recent Changes - Search
Page last modified on November 08, 2007, at 08:44 PM