Network booting and installing

This page describes how to boot a machine up without using its local drives, ie no hard disk, CD, USB or diskette drives, and then either run Linux or install it. This is useful for two purposes:
  1. To boot into a 'live session', ie to get a Linux desktop session running without affectig the system already on that machine in any way. For instance when the machine normally runs Windows, or another distro of Linux, you can boot into a live session without the hard disk being accessed in any any. The current installation/system on the machine is completely untouched. The live session is a temporary one, and nothing need remain of it after you have rebooted the machine.
  2. To install Linux onto the local hard disk in the following scenarios:
    • The machine has no CD drive to install the software from;
    • You cannot or wish not to burn the Linux distribution, which you download as an iso file to CD media. This is an efficient way to install Linux onto a machine (the 'client machine' for the install) without needing a CD drive and without needing to write (ie "burn") a CD disk. Burning CDs is often very error-prone, unless you happen to have an exceptionally good CD writer. Most Linux distros are released as "iso" CD disk image files, originally so you would burn them to CD, boot a new machine using the CD, and install Linux. This page deals with using the same Linux installer iso file as a source, without needing to burn a CD and boot from it. I have used Ubuntu, Xubuntu and Oracle Enterprise Linux. The rest of this page focusses on using Ubuntu. For Ubuntu, there are various iso files to choose from:
      1. The Ubuntu Desktop iso, can allow you to boot into a live session, and optionally you can then install the Ubuntu desktop system onto your hard disk, from there.
      2. The Ubuntu Alternative iso, allows you to install a command line system, then later add any type of Ubuntu desktop if you wish.
      3. Xubuntu can be installed from the Xubuntu iso. Its installer is similar to the Ubuntu Alternative iso installer, in that it does not boot into a live session, but straight to an installer kernel, which gives you options to install or not X, and a GUI window manager and desktop.
The "client" machine needs to be connected via a local area network to the "netboot server" machine. This page describes how to configure the netboot server, and what to do on the client machine.

This page is updated for netbooting using the netboot software that is included in Xubuntu 9.04. The netboot and its config files for this version have changed since earlier versions.

Network Booting

Configuration Overview

Essentially you have two machines and probably a router on a local area network:
  1. The client machine, that you wish to install Ubuntu onto. This needs to be attached to the LAN via cable, not wireless, until the installation is complete.
  2. The server machine (or machines). I use a single machine running Ubuntu for this purpose, but any Linux, Mac or Windows machine would do the job, if you know how to set the following services up on them. This procedure describes Ubuntu servers. The following services are needed:
    • bootp
    • tftp
      For the sake of simplicity it is usually easiest to use a single machine to run both of these services.
    In addition, it is useful for the server machine to also be running any of http, ftp and/or nfs to serve the software packages to the installer process if you are using netboot to install a Linux distro.
  3. The router is probably running a DHCP service. If so, set this to assign the same ip address to the client machine as the bootp server does, although this is not technically necessary, as the assignments are made are different times. It is also your gateway to the internet.

Typical configuration showing all components to boot and install Ubuntu onto the client machine.  (click to enlarge)

Prepare the Client Machine

In the machine's bios setup, enable network booting, and set the network device to be the first bootable device. The menus to do this vary depending on the brand of bios in the machine. Once this is set, boot the machine and read the MAC address of the network device. This is usually displayed by the network device's netboot bios as it begins to search for a netboot server.

Set Up the bootp server

I place all the netboot and installation software (ie distro isos) in subdirectories of the same central location, for access by any of tftp, ftp, http and nfs servers. This location is shown here as "/netboot/". Each server is configured to include this location in its access path using its standard means of configuration. This makes the system easy to maintain.
/netboot/     - tftp server root(in /etc/defaults/tftpd-hpa),
and used by (/root/bin/)bootpd
i386 - hd for bootfiles (bf) below using i386 boot,
(also OK for netbooting AMD-64 machines),
also the root of paths in netboot config files
tftpd will not follow links, so both /netboot and /netboot/i386 must be real directories.

