PXELINUX a short HOWTO ======================================================================= Allthough pxe-0.1-36.src.rpm with its daemons /usr/sbin/in.mtftpd and /usr/sbin/pxe have been used frequently, (most prominent inside several Redhat distributions like RedHat 7.3, 8.0, 9 and also inside RHEL 2.1 and 3.0) pxe-0.1-36.src.rpm has become an outdated software implementation for booting a Intel based machine using Intel PXE boot. With the release of RHEL 4 , pxe-0.1-36.src.rpm has become redundant and one should use pxelinux instead. pxelinux is a part of syslinux which is a software project maintained by H. Peter Anvin The latest edition is currently syslinux-3.07-1.src.rpm and can be found on http://syslinux.zytor.com/ . When reading the notes on http://syslinux.zytor.com/hardware.php "Notes on problematic hardware " it becomes clear that with older Intel 10/100 ethernet cards one should upgrade the Boot ROM flash using the Intel Boot Agent UTIL : IBAUTIL Intel(R) PCI NIC Boot ROM/WOL Flash Upgrade Utility IBAUTIL supports both the PRO/100 and PRO/1000 family of adapters. This can be downloaded from Intel : Always check at http://support.intel.com for the latest Boot Agent information and images. (Search for Boot Agent). Setting up pxeboot : 1. configure the dhcp server on your LAN for use with pxelinux. For the dhcp server from isc.org the following should be added into /etc/dhcpd.conf : subnet 10.0.18.0 netmask 255.255.255.0 { range 10.0.18.101 10.0.18.120; default-lease-time 600; max-lease-time 7200; option subnet-mask 255.255.255.0; option broadcast-address 10.0.18.255; option netbios-node-type 8; option routers 10.0.18.72; option domain-name-servers 10.0.18.72; option netbios-name-servers 10.0.18.72; option domain-name "stokkie.net"; host bay350 { hardware ethernet 00:60:fd:8b:51:b7; fixed-address bay350.stokkie.net; } host bay351 { hardware ethernet 00:00:a2:8a:2c:30; fixed-address bay351.stokkie.net; } ========> # Group the PXE bootable hosts together ========> group { ========> # PXE-specific configuration directives... ========> next-server tapebox; ========> filename "pxelinux.0"; ========> ========> # You need an entry like this for every host ========> # unless you're using dynamic addresses ========> host install { ========> hardware ethernet 00:e0:81:63:17:e8; ========> fixed-address install.stokkie.net; ========> } ========> } } 2. Make sure on your "Next tftp server" tapebox is of course tftpd installed and running. check with chkconfig --list tftpd if its running: [tapebox:root]:(~)# chkconfig --list tftp tftp on [tapebox:root]:(~)# The xinetd.d config file for tftp looks like this : [tapebox:root]:(/etc/xinetd.d)# cat tftp # default: off # description: The tftp server serves files using the trivial file transfer \ # protocol. The tftp protocol is often used to boot diskless \ # workstations, download configuration files to network-aware printers, \ # and to start the installation process for some operating systems. service tftp { disable = no socket_type = dgram protocol = udp wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /var/lib/tftpboot per_source = 11 cps = 100 2 flags = IPv4 } [tapebox:root]:(/etc/xinetd.d)# 3. Make sure that syslinux-3.07-1.src.rpm is compiled and installed on your tftp server : [tapebox:root]:(~)# rpm -q -l syslinux /sbin/extlinux /usr/bin/gethostip /usr/bin/lss16toppm /usr/bin/ppmtolss16 /usr/bin/syslinux /usr/lib/syslinux/chain.c32 /usr/lib/syslinux/copybs.com /usr/lib/syslinux/ethersel.c32 /usr/lib/syslinux/isolinux-debug.bin /usr/lib/syslinux/isolinux.bin /usr/lib/syslinux/keytab-lilo.pl /usr/lib/syslinux/memdisk /usr/lib/syslinux/menu.c32 /usr/lib/syslinux/mkdiskimage /usr/lib/syslinux/pxelinux.0 /usr/lib/syslinux/sys2ansi.pl /usr/lib/syslinux/syslinux.com /usr/lib/syslinux/syslinux.exe /usr/share/doc/syslinux-3.07 /usr/share/doc/syslinux-3.07/COPYING /usr/share/doc/syslinux-3.07/NEWS /usr/share/doc/syslinux-3.07/README /usr/share/doc/syslinux-3.07/README.menu /usr/share/doc/syslinux-3.07/README.usbkey /usr/share/doc/syslinux-3.07/comboot.doc /usr/share/doc/syslinux-3.07/distrib.doc /usr/share/doc/syslinux-3.07/extlinux.doc /usr/share/doc/syslinux-3.07/isolinux.doc /usr/share/doc/syslinux-3.07/keytab-lilo.doc /usr/share/doc/syslinux-3.07/memdisk.doc /usr/share/doc/syslinux-3.07/pxelinux.doc /usr/share/doc/syslinux-3.07/sample /usr/share/doc/syslinux-3.07/sample/Makefile /usr/share/doc/syslinux-3.07/sample/README /usr/share/doc/syslinux-3.07/sample/atou.c /usr/share/doc/syslinux-3.07/sample/c32echo.c /usr/share/doc/syslinux-3.07/sample/c32echo.c32 /usr/share/doc/syslinux-3.07/sample/c32entry.S /usr/share/doc/syslinux-3.07/sample/c32exit.S /usr/share/doc/syslinux-3.07/sample/comecho.asm /usr/share/doc/syslinux-3.07/sample/comecho.com /usr/share/doc/syslinux-3.07/sample/conio.c /usr/share/doc/syslinux-3.07/sample/fd.c /usr/share/doc/syslinux-3.07/sample/fd.c32 /usr/share/doc/syslinux-3.07/sample/filetest.c /usr/share/doc/syslinux-3.07/sample/filetest.c32 /usr/share/doc/syslinux-3.07/sample/hello.c /usr/share/doc/syslinux-3.07/sample/hello.c32 /usr/share/doc/syslinux-3.07/sample/hello2.c /usr/share/doc/syslinux-3.07/sample/hello2.c32 /usr/share/doc/syslinux-3.07/sample/mdiskchk.c /usr/share/doc/syslinux-3.07/sample/mdiskchk.com /usr/share/doc/syslinux-3.07/sample/printf.c /usr/share/doc/syslinux-3.07/sample/sample.msg /usr/share/doc/syslinux-3.07/sample/skipatou.c /usr/share/doc/syslinux-3.07/sample/syslogo.lss /usr/share/doc/syslinux-3.07/sample/syslogo.png /usr/share/doc/syslinux-3.07/syslinux.doc [tapebox:root]:(~)# rpm -q -i syslinux Name : syslinux Relocations: (not relocatable) Version : 3.07 Vendor: (none) Release : 1mdk Build Date: Thu 17 Mar 2005 06:41:08 PM CET Install Date: Thu 17 Mar 2005 06:41:30 PM CET Build Host: tapebox.stokkie.net Group : Applications/System Source RPM: syslinux-3.07-1mdk.src.rpm Size : 407483 License: GPL Signature : (none) Packager : H. Peter Anvin Summary : Kernel loader which uses a FAT or iso9660 filesystem or a PXE network Description : SYSLINUX is a suite of bootloaders, currently supporting DOS FAT filesystems, Linux ext2/ext3 filesystems (EXTLINUX), PXE network boots (PXELINUX), or ISO 9660 CD-ROMs (ISOLINUX). It also includes a tool, MEMDISK, which loads legacy operating systems from these media. [tapebox:root]:(~)# 4. Configure the directory contents of your tftpboot directory, which in my case is /var/lib/tftpboot . I give an example here to setup a remote installation of Mandrake 10.1 i586 and AMD64 (Official release ) : 1st create dvd iso's from your official DVD media, which is not needed of course when you downloaded the iso's instead. : [tapebox:root]:(~)# cd /home [tapebox:root]:(/home)# mkdir dist [tapebox:root]:(/home)# cd dist [tapebox:root]:(/home/dist)# readcd -v dev=ATA:1,0,0 f=mdk101-i586.iso [tapebox:root]:(/home/dist)# readcd -v dev=ATA:1,0,0 f=mdk101-amd64.iso [tapebox:root]:(/home/dist)# ls -l total 27940832 -rw-r--r-- 1 root cdwriter 4494192640 Dec 24 18:05 mdk101-amd64.iso -rw-r--r-- 1 root cdwriter 4676982784 Jan 9 04:46 mdk101-i586.iso [tapebox:root]:(/home/dist)# Next add the following to your startup scripts, e.g. /etc/rc.d/rc.local : #!/bin/sh # # Run this script from inside /etc/rc.d/rc.local # /sbin/losetup /dev/loop0 /home/dist/mdk101-i586.iso /sbin/losetup /dev/loop1 /home/dist/mdk101-amd64.iso /bin/mount /dev/loop0 /mnt/mdk101-i586 /bin/mount /dev/loop1 /mnt/mdk101-amd64 /sbin/service nfs stop /sbin/service nfs stop /bin/sleep 1 /sbin/service nfs start exit 0 Next add the following to /etc/exports : # /etc/exports # # pxe linux iso's # /mnt/mdk101-i586 *.stokkie.net(ro,no_root_squash) /mnt/mdk101-amd64 *.stokkie.net(ro,no_root_squash) Next copy the isolinux boot gear from your mouted iso's into place inside /var/lib/tftpboot : [tapebox:root]:(/var/lib/tftpboot)# mkdir amd64 [tapebox:root]:(/var/lib/tftpboot)# mkdir i586 [tapebox:root]:(/var/lib/tftpboot)# cd /mnt/mdk101-amd64/isolinux/ [tapebox:root]:(/mnt/mdk101-amd64/isolinux)# ls advanced.msg alt1/ boot.msg isolinux.bin test/ alt0/ boot.cat help.msg isolinux.cfg [tapebox:root]:(/mnt/mdk101-amd64/isolinux)# cp -ap * /var/lib/tftpboot/amd64/ [tapebox:root]:(/mnt/mdk101-amd64/isolinux)# cd /mnt/mdk101-i586/isolinux/ [tapebox:root]:(/mnt/mdk101-i586/isolinux)# cp -ap * /var/lib/tftpboot/i586 [tapebox:root]:(/mnt/mdk101-i586/isolinux)# cd /var/lib/tftpboot/ [tapebox:root]:(/var/lib/tftpboot)# ll total 8 drwxr-xr-x 5 root root 4096 May 20 19:52 amd64/ drwxr-xr-x 5 root root 4096 May 20 19:53 i586/ [tapebox:root]:(/var/lib/tftpboot)# cp amd64/isolinux.bin . [tapebox:root]:(/var/lib/tftpboot)# cp /usr/lib/syslinux/pxelinux.0 . [tapebox:root]:(/var/lib/tftpboot)# ll total 36 drwxr-xr-x 5 root root 4096 May 20 19:52 amd64/ drwxr-xr-x 5 root root 4096 May 20 19:53 i586/ -r--r--r-- 1 root root 9660 May 20 19:54 isolinux.bin -rw-r--r-- 1 root root 12912 May 20 19:55 pxelinux.0 [tapebox:root]:(/var/lib/tftpboot)# mkdir pxelinux.cfg [tapebox:root]:(/var/lib/tftpboot)# cp amd64/isolinux.cfg pxelinux.cfg/default next edit /var/lib/tftpboot/pxelinux.cfg/default into something like this : default linux prompt 1 timeout 1500 display bootmenu.txt label linux kernel i586/alt0/vmlinuz append initrd=i586/alt0/all.rdz ramdisk_size=128000 root=/dev/ram3 vga=788 automatic=method:cdrom label text kernel i586/alt0/vmlinuz append initrd=i586/alt0/all.rdz ramdisk_size=128000 root=/dev/ram3 text automatic=method:cdrom label expert kernel i586/alt0/vmlinuz append initrd=i586/alt0/all.rdz ramdisk_size=128000 root=/dev/ram3 expert vga=788 automatic=method:cdrom label rescue kernel i586/alt0/vmlinuz append initrd=i586/alt0/all.rdz ramdisk_size=128000 root=/dev/ram3 rescue rw automatic=method:cdrom label acpi kernel i586/alt0/vmlinuz append initrd=i586/alt0/all.rdz ramdisk_size=128000 root=/dev/ram3 vga=788 automatic=method:cdrom label alt0 kernel i586/alt0/vmlinuz append initrd=i586/alt0/all.rdz ramdisk_size=128000 root=/dev/ram3 vga=788 label alt1 kernel i586/alt1/vmlinuz append initrd=i586/alt1/all.rdz ramdisk_size=128000 root=/dev/ram3 vga=788 label 64linux kernel amd64/alt0/vmlinuz append initrd=amd64/alt0/all.rdz ramdisk_size=128000 root=/dev/ram3 vga=788 automatic=method:cdrom label 64text kernel amd64/alt0/vmlinuz append initrd=amd64/alt0/all.rdz ramdisk_size=128000 root=/dev/ram3 text automatic=method:cdrom label 64expert kernel amd64/alt0/vmlinuz append initrd=amd64/alt0/all.rdz ramdisk_size=128000 root=/dev/ram3 expert vga=788 automatic=method:cdrom label 64rescue kernel amd64/alt0/vmlinuz append initrd=amd64/alt0/all.rdz ramdisk_size=128000 root=/dev/ram3 rescue rw automatic=method:cdrom label 64acpi kernel amd64/alt0/vmlinuz append initrd=amd64/alt0/all.rdz ramdisk_size=128000 root=/dev/ram3 vga=788 automatic=method:cdrom label 64alt0 kernel amd64/alt0/vmlinuz append initrd=amd64/alt0/all.rdz ramdisk_size=128000 root=/dev/ram3 vga=788 label 64alt1 kernel amd64/alt1/vmlinuz append initrd=amd64/alt1/all.rdz ramdisk_size=128000 root=/dev/ram3 vga=788 label msdos kernel dos/memdisk append initrd=dos/win98boot.img And here comes /var/lib/tftpboot/bootmenu.txt : 0cMandake 10.1 i586 installation07 : Default : 09linux07 Text : 09text07 Expert : 09expert07 Rescue : 09rescue07 ACPI : 09acpi07 ALT0 : 09alt007 ALT1 : 09alt107 0cMandake 10.1 AMD64 installation07 : Default : 0964linux07 Text : 0964text07 Expert : 0964expert07 Rescue : 0964rescue07 ACPI : 0964acpi07 ALT0 : 0964alt007 ALT1 : 0964alt107 MSDOS : 09msdos07 Reboot your tftp/pxelinux bootserver, insert your mac adress into the dhcpd.conf of your dhcp server, and boot your PC from PXE LAN boot using F12, choose alt0 for an i586 Mandrake installation, or 64alt0 for an AMD64 Mandrake installation. Robert M. Stockmann Last changed Fri May 20 20:39:46 CEST 2005