Setting up a network installation server

About the setup
In this post, i am going to show you how to install schoolOS (a remix of ubuntu) using PXE based installation server powered by Fedora.

Prerequisites
Disable selinux, edit /etc/selinux/config set SELINUX=disabled and restart the machine

Disable IP Tables iptables -F service iptables stop

Assumptions
Your are already connected to wired network. The network interface eth0 has the following IP Address: 192.168.1.2 Sub Netmask: 255.255.255.0

Install
yum install dhcp tftp-server syslinux nfs-utils system-config-nfs xinetd

Setting up DHCP
allow booting; allow bootp; ddns-update-style interim; ignore client-updates; authoritative; subnet 192.168.1.0 netmask 255.255.255.0 { option subnet-mask 255.255.255.0; option broadcast-address 192.168.1.255; range dynamic-bootp 192.168.1.3 192.168.1.254; next-server 192.168.1.2; filename "pxelinux.0"; }

Note the "next-server", it is the ip address of your TFTP server (we are going to have the TFTP server in the same machine)

Setting up TFTP
service tftp {          socket_type		= dgram protocol		= udp wait			= yes user			= root server		= /usr/sbin/in.tftpd server_args		= -s /tftpboot/ disable		= no          per_source		= 11 cps			= 100 2 flags			= IPv4 }

By default, TFTP service will be default, you will have to enable it by changing disable = yes to disable = no. The default TFTP root is in /var/lib/tftproot/ , i just changed it to /tftproot/ for ease of use.

More TFTP

 * 1) Copy the kernel and ramdisk from the LiveDVD casper/vmlinuz casper/initrd.lz and put it in your TFTP root.
 * 2) Copy the boot strap program 'pxelinux.0' from /usr/share/syslinux/pxelinux.0 and put it in TFTP root.
 * 3) Create a directory named 'pxelinux.cfg' in TFTP root.
 * 4) Create a file named 'default' in 'pxelinux.cfg' directory.

The 'default' file must contain the following

DEFAULT pxeboot TIMEOUT 10 LABEL pxeboot KERNEL vmlinuz APPEND initrd=initrd.lz boot=casper only-ubiquity netboot=nfs nfsroot=192.168.1.2:/var/www/html/ubuntu/ ONERROR LOCALBOOT 0

Copying the LiveDVD
Copy/mount your live DVD somewhere in your disk. I mounted it in /var/www/html/ubuntu directory

Setting up NFS
Add the following in /etc/exports file

/var/www/html/ubuntu          *(ro,sync,nohide)

You can also use system-config-nfs tool

Permissions
Make sure everything under /tftpboot/, /var/www/html/ubuntu is world readable.

Start the services
service nfs start service dhcpd start service xinetd start

If any of the service fails check /var/log/messages for error information and try to rectify it.

Boot the clients
Boot the computers from network (PXE)

Similar articles
http://arunsag.wordpress.com/2009/08/20/setting-up-a-network-installation-server/

Good Luck.