Size: 3142
Comment:
|
Size: 3773
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 76: | Line 76: |
== Use your ks.cfg == In order for your network Ubuntu install to use your kickstart file, you have to tell it where to find it. Edit /tftpboot/pxelinux.cfg/default and add "ks=http://<installserver>/ks.cfg" to the append line. It should then look something like this {{{ label linux kernel ubuntu-installer/i386/linux append ks=http://192.168.0.1/ks.cfg vga=normal initrd=ubuntu-installer/i386/initrd.gz ramdisk_size=16432 root=/dev/rd/0 rw -- label expert }}} == Boot and install == You should now be able to boot another pc on the lan over the network and have it install Ubuntu automagically :) |
Introduction
This will guide you through running an Ubuntu server as PXE install server. You'll need to run a DHCP server on your network, not necessarily this server but you do need one. Some of the packages we'll install come from universe, so make sure you have it listed as a repository.
This document is work in progress, I'm typing it as I do this myself.
Installing needed packages
You'll need to install a few packages
sudo apt-get install netkit-inetd tftpd-hpa
If this is also going to be your DHCP server, install DHCPD
sudo apt-get install dhcp3-server
Configure dhcpd
If your pxe server is also your dhcp server, you'll need something like this in /etc/dhcp3/dhcpd.conf
subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.100 192.168.0.200; filename "/tftpboot/pxelinux.0"; }
If you have an existing dhcp server, you should point it to your pxe server by doing something like the following
subnet 192.168.0.0 netmask 255.255.255.0 { <other config here> filename "pxelinux.0" next-server <pxe host>; }
Configure tftpd-hpa
tftpd-hpa is called from inetd. The options passed to tftpd-hpa when it starts are thus found in /etc/inetd.conf
Change the path at the end to point to /tftpboot, your /etc/inetd.conf should then look like this
tftp dgram udp wait root /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /tftpboot
Create the tftpboot directory and copy the needed files from the Ubuntu CD
sudo mkdir /tftpboot sudo cp -r /media/cdrom/install/netboot/* /tftpboot/
If your dhcp server issues correct network info and your pxe clients will have network access, then at this point you will be able to do an Ubuntu install using internet repositories.
I want to go a little further however and install everything from the install server as well as customise some of the packages to install.
Install apache
Currently nfs installs aren't well supported (Please correct me if I'm wrong) so we'll install over http. For that we need a webserver on our install server too.
sudo apt-get install apache
Copying Ubuntu files
Create an ubuntu directory under your freshly installed apache's document root and copy all of the contents of the Ubuntu CD to that directory
mkdir /var/www/html/ubuntu cp -r /media/cdrom/* /var/www/html/ubuntu/
Customising the install
There is a package called system-config-kickstart which is a GUI frontend to creating kickstart files. The kickstart file tells the installer where to get it's packages from, what to install and a number of other useful settings. See KickstartCompatibility for more info.
This package does not have to be installed on your install server, it can be on a convenient Ubuntu desktop somewhere.
Create a custom ks.cfg with system-config-kickstart, be sure to specify HTTP under "Installation Method". Provide the IP of you install server and make the HTTP Director /ubuntu/ Save the file and copy it to your install server under /var/www/html/
Use your ks.cfg
In order for your network Ubuntu install to use your kickstart file, you have to tell it where to find it. Edit /tftpboot/pxelinux.cfg/default and add "ks=http://<installserver>/ks.cfg" to the append line. It should then look something like this
label linux kernel ubuntu-installer/i386/linux append ks=http://192.168.0.1/ks.cfg vga=normal initrd=ubuntu-installer/i386/initrd.gz ramdisk_size=16432 root=/dev/rd/0 rw -- label expert
Boot and install
You should now be able to boot another pc on the lan over the network and have it install Ubuntu automagically