Official website for Linux User & Developer
FOLLOW US ON:
Jun
29

Unattended Ubuntu installations made easy

by Michael Reed

Michael Reed shows you how to automate the Ubuntu installation procedure to make light work of mass installations…

This article originally appeared in issue 88 of Linux User & Developer magazine.
Linux User & Developer, one of the nation’s favourite Linux and Open Source publications, is now part of the award winning Imagine Publishing family. Readers can subscribe and save more than 30% and receive our exclusive money back guarantee – click here to find out more.

Get your first digital copy of the magazine for iPhone and iPad free – just search for ‘Linux User’ on the Apple App Store now! twitter follow us

In creating Ubuntu Linux, Canonical has focused on ease of use, and this extends to the install procedure. To this end, Ubuntu eschewed many of the detailed questions that had discouraged potential Linux users of an earlier era. However, despite relative improvements in that area, the installation is still peppered with questions. This means that an admin tasked with the deployment of more than three or four computers is doomed to spend an entire morning dashing around, typing in responses to the same questions over and over again.

Fortunately, there is a solution in the form of unattended installs. An admin can alter a standard Linux distribution so that it no longer asks the user questions while installing. Obviously, the installer will need the information that it normally acquires by prompting the user for details, and the trick is to provide this information in advance in the form of what is called an ‘answer file’. It’s possible to divide automated installs into two main categories: customised CD-ROM and network installation. Both approaches have their relative strengths and weaknesses.

As with most things on Linux, there is more than one system that you can choose from, but we’re going to use something called Kickstart. Kickstart is an automatic install system that started life on Red Hat-derived Linux distributions, but it’s supported on Ubuntu. It comes with a GUI tool to create the configuration file, making it very simple to use. Let’s start with a quick breakdown of its core settings…

Configuration using the Kickstart GUI
A lot of the settings can be left in their default state, but here are some of the most important ones.

Basic Configuration: Location and language settings.
Installation Method: Switch this to ‘CD‑ROM’.
Partition information: Create a minimum of a root (/) partition of ext4 format and a swap partition. You can set the root partition to fill the free space on the disk.
User configuration: Create one user account and no root account if you are comfortable with Ubuntu’s standard rootless setup.
Package selection: This isn’t implemented in Ubuntu. However, it’s possible to add packages to the configuration file manually, by adding a line with ‘%packages’ (no quotes) followed by package names, each on its own line. By default, a Kickstart-modified Ubuntu CD-ROM will install the same Ubuntu desktop and associated programs that a standard Ubuntu CD‑ROM would.

Creating an unattended install consists of the following steps:
1. Create a configuration file, ks.cfg, using the GUI Kickstart tool.
2. Extract the files from the Ubuntu install ISO.
3. Add the ks.cfg file to the install disk and alter the boot menu to add automatic install as an install option.
4. Reconstitute the ISO file.

An important thing to remember with answer files is that if you forget to add something, the installation will be interrupted with a question in the usual way. This can be a problem, but on the other hand it ensures
that a Kickstart install disk isn’t rendered useless if the installer encounters an unforeseen circumstance and is forced to ask a question. It’ll probably take a couple of goes and a bit of experimentation before you create the perfect install disk, so we advise you to use a virtual machine (see our guide to VMs in issue #85) to test the disk before committing to burning a CD.

Pages: 1 2 3 4
  • Tell a Friend
  • Follow our Twitter to find out about all the latest Linux news, reviews, previews, interviews, features and a whole more.
    • Markus

      Hi and thank you for this guide.

      I just have one problem. I don’t have any network/internet attached to my computers. So the unattended ubuntu installation stops while searching for dhcp.. How can I skip this step? To stop it from searching for a network.
      Thank you

      Best regards Marku

    • Thomas Lange (Mrfai)

      Have a look at the FAI project. It supports Ubuntu since several years, and has a lot of users. It’s very flexible and can do much more than preseeding or installlinux.

      http://fai-project.org

    • http://www.linuxuser.co.uk/tutorials/unattended-ubuntu-installations/ Rama

      Hi,

      I have 10 system small lab i want to install fedora12 in all the system through NFS, HTTP & FTP.
      I configured nfs server one of the lab PC, but when i install through nfs in other PC it showing NFS not found.

      Can any one please help me out.

    • Pingback: SCCM 2012 SP1 Clients Uprade - 4sysops

    • http://www.utech.de Michael

      Thanks for the information, here is a shell script which is based on this article: http://www.utech.de/2013/05/shell-script-creating-a-cd-for-unattended-ubuntu-server-installations/

    • santhu ms

      iam getting this error when trying to create the iso using the above method
      error:
      I: -input-charset not specified, using utf-8 (detected in locale settings)
      genisoimage: Missing pathspec.
      Usage: genisoimage [options] -o file directory …

      Use genisoimage -help
      to get a list of valid options.