Changes RSS

**This is an old revision of the document!** ----

A PCRE internal error occured. This might be caused by a faulty plugin

====== Debian-based PXE boot setup ====== In this document, and the related documents in the guides:pxe namespace, I will document my PXE boot-server setup. It is my intention to have quite a few "features" in my setup, including: * Menu-based selection of boot options * Booting of installers for several open-source operating systems * Booting of Live-environments for several open-source OS. * A selection of system-tools, like disk-shredder, partitioning tools, disk-backup and antivirus * Support for chainloading other net-boot mechanisms. The setup is based on pxelinux, a part of the syslinux tools. In general, PXE-booting will be useful for booting x86/ia32-related hardware. ===== Prerequisites ===== Naturally, a boot-server requires some components apart from configuration files and such. Noteable components: * An operating system for the boot server. I am using Debian 5 "Lenny" as my server-platform * A TFTP daemon. From recommendations of other Debian users, I am switching to atftpd. * A DHCP server. As this setup is done for my home-network, this role is filled by my OpenBSD box. * An NFS server. I am using the same box for tftpd and nfs, and I am running nfs-kernel-server. ===== Installing the tftp dæmon ===== My choice of tftpd-dæmon fell on atftpd. This is a modern TFTP server using multi-threading, supports multicast tftp, option extension, large file-sizes and more. Particularly important for PXE is the support for the [[http://tools.ietf.org/html/rfc2349|RFC2349]] Transfer Size option. Installing atftpd is basically as simple as: <code> apt-get install atftpd </code> It may be noted that as a dependency, atftpd pulls in "inetutils-inetd". As this is done on a Debian system, the package maintainers of atftpd has placed the tftpboot (aka tftp root) directory according to Debian standard at /var/lib/tftpboot. If you are using a different platform, it is highly probable that atftpd will be referring to /tftpboot instead. On the other hand, if you are using Debian, and want /tftpboot in stead of /var/lib/tftpboot, either symlink, or edit /etc/default/atftpd to relocate. ===== Adding TFTP/bootpd settings to DHCP server ===== Note that this is from my OpenBSD DHCP server. These settings however should be directly compatible with the DHCPd in most common Linux distributions, and at least ISC DHCPd. <code> subnet 10.0.3.0 netmask 255.255.255.0 { option domain-name-servers 10.0.2.2; option routers 10.0.3.1; option tftp-server-name "10.0.2.13"; next-server 10.0.2.13; filename "pxelinux.0"; range 10.0.3.130 10.0.3.250; } </code> ===== Installing syslinux to get the pxelinux files... ===== PXELinux, the PXE Boot environment used in my, and most other linux-oriented, net-boot-setups, is not a stand-alone package, but part of the larger [[http://syslinux.zytor.com/wiki/index.php/The_Syslinux_Project|syslinux]] project. To install, pull in the following packages: <code> apt-get install syslinux syslinux-common </code> The files we need to continue will be living in /usr/lib/syslinux. For starters, we will want to have a basic set of syslinux modules/files available. We will be adding on modules as features are added to the setup. * pxelinux.0 is the actual PXE environment/loader * menu.c32 allows us the creation of text-based menus * chain.c32 allows us to have "Boot from hard drive" as a boot option. These files are to be copied from /usr/lib/syslinux to /var/lib/tftpboot. We also need the directory where pxelinux configurations will be stored. <code> cp /usr/lib/syslinux/{pxelinux.0,menu.c32,chain.c32} /var/lib/tftpboot mkdir /var/lib/tftpboot/pxelinux.cfg chmod a+rx /var/lib/tftpboot/pxelinux.cfg </code> ===== Setting up a test ===== Our first test will be to see if our PXE environment works at all. To do this, we'll set up a "welcome message", a chainload of the first local harddrive and a faux linux boot. <code> cat > /var/lib/tftpboot/boot.txt <<END This is a PXELinux bootserver. To boot linux, type 'linux<enter>' To boot from local drive, press <enter> END cat > /var/lib/tftpboot/pxelinux.cfg/default <<END DISPLAY boot.txt DEFAULT boot_hd0 LABEL boot_hd0 COM32 chain.c32 APPEND hd0 LABEL linux kernel debian/lenny/i386/linux append vga=normal initrd=debian/lenny/i386/initrd.gz -- PROMPT 1 TIMEOUT 120 END </code> So, no menu yet, just a real simple test.