Setting Up A PXE Install Server For Multiple Linux Distributions With Ubuntu Edgy Eft - Page 2

4 Set Up Ubuntu Edgy Eft Netboot

Now we are ready to set up the netboot for our first distribution, Ubuntu Edgy Eft (i386). The necessary files for the netboot can be found on http://archive.ubuntu.com/ubuntu/dists/edgy/main/installer-i386/current/images/netboot/. We download the files now and copy them to the /var/lib/tftpboot directory. This is the directory from where our PXE server will serve the installation images:

cd /tmp
lftp -c "open http://archive.ubuntu.com/ubuntu/dists/edgy/main/installer-i386/current/images/; mirror netboot/"
mv netboot/* /var/lib/tftpboot
rm -fr netboot

(You can download the files from any other Ubuntu mirror as well. Use one that is close to you.)

That's it already. Now have a look at the file /var/lib/tftpboot/pxelinux.cfg/default to get familiar with its structure:

vi /var/lib/tftpboot/pxelinux.cfg/default

DISPLAY ubuntu-installer/i386/boot-screens/boot.txt

F1 ubuntu-installer/i386/boot-screens/f1.txt
F2 ubuntu-installer/i386/boot-screens/f2.txt
F3 ubuntu-installer/i386/boot-screens/f3.txt
F4 ubuntu-installer/i386/boot-screens/f4.txt
F5 ubuntu-installer/i386/boot-screens/f5.txt
F6 ubuntu-installer/i386/boot-screens/f6.txt
F7 ubuntu-installer/i386/boot-screens/f7.txt
F8 ubuntu-installer/i386/boot-screens/f8.txt
F9 ubuntu-installer/i386/boot-screens/f9.txt
F0 ubuntu-installer/i386/boot-screens/f10.txt

DEFAULT install

LABEL install
        kernel ubuntu-installer/i386/linux
        append vga=normal initrd=ubuntu-installer/i386/initrd.gz ramdisk_size=16417 root=/dev/ram rw  --
LABEL linux
        kernel ubuntu-installer/i386/linux
        append vga=normal initrd=ubuntu-installer/i386/initrd.gz ramdisk_size=16417 root=/dev/ram rw  --
LABEL server
        kernel ubuntu-installer/i386/linux
        append base-installer/kernel/linux/extra-packages-2.6= pkgsel/install-pattern=~t^ubuntu-standard$ pkgsel/language-pack-patterns= pkgsel/install-language-support=false vga=normal initrd=ubuntu-installer/i386/initrd.gz ramdisk_size=16417 root=/dev/ram rw  --

LABEL expert
        kernel ubuntu-installer/i386/linux
        append priority=low vga=normal initrd=ubuntu-installer/i386/initrd.gz ramdisk_size=16417 root=/dev/ram rw  --
LABEL server-expert
        kernel ubuntu-installer/i386/linux
        append base-installer/kernel/linux/extra-packages-2.6= pkgsel/install-pattern=~t^ubuntu-standard$ pkgsel/language-pack-patterns= pkgsel/install-language-support=false priority=low vga=normal initrd=ubuntu-installer/i386/initrd.gz ramdisk_size=16417 root=/dev/ram rw  --

LABEL rescue
        kernel ubuntu-installer/i386/linux
        append vga=normal initrd=ubuntu-installer/i386/initrd.gz ramdisk_size=16417 root=/dev/ram rw  rescue/enable=true --

PROMPT 1
TIMEOUT 0

As you see, this file contains all valid installation options (linux, server, expert, etc.) for Ubuntu Edgy Eft, each in its own LABEL stanza. All paths in this file are relative to the /var/lib/tftpboot directory, so ubuntu-installer/i386/initrd.gz translates to /var/lib/tftpboot/ubuntu-installer/i386/initrd.gz. The output of

ls -la /var/lib/tftpboot

should look like this now:

root@server1:~# ls -la /var/lib/tftpboot/
total 25052
drwxr-xr-x  9 root root    4096 2006-12-14 19:25 .
drwxr-xr-x 21 root root    4096 2006-12-14 15:01 ..
-rw-r--r--  1 root root 8315725 2006-10-21 02:42 boot.img.gz
-rw-r--r--  1 root root 8849408 2006-10-21 02:42 mini.iso
-rw-r--r--  1 root root 8381337 2006-10-21 02:42 netboot.tar.gz
-rw-r--r--  1 root root   13156 2006-10-21 02:44 pxelinux.0
drwxr-xr-x  2 root root    4096 2006-12-14 19:39 pxelinux.cfg
drwxr-xr-x  4 root root    4096 2006-12-14 16:15 ubuntu-installer

When a client computer boots up over the network, it will look for the file /var/lib/tftpboot/pxelinux.cfg/default and load it, so that's the file we have to modify later on when we add more Linux distributions to our PXE server.

 

5 Our First Test

(Please make sure that the computers that you don't want to reinstall have the network boot option disabled in their BIOS settings because otherwise it is possible that you or someone else accidentally installs Ubuntu over the existing operating system!)

Now you can boot up your first client computer. Make sure you specified in its BIOS settings that it should use the network as its first boot device. If everything goes well, you should see the usual Ubuntu installation screen, and you can choose from one of the installation options from the /var/lib/tftpboot/pxelinux.cfg/default file, e.g. linux for a normal Ubuntu desktop, server, etc..

Don't forget to change the order of the boot devices after the successful installation (e.g. disable booting over the network and make the HDD the first boot device) because otherwise you will start another installation!

Share this page:

13 Comment(s)

Add comment

Comments

From: Wim at: 2009-02-16 09:29:19

Running "sudo su - " gives you a root prompt, after typing your own password.

From: Anonymous at: 2009-06-15 11:19:58

There is no /etc/init.d/inetd in Ubuntu 8.04.2 LTS to fix this do


 /etc/init.d/openbsd-inetd restart


 

From: Michael Boman at: 2012-01-09 16:05:14

sudo -s

does the same thing. On some distributions may you want to do

sudo -i

instead.

From: at: 2007-03-18 23:57:08

First I'd like to thank you for a very useful and informative article. This has certainly helped me to get PXE set up on Linux much faster than figuring it all out myself. :)


One thing I'd like to point out is that if you intend on using PXE to deploy an OS to the hard disk of the target computers it is much easier and safer to simply press F12 during POST then muck about with the BIOS settings. F12 should make the machine perform a once-off network boot and saves a huge amount of time when deploying to multiple machines as no other configuration is required. This has long been the standard procedure for 'big-brand' corporate desktop PCs and has been adopted by most white box manufacturers as well.

From: at: 2006-12-19 13:49:18

Very nice tutorial falko, as always.


If you use this often, or if you have a large environment to maintain with a lot of servers, it might be a good idea to create a separate VLAN for the PXE stuff (Installation VLAN). That way, your live servers won't be affected when their BIOS settings are faulty.
You will have to alter the network settings or switch port after the installation has finished of course.


It is probably best to mirror the OS repositories on the PXE boot server as well, to limit bandwidth usage, not just for yourself but also for the server you download it off, and to speed up the install process. This is especially beneficial if you have to install a few servers at once. Like falko said, you will need a lot of free diskspace if you want to serve several different flavours.
When you have a local OS repository, it is also possible to tweak certain files a bit before they are used in the new installation. Things like site wide defaults and global config options etc.

From: at: 2006-12-20 16:37:32

I recommend the following changes in dhcpd configuration


deny unknown-clients;


as a global parameter and a


host server1 {  hardware ethernet 00:11:22:33:44:55; }


per server on the range section.


This will allow you to use another DHCP server on the same VLAN. Even if you don't have another DHCP server, this will allow you to have more control over who want to install a server via PXE.

From: at: 2006-12-20 21:18:36

Thanks a lot for this howto. It worked perfectly for me and I never even knew that something like this could be done!

From: at: 2007-09-06 12:06:08

I almost hate to ask because I'm such a Linux fanatic but I do end up having to re-install Windows systems.  Does anybody know of a way to use PXE for a Windows install?  I did some similar PXE work and I love it.  Find mine at: http://blog.banksnetworking.com/2007/08/28/pxe-for-the-masses/


 

From: at: 2008-04-18 22:00:52

On SLES (and I assume OpenSUSE) there is an install= kernel parameter where you can tell the installer where to grab the install media. It supports http and nfs and probably more.


kernel sles.kernel
append install=http://server/SLES (other options ommited)



When the installer starts it will not prompt you for the CDs any more. As a side note, there are tutorials out there on how to convert all the install CDs to a single directory tree so you can share it out.

From: Anonymous at: 2010-04-09 16:10:10

Nice recipe for setting up the DHCP + PXE end of the scheme. Would really like to see a tutorial for the next logical phase, which would be how to create local copies of the installation data. Being able to serve complete installations without leaving the LAN seems like a very good way to conserve bandwidth, but that requires setting up local mirrors/repositories/whatever-they're-calleds for each distro. My experience trying to do this for Debian Lenny has so far not worked well, and an explanation that includes a clear recipe such as this one would be most welcome.


Keep up the Good Work.


  
 

From: marco at: 2010-08-19 09:04:31

Same question of banksps. Is possible to deploy windows server also?

From: Anonymous at: 2010-10-01 04:44:34

can it possible to do unattend unstallation for windows operating system(xp,vista, win7) using same ubuntu PXE server

From: Leopoldo at: 2013-03-09 21:38:02

Hi. How should I set for the case to have an OpenSuse image made ??with Clonezilla, and use it to network nodes use it, I meen do not use "installers" but existing machine images. Thanks for the input, has served me well.