PXEboot
I set up my Via EPIA 800 to run Debian using this method. I use it to configure servers at remote locations with just a little bit of help from local people. ("...Now push the reset button. Thanks.")
Using PXEboot with Debian
- Client requests network information from BOOTP / DHCP server
- Client requests kernel via TFTP
On the Debian server
Install these packages
dhcp server: dhcp3-server
tftp server: tftpd-hpa
When the installer asks "Should it be started from inet?", say 'yes'
tftp client: (useful for testing the server) tftp-hpa
You have to dig up a copy of the debian-installer file tree and put it in /var/lib/tftpboot. Then make symlinks from /var/lib/tftpboot/pxelinux.0 and pxelinux.cfg to the real ones lurk in the debian_installer tree.
Configuration
Generally I put a configuration for each machine into /etc/dhcp3/dhcpd.conf so that I have control over what happens when a given machine connects. The critical lines to add to dhcpd.conf are
# PXE-specific configuration directives... next-server 192.168.123.130; # that's this server or could be elsewhere... filename "/pxelinux.0";
host clientname { hardware ethernet mac-address; fixed-address ip address of your chosing; filename "pxelinux.0"; }
This tells the client what file to grab via tftp. The files for tftp should be installed in /var/lib/tftpboot (see comment above on symlinks)
Many Linux distributions (including Redhat, Debian, Trustix, Ubuntu, and SuSe) have network install support. You just have to poke around to find the files.
Booting the client
Set the client to boot from LAN or Network. Then boot it. If you are near the client and can look at the console,
- you should see the "UNDI" boot stuff. Notably you should see the client get the IP address that you set up for it in dhcpd.conf.
- next you should see it connect to the tftp server. It will show a series lines as it tries to find a pxelinux.cfg file; it will uses its MAC address piece by piece and then give up and load pxelinux.cfg/default
- if the pxelinux.cfg loads then it should fire up the installer and from then on, the screens are what you'd see if you booted from a cdrom.
Serial console rescue mode
But wait! I want to do a remote bare metal rescue mode!
I use a serial console. This is set up already. I just want to ask someone to push the reset button (or automate that too someday) and have the system come up. In theory I can just ssh in once the system pxeboots; I know it has a functional network card if it pxebooted, right? But I want it anyway. I am not guaranteed that the operating system will be able to find the network card after the kernel loads, now am I?
Then I can control whether it boots from network or not by modifying my dhcp server settings. If I uncomment the 'file' line it netboots, otherwise it boots from its own hard drive. If this works well enough I might quit having anything boot from a hard drive ever again! :-)
Okay. So here we go. I created a system rescue