4.6. Automatic Installation

For installing on multiple computers it's possible to do fully automatic installations. Ubuntu packages intended for this include fai (which uses an install server), replicator, systemimager, autoinstall, and the Ubuntu Installer itself.

4.6.1. Automatic installation using the Ubuntu Installer

The Ubuntu Installer supports automating installs via preconfiguration files. A preconfiguration file can be loaded from the network or from removable media, and used to fill in answers to question asked during the installation process.

The preconfiguration file is in the format used by the debconf-set-selections command. A well documented and working example that you can edit is in Section C.1, “Preconfiguration File Example”.

Alternatively, one way to get a complete file listing all the values that can be preseeded is to do a manual install, and then use debconf-get-selections, from the debconf-utils package, to dump both the debconf database and the cdebconf database in /var/log/installer/cdebconf to a single file:

$ debconf-get-selections --installer > file
$ debconf-get-selections >> file

However, a file generated in this manner will have some items that should not be preseeded, and the file in Section C.1, “Preconfiguration File Example” is a better starting place for most users.

Once you have a preconfiguration file, you can edit it if necessary, and place it on a web server, or copy it onto the installer's boot media. Wherever you place the file, you need to pass a parameter to the installer at boot time to tell it to use the file.

To make the installer use a preconfiguration file downloaded from the network, add preseed/url=http://url/to/preseed.cfg to the kernel boot parameters. Of course the preconfiguration will not take effect until the installer manages to set up the network to download the file, so this is most useful if the installer can set up the network via DHCP without asking any questions. You may want to set the installation priority to critical to avoid any questions while the network is being configured. See Section 5.2.1, “Ubuntu Installer Parameters”.

To place a preconfiguration file on a CD, you would need to remaster the ISO image to include your preconfiguration file. See the manual page for mkisofs for details. Alternatively, put the preseed file on a floppy, and use preseed/file=/floppy/preseed.cfg

If you'll be booting from a USB memory stick, then you can simply copy your preconfiguration file onto the memory stick's filesystem, and edit the syslinux.cfg file to add preseed/file=/hd-media/preseed.cfg to the kernel boot parameters.

4.6.2. Automatic installation using Kickstart

The Ubuntu installer has preliminary support for automating installs using Kickstart files, as designed by Red Hat for use in their Anaconda installer. This method is not as flexible as the preconfiguration file method above, but it requires less knowledge of how the installer works.

This section documents only the basics, and differences between Anaconda and the Ubuntu installer. Refer to the Red Hat documentation for detailed instructions.

To generate a Kickstart file, install the system-config-kickstart package and run system-config-kickstart. This offers you a graphical user interface to the various options available.

Once you have a Kickstart file, you can edit it if necessary, and place it on a web, FTP, or NFS server, or copy it onto the installer's boot media. Wherever you place the file, you need to pass a parameter to the installer at boot time to tell it to use the file.

To make the installer use a Kickstart file downloaded from a web or FTP server, add ks=http://url/to/ks.cfg or ks=ftp://url/to/ks.cfg respectively to the kernel boot parameters. This requires the installer to be able to set up the network via DHCP on the first connected interface without asking any questions; you may also need to add ksdevice=eth1 or similar if the installer fails to determine the correct interface automatically.

Similarly, to make the installer use a Kickstart file on an NFS server, add ks=nfs:server:/path/to/ks.cfg to the kernel boot parameters. The method supported by Anaconda of adding a plain "ks" boot parameter to work out the location of the Kickstart file from a DHCP response is not yet supported by the Ubuntu installer.

To place a Kickstart file on a CD, you would need to remaster the ISO image to include your Kickstart file, and add ks=cdrom:/path/to/ks.cfg to the kernel boot parameters. See the manual page for mkisofs for details. Alternatively, put the Kickstart file on a floppy, and add ks=floppy:/path/to/ks.cfg to the kernel boot parameters.

4.6.2.1. Additions

The Ubuntu installer supports a few extensions to Kickstart that were needed to support automatic installations of Ubuntu:

  • The rootpw command now takes the --disabled option to disable the root password. If this is used, the initial user will be given root privileges via sudo.

  • A new user command has been added to control the creation of the initial user:

    user joe --fullname "Joe User" --password iamjoe
    

    The --disabled option prevents any non-root users from being created. The --fullname option specifies the user's full name, as opposed to the Unix username. The --password option supplies the user's password, by default in the clear (in which case make sure your Kickstart file is kept confidential!); the --iscrypted option may be used to state that the password is already MD5-hashed.

  • A new preseed command has been added to provide a convenient way to preseed additional items in the debconf database that are not directly accessible using the ordinary Kickstart syntax:

    preseed --owner gdm shared/default-x-display-manager select gdm
    

    The --owner option sets the name of the package that owns the question; if omitted, it defaults to d-i, which is generally appropriate for items affecting the first stage of the installer. The three mandatory arguments are the question name, question type, and answer, in that order, just as would be supplied as input to the debconf-set-selections command.

4.6.2.2. Missing features

As yet, the Ubuntu installer only supports a subset of Kickstart's features. The following is a brief summary of features that are known to be missing:

  • LDAP, Kerberos 5, Hesiod, and Samba authentication.

  • The auth --enablecache command to enable nscd.

  • The bootloader --linear, --nolinear, and --lba32 options for detailed LILO configuration.

  • Upgrades. To upgrade from one Ubuntu release to another, use the facilities provided by apt and its frontends.

  • Partitioning of multiple drives. Due to current limitations in the partition manager, it is only possible to partition a single drive.

  • Using the device command to install extra kernel modules.

  • Driver disks.

  • Firewall configuration.

  • Installation from an archive on a local hard disk or from an NFS archive.

  • The lilocheck command to check for an existing LILO installation.

  • Logical Volume Management (LVM) configuration.

  • Restrictions of a partition to a particular disk or device, and specifications of the starting or ending cylinder for a partition.

  • Checking a partition for bad sectors.

  • RAID configuration.

  • The xconfig --monitor option to use a specified monitor name.

  • Most package groups. As special cases, the "Ubuntu Desktop" and "Kubuntu Desktop" groups install the standard Ubuntu or Kubuntu desktop systems respectively, and any group name not containing a space (for example, "ubuntu-desktop") causes packages with the corresponding Task: header in the Packages file to be installed.

  • Pre-installation scripts and non-chrooted post-installation scripts may only be shell scripts; other interpreters are not available at this point in the installation.