'Linux: Unattended Installation With Debian Preseeding'

Sun 22 February 2009 Category: Linux

Debian Linux provides a mechanism to install the operating system without user intervention. This mechanism is called 'preseeding' and is similar to Red Hat Kick Start and Sun Solaris Jump Start.

The basic idea is that the installer is fed a recipe, according to which the system is installed. This recipe can be fed by a floppy, usb stick, cdrom, or through a web server over the network. To use such a recipe, just boot from a Debian CD-rom and issue the following command:

Floppy based: (you really shouldn't be using those anymore) 

Boot: auto file=/floppy/preseed.cfg

USB stick based:

Boot: auto file=/hd-media/preseed.cfg

Network based: 

Boot: auto url=http://internal.web.server.com/preseed.cfg

The only work you have to do is to create a preseed configuration file. This is really simple, since preseeding is well-documented and preseed configuration files are easy to understand.

d-i debian-installer/country string US 

d-i debian-installer/locale string en_US.UTF-8 

d-i mirror/country string manual 

d-i mirror/http/hostname string ftp.uk.debian.org 

d-i mirror/http/directory string /debian 

base-config apt-setup/hostname string ftp.uk.debian.org 

base-config apt-setup/directory string /debian

As you can see, it is just a text-based file that configures some variables that are used during installation. It is basically an answer file. Questions that are asked by the installer during installation are answered with the preseed file.

For a full example, take a look here. 

Very extensive documentation can be found here.

A  minimal debian installation without support for X can be installed within 2.5 minutes, assuming a network-based installation (tested in VMware Workstation). 

Please note that if your company uses Debian Linux not only for servers but also for desktops / laptops, preseeding is an ideal solution to provide your users with a new and fresh installation whenever they want. Users or sysadmins shouldn't be bussy manually installing these systems. 

I have implemented Debian Preseeding to create a fully unattended and automated installation of laptops, based on LUKS full disk encryption, which is supported by the Debian installer (!), with all required software installed. All additional software is installed with a custom installation framework based on shell-scripts. The installation framework makes sure that if anything goes wrong during installation, it is noticed. 

Unattended installation allows system administrators to quickly deploy new installations and guarantee that such installations are 100% correct. They rule out the human factor, which tends to introduce random errors. So take a look at Debian Preseeding and decide for yourself how useful it is.