Notice: This area refers to ariane version 1. There's a new update version 2, see http://quietsche-entchen.de/cgi-bin/wiki.cgi/ariane/

PXE Boots

Booting via PXE is a modern variant of booting diskless workstations. ariane can act on both ends, as the PXE server or the client. This document is only a simple "cookbook" explaining how to get things running with ariane. For more information you should consult the pxelinux homepage.

The DHCP server
The TFTP data area
Getting the ariane PXE initrd
Debugging
PXE boot configuration
PXE initrd explained
Booting different clients
hibernate or pxesave?

A PXE server consists of two parts: first the DHCP server assigning the network and boot configuration to the client and second, the TFTP server sending the required boot files to the client. The DHCP and TFTP server don't have to run on the same machine since the TFTP server is configured during the initial DHCP request.

ariane comes with both servers. They can be started with the commands

# /etc/init.d/dhcpd start
# /etc/init.d/tftpserver start

or together as PXE server with

# /etc/init.d/pxe start

Now let's look at a simple PXE how-to.

PXE How-To

  1. The DHCP server

    The DHCP server dhcpd is preconfigured for PXE. If you want to run it as DHCP-only server you'll have to remove the PXE configuration from /etc/dhcpd.conf. For PXE it's configured to assign IP-numbers from the range 192.168.1.33-.63 with 192.168.1.4 being the local DNS and TFTP server.

  2. The TFTP data area

    ariane starts the TFTP server in.tftpd with the directory /tmp/tftp-server as it's root directory. So all TFTP files must go there or in a subdirectory.

    This TFTP's root directory must contain four files for PXE:

  3. pxelinux.0 - boot loader
    This is the boot loader binary which is copied across the network to the PXE client and then executed. It's a syslinux variant for PXE environments.

    pxelinux.cfg boot configuration
    The configuration file for pxelinux.0. After the boot loader has started it will grab this configuration from the TFTP server and proceed with it.

    vmlinuz - linux kernel
    This is the kernel file that's fetched by pxelinux.0.

    pxe-initrd.gz - initial ramdisk
    The initial ramdisk for the kernel. When this file has been fetched by the boot loader things start as usual, the kernel is loaded with it's initrd.

    Since /tmp/tftp-server is not part of the ariane image you'll have to copy the files there on your own. The files pxelinux.0 and pxelinux.cfg can be found under /sbin/ariane.d/pxeboot.d. A usable kernel file can be found in the directory /usr/local/gdk/1/boot, it should be named vmlinuz-2.4.21 or similiar.

  4. Getting the ariane PXE initrd

    Now the only thing that's missing is the initial ramdisk for an ariane PXE boot. This file is not inside the ariane image and must be created. But it's simple if you have enough disk space to hold the image (or you are running from a harddisk) - you need approximatley 60MB free disk space. So this is something for an ariane on a harddisk (see ArianeHardDiskInstallation).

    1. Change to the gdk directory and look if it contains the file initrd.gz:

      # cd /usr/local/gdk
      # ls initrd.gz
      

      It should be there, if not create it with

      # bin/mkramdisk
      

    2. Now create the ariane image:

      # mkimage
      

      Which gives you the file linux.tgz in the /tmp directory. Side note: yes, this linux.tgz could be placed on the CD as new ariane image.

    3. Pack it together with the initrd of the previous step

      # bin/mkpxedisk /tmp/linux.tgz
      

    4. and move the resulting file into the TFTP directory:

      # mv /tmp/pxe-initrd.gz /tmp/tftp-server/
      
      .

      Then start your pxe server if not already done

      # /etc/init.d/pxe start
      

      and reboot a PXE capable computer and watch your PXE server's syslog on tty10.

    If your disk space is not enough to hold all the files, see ArianeImageCreation for alternatives.

    Debugging

    If everything works as it expected, the client should start a copy of your ariane system. If not check the syslog (press ALT+F10 to see the output on tty10). You should see the following things happen.

  5. First the client requests it's IP-configuration via dhcp,
  6. Then the files pxelinux.0 and pxelinux.cfg are fetched from the TFTP server.
  7. At this point the client waits for 10 seconds (configured in pxelinux.cfg) for user input at the boot prompt.
  8. If nothing happens, vmlinuz and pxe-initrd.gz are transfered from the client
  9. The initrd starts and ariane boots it's PXE sequence (see ArianeBootSequence).
  10. During the startup the client requests the files boot.conf and boot.script from the server.

