If you have a Linux LAN server in your home network to provide printing and storage services you also can use this server to offer different operting systems to your clients with a PXE boot serevr. This can be liveCD images which can be started and used immediately or installation images so your clients can upgrade to the next distro release easily. Rescue live CDs are also useful if there are any client issues.
A PXE boot server has following prerequisites:
- Installed syslinux Paket
- Configured DHCP Server
- Configured tftp Server including xinetd config for tftp
- LiveCD kernel- and initrdfiles
- For a network installation like openSuSE
- a configured nfs server
- the installation images
First of all you have to install all then packages mentioned above. Then I downloadedall the ISO images for openSuSE 11.4 32 and 64 bit, Linux Mint LXDE and LMDE and stored them on the server. Then you have to add one line in /etc/fstab for every IS:
/disks/vol1/IsoImages/openSUSE-11.4-DVD-i586.iso /export/SuSE11.4 iso9660 loop
Then you can access the contents of the ISO file in the directory /export.
Now these directories have to be exported as nfs in /etc/exports(Only needed for openSuSE installation ISO images).
/export/SuSE11.4 *(ro,no_root_squash,async,no_subtree_check)
My /etc/exports can be downloaded here.
For MINT LiveCDs you have to copy initrd and kernel files from the mountes iso into the tftp directory. You find them in the mint directories casper. For openSuSE you have to look into /boot/i386/boot/loader.
My /etc/fstab can be downloaded here.
idefix:/tftpboot # ls -alRh
.:
total 50M
drwxr-xr-x 7 root root 4.0K May 6 20:14 .
drwxr-xr-x 25 root root 4.0K May 6 18:54 ..
drwxr-xr-x 2 root root 4.0K May 5 20:27 LMDE
drwxr-xr-x 2 root root 4.0K May 5 19:34 LXDE
-r--r--r-- 1 root root 2.0M Feb 27 18:08 biostest
-r--r--r-- 1 root root 33M Feb 27 18:08 initrd
-r--r--r-- 1 root root 3.9M Feb 27 18:08 linux
-r--r--r-- 1 root root 162K Feb 27 18:08 memtest
-r--r--r-- 1 root root 514 May 6 19:41 message
-rw-r--r-- 1 root root 17K Oct 24 2009 pxelinux.0
drwxr-xr-x 2 root root 4.0K May 6 19:37 pxelinux.cfg
-r--r--r-- 1 root root 12M Feb 27 18:08 rescue
drwxr-xr-x 2 root root 4.0K May 6 19:38 suse32
drwxr-xr-x 2 root root 4.0K May 5 21:09 suse64
./LMDE:
total 16M
drwxr-xr-x 2 root root 4.0K May 5 20:27 .
drwxr-xr-x 7 root root 4.0K May 6 20:14 ..
-r--r--r-- 1 root root 11M Nov 5 13:01 initrd.lz
-r--r--r-- 1 root root 4.1M Sep 20 2010 vmlinuz
./LXDE:
total 20M
drwxr-xr-x 2 root root 4.0K May 5 19:34 .
drwxr-xr-x 7 root root 4.0K May 6 20:14 ..
-r--r--r-- 1 root root 16M Mar 11 14:02 initrd.lz
-r--r--r-- 1 root root 4.1M Mar 11 14:02 vmlinuz
./pxelinux.cfg:
total 12K
drwxr-xr-x 2 root root 4.0K May 6 19:37 .
drwxr-xr-x 7 root root 4.0K May 6 20:14 ..
-r--r--r-- 1 root root 1.2K May 6 19:37 default
./suse32:
total 37M
drwxr-xr-x 2 root root 4.0K May 6 19:38 .
drwxr-xr-x 7 root root 4.0K May 6 20:14 ..
-r--r--r-- 1 root root 33M Feb 27 18:08 initrd
-r--r--r-- 1 root root 3.9M Feb 27 18:08 linux
./suse64:
total 37M
drwxr-xr-x 2 root root 4.0K May 5 21:09 .
drwxr-xr-x 7 root root 4.0K May 6 20:14 ..
-r--r--r-- 1 root root 33M Feb 27 18:10 initrd
-r--r--r-- 1 root root 4.1M Feb 27 18:10 linux
cp -a /usr/share/syslinux/pxelinux.0 /tftpbootcd /disks/vol2/IsoImages/openSuSE/InstDir/boot/i386/loadercp -a linux initrd message memtest /tftpbootcp -a isolinux.cfg /tftboot/pxelinux.cfg/default
Now add some lines in /tftpboot/pxlinux.cfg/default for all bootimages you want to provide via PXE.
My /tftpboot/pxelinux.cfg/default can be downloaded here.
# hard disk
label harddisk
localboot 0x80
# install
label suse64
kernel suse64/linux
append initrd=suse64/initrd splash=silent showopts insmod=e100 install=nfs://192.168.0.5/export/SuSE11.464 vga=791
label suse32
kernel suse32/linux
append initrd=suse32/initrd splash=silent showopts insmod=e100 install=nfs://192.168.0.5/export/SuSE11.4 vga=791
label LXDE
kernel LXDE/vmlinuz
append boot=casper initrd=LXDE/initrd.lz ip=dhcp showmounts file=/cdrom/preseed/mint.seed netboot=nfs nfsroot=192.168.0.5:/export/LXDE quiet splash --
label LMDE
kernel LMDE/vmlinuz
append boot=casper initrd=LMDE/initrd.lz ip=dhcp showmounts file=/cdrom/preseed/mint.seed netboot=nfs nfsroot=192.168.0.5:/export/LMDE quiet splash --
# rescue
label rescue
kernel linux
append initrd=initrd splash=silent rescue=1 showopts
# mediacheck
label mediachk
kernel linux
append initrd=initrd splash=silent mediacheck=1 showopts
# bios test
label firmware
kernel linux
append initrd=biostest,initrd splash=silent install=exec:/bin/run_biostest showopts
# memory test
label memtest
kernel memtest
default LMDE
display message
implicit 0
prompt 1
timeout 0
Next the message file /tftpboot/message of PXE has to be updated so the clientsget a menu of all the images which can be used.
^L
*** Welcome to Idefix ***
To start the installation select a boot option and press <return>.
Available boot options:
harddisk - Boot from Hard Disk (this is default)
suse32 - Install openSuSE 11.4 32 bit
suse64 - Install openSuSE 11.4 64 bit
LXDE - Start Mint LXDE live system
LMDE - Start Mint LMDE live system
rescue - Rescue System
mediachk - Check Installation Media
firmware - Firmware Test
memtest - Memory Test
Have a lot of fun...
Last but not least dthe installed DHCP server has to get the following lines but has to be adopted to the local environment, i.e.. the subnet (192.168.0.0/255.255.255.0 in my net), the DNS server (192.168.0.1 in my net) and the gateway (option routers 192.168.0.1 in my net) and finally the IP address of the PXE bootserver (192.168.0.5 in my net).
My /etc/dhcpd.conf can be downloaded here.
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.200 192.168.0.210;
option routers 192.168.0.1;
option domain-name-servers 192.168.0.1;
filename "pxelinux.0"; # syslinux boot image
next-server 192.168.0.5; # ip adress of tftp server
}
Finally you have to enable the tftp server in xinetd in /etc/xinet.d/tftp:
service tftp{
socket_type = dgram
protocol = udp
wait = yes
flags = IPv6 IPv4
user = root
server = /usr/sbin/in.tftpd
server_args = -s /tftpboot
disable = no
}
Now you have to enable the xinet daemon, start the dhcp server and start your PXE clients an can select openSuSE for installation or MINT LiveCDs .