Register the client machine in /etc/bootptab.
client:\
ha="00:12:34:56:78:90":\ # Client machine MAC address
ip=192.168.0.101:\ # ip address when running pxeLinux
gw=192.168.0.1:\ # Router ip address
sm=255.255.255.0:\ # LAN subnet mask
td=/:\ # tftp 'root' relative to server's '-s'
hd=i386:\ # 'home' for bootfiles
bf=pxeLinux.0: # file to boot
(Alter this example; remove the trailing #comments, leave the \ at line ends)

/netboot/i386/ubuntu-installer/i386/boot-screens/text.cfg
default live
LABEL live
menu label ^Live Ubuntu desktop
menu default
kernel ubuntu-9.04-desktop/casper/vmlinuz
append initrd=ubuntu-9.04-desktop/casper/initrd.gz boot=casper \
netboot=nfs nfsroot=192.168.0.10:/tftpboot/i386/ubuntu-9.04-desktop --
The last line shown is relevant when "Installing from a live desktop session:" See the section below for details.

Server start/stop script
Use the attached bootpd script. This script is somewhat non-standard, in that if it is to start the bootp server, it also stops inetd if it is running, starts tftp and the nfs-kernel-server if they are not, and also warns if it cannot find what tftpd's home should be. Todo: Split the script into a netboot supervisor and true bootpd server wrapper, and perhaps cater for (x)inetd (especially so it is closer to something that would also work under Redhat?).

Set up the tftp server

  1. Install the Ubuntu tftpd-hpa package.
  2. Configure it: in /etc/default/tftpd-hpa
    RUN_DAEMON="yes"
    OPTIONS="-l -s /netboot"

Set up the DHCP service on the router

You can optionally assign an ip address in the router's DHCP service for the client machine, as identified by its MAC address. This is not used until the installation kernel starts up. It can be the same ip address as assigned by the bootp server, or a different address, and you can let the router assign a dynamic ip address.

Netboot the client machine

  1. Ensure the machines and router are all connected, including the router to the internet.
  2. Ensure the bootp and tftp servers are started (and extra servers: http, ftp, or nfs depending on if you are supplying packages to the installer from a local server)
  3. On the client machine
    1. Switch it on. It should find the bootp server, which will get the tftp server to supply the pxeboot menu.
    2. Select the appropriate Pxeboot menu option, eg as defined above. It should boot into a Live Ubuntu desktop session, or start an installer kernel, etc depending on your choice.

Installing from a live desktop session

There is an 'Install' Icon on the live desktop. Click it to start the installer. It would normally look in one of Ubuntu's internet repositories instead of a CD to install the packages from. However you can get it to get the packages from an NFS server instead. To do this, before netbooting the client machine:
  1. Install the nfs server, in addition to the servers specified in 'Server Setup' above.
  2. Unpack an Ubuntu Desktop iso where the nfs service has access to it. In this example it is /netboot/i386/(DISTRO-VERSION-EDITION), which is also the home for anonymous ftp sessions, ie the 'home' for 'ftp' in /etc/passwd. This way, an Ubuntu iso file needs to be unpacked once into one location only.
  3. Change as per specified in the last line above (netboot=nfs...).
    1. the initrd location is for tftp relative to the /[td]/[hd] location from /etc/bootptab, and
    2. the nfsroot is for nfs. In this case /netboot needs to be exported by nfs server via /etc/exports.
  4. Netboot the client machine as specified above. After it boots into the Live Ubuntu desktop session, start the 'Install' desktop icon. It will (?"boot" the installer and also? Todo - recheck this) get all the packages to build your new installation from, via nfs from the server specified.

Installing Xubuntu using the Alternative iso

This is useful for installing onto machines where the installation from the live session fails. Examples are: some laptops and machines with odd video devices that the live installer has problems with. Also method allows you to get all the packages from the same server via ftp or http.
  1. Set up the Netboot Menu: Here are two installation boot methods, run from netboot menu items in /tftpboot/i386/ubuntu-installer/i386/boot-screens/text.cfg for normal and expert mode installs of Xubuntu:

    LABEL xubuntu-cli
    menu label Install Command-line Xubuntu expert mode
    kernel ubuntu-installer/i386/linux
    append initrd=ubuntu-installer/i386/initrd.gz tasks=standard \
    pkgsel/language-pack-patterns= pkgsel/install-language-support=false -- quiet
    LABEL xubuntu-expert-cli
    menu label Install Command-line Xubuntu expert mode
    kernel ubuntu-installer/i386/linux
    append initrd=ubuntu-installer/i386/initrd.gz priority=low vga=791 tasks=standard \
    pkgsel/language-pack-patterns= pkgsel/install-language-support=false -- quiet

    The second example (at LABEL xubuntu-expert-cli) shows:
    • using the alternative install kernel for a client machine with an Intel CPU (/i386/),
    • "priority=low": running the 'expert level' installation, so we can select to get the packages via ftp or http
    • how to specify installation options via the usage of "pkgsel" options
    • "vga=791": using a vga framebuffer option, ie set for a typical laptop
     
  2. Set up a local repository: It makes good sense to set up an ftp or http server for the installer to get the distro's packages from locally instead of over the internet, and thus save a considerable amount of download.For multiple ubuntu .iso's/CD's comprising a release, unpack each .iso and concatenate all into a single structure. Common files are identical between most directories, and the packages are the only difference from one iso to the next. Thus five iso's get merged into a single pseudo-CD repository.

    • For ftp: Install an ftp server, in addition to the servers specified in 'Server Setup'. I haved used vsftpd (Set 'anonymous_enable=YES' in the vsftpd server's config file /etc/vsftpd.conf), and proftdp. The following is the relevant configuration lines for anonymous access via proftpd, set in in /etc/proftpd/proftpd.conf:

      <Anonymous ~ftp >
      User ftp
      Group nogroup
      UserAlias anonymous ftp
      DirFakeUser on ftp
      DirFakeGroup on ftp
      RequireValidShell off
      MaxClients 5
      DisplayLogin welcome.msg
      DisplayChdir .message
      <Directory *>
      <Limit WRITE>
      DenyAll
      </Limit>
      </Directory>
      </Anonymous>
       
    • For http: Install apache, in addition to the servers specified in 'Server Setup'. Configure access to /netboot, eg in /etc/apache2/conf.d/netboot.conf:

      Alias /ixa /netboot/i386/xubuntu-9.04-alternate
      <Directory /netboot/i386/xubuntu-9.04-alternate>
      Options MultiViews FollowSymLinks Indexes
      Order deny,allow
      Deny from all
      Allow from 127.0.0.0/255.0.0.0 192.168.0.0/255.255.0.0 ::1/128
      </Directory>
     
  3. Netboot the client machine as before, and select a netboot menu option as per above. These start the Ubuntu installer ("ubuntu-installer/i386/linux") directly, instead of the gui desktop.
    1. When prompted for the source of the distro packages, select ftp (or http), and the correct ip address (eg 192.168.0.10) and location -
      • on an ftp server, location: "ixa", where /ixa could be a link (in /netboot) to the full path of the latest release i386/xubuntu-9.04-alternate/, or
      • on an http server, location: "ixa", where ixa could be an alias in /etc/apache2/conf.d/netboot.conf
    2. The alternative install should run uneventfully
    3. On reboot, to install a full gui desktop, install the appropriate meta-package, eg run the command -
      sudo apt-get install ubuntu-desktop
      or
      sudo apt-get install xubuntu-desktop
      or select a subset of packages to install a lightweight Xubuntu GUI desktop this article on Distrowatch:
      sudo apt-get install xorg gdm xfce4 xfce4-goodies
Č
ċ
ď
bootpd
(3k)
David Tangye,
May 28, 2009 5:18 AM