If you don't get syslog entries for each of the client requests, check if you have all four files in your TFTP server directory. Check also the following configuration hints.

PXE boot configuration

ariane comes with a preconfigured PXE boot concept. If you might want to change the way things works, or you have to debug it, here is where the various boot settings are configured.

PXE Option Filename Option Default
TFTP server dhcpd.conf next-server option 192.168.1.4
boot loader dhcpd.conf filename option pxelinux.0
boot configuration file dhcpd.conf option pxelinux.configfile pxelinux.cfg
linux kernel pxelinux.cfg the usual places where a linux kernel is configured for syslinux vmlinuz
initial ramdisk pxelinux.cfg initrd parameter pxe-initrd.gz

PXE initrd explained

You might have noticed that the PXE initrd is very large for an initial ramdisk.

The PXE boot loader starts the configured kernel together with this initrd and the job of this is to set up the system for the real boot process. For ariane this means to get it's hands on the target image, unpack it into a ramdisk and so on. While the usual CD-ROM boot locates the boot CD with the ariane image, the PXE initrd has to cross the network to fetch the target system's image from the TFTP server.

At least, this is the theory but ariane's boot loader work different. The reason why it does not work this way is as follows. The PXE initrd is the same as for CD-ROM boots. This means the initrd is a libc5 system with libc5 programs together with a 2.4 kernel. It can not load any kernel modules like network drivers since the initrd system is far too old to work with a 2.4 kernel. If it could be done then the initrd would have to carry all kinds of network drivers.

So far there's no way to implement a PXE boot at all since we can not access the network. On the other hand, the PXE card's boot ROM doesn't have any problems doing TFTP to fetch kernel and the initial ramdisk. So the target's image file is simply put together with the initrd programs into the ramdisk. This makes the ramdisk that large as it is, but it solves also the problem of accessing the target image from the initrd.

By the way, the initrd programs don't care about what kind of image it installs, so in theory the ariane image could be replaced by another one.

Booting different clients

Of course you can use the above setup to boot different clients from the PXE server but they will all share the same image. If you have machines with different configurations and you want to hibernate via PXE, or booting them with different configurations, you need a different setup.

First /etc/dhcpd.conf must be modified. Instead of using pure DHCP you must configure static leases and a boot subdirectory:

group { ... pxe options are here option pxelinux.pathprefix "/boot/"; ... filename "/boot/pxelinux.0"; ... host mypc { hardware ethernet arp number goes here; fixed-address mypc's ip number; } repeat host section for every computer }

If you look into ariane's default dhcpd.conf you'll find that the configuration options are already there but they're commented out.

The changes above requires that all PXE boot files are in the TFTP server's boot subdirectory. This directory should look like

boot/
  pxe-initrd.gz
  pxelinux.0
  pxelinux.cfg
  vmlinuz

with a modified pxelinux.cfg:

default vmlinuz initrd=./pxe-latest.gz

label linux
  ...

label latest
  kernel vmlinuz
  append initrd=./pxe-latest.gz

label configure
  ...

This makes your client boot the ./pxe-latest.gz initrd by default. This PXE image can be produced with either hibernate or pxesave. To make this all work together your /etc/tftpd.map must contain the entries

...
re   /pxe-latest\.gz   /\i/pxe-latest.gz
re   ^\./(.*)$   /\i/\1
...

If you now create a TFTP subdirectory for every of your computers, using their IP address from the dhcpd.conf as directory name (don't forget to change the owner to "nobody"), the clients write their hibernation images into their private directory and they will also boot on the pxelinux keyboard timeout.

hibernate or pxesave?

There are two progams that create a PXE image from the running system: hibernate and pxesave. The difference between these programs is that hibernate

So generally you want hibernate, not pxesave. pxesave is a former version of hibernate, that's all.