Logo
General:

Files/patches:

Articles:

Security:


 

PXE boot - running linux.


How to boot linux from network using PXE (Preboot Execution Environment) network boot.

   To boot linux you need:
  • PXE-Linux (you can download it here),
  • DHCP server,
  • TFTP server,
  • Gzipped Linux root file system (you can download an example here),
  • Compiled Linux kernel with support for your NIC.

   First, create a new user f.e. tftpd:

$ groupadd tftpd
$ useradd -g tftpd tftpd -d /home/tftpd

   Now download, ungzip and copy the PXE-Linux boot file to "/home/tftpd/pxelinux.0". Download (or make your own) linux root file system, copy it to "/home/tftpd/rootfs.gz". Compile your kernel, and copy it to "/home/tftpd/bzImage". Now run the tftpd daemon:

$ in.tftpd -s /home/tftp -u tftp -v -l -r blksize

   Edit your DHCPD config file, example:

# dhcpd.conf
#
# Configuration file for ISC dhcpd (see 'man dhcpd.conf')
#
allow bootp;
allow booting;
option domain-name "some.domain.here";
# DNS server
option domain-name-servers 192.168.0.100;
ddns-update-style none;
# subnet
subnet 192.168.0.0 netmask 255.255.255.0 {
	range 192.168.0.150 192.168.0.200;
}
                  
group {
	# pxe file name on tftpd server
	filename "pxelinux.0";
	# server running tftpd:
	next-server 192.168.0.100;
	# example hosts
	host pc_1 { hardware ethernet 00:10:dc:f5:ba:e0; }
	host pc_11 { hardware ethernet 00:10:dc:f5:b4:94; }
}

   Start your dhcpd daemon and the server-side of network boot is ready.

   Start your destination machine, select network boot from BIOS, reboot it, and wait for prompt. Then enter:

bzImage root=/dev/ram0 ramdisk_size=8192 initrd=rootfs.gz

   And you should be running linux right now.


Copyright © 2003-2009 by Ofi