B.1. Introduction

Preseeding provides a way to set answers to questions asked during the installation process, without having to manually enter the answers while the installation is running. This makes it possible to fully automate most types of installation and even offers some features not available during normal installations.

Preseeding is not required. If you use an empty preseed file, the installer will behave just the same way as in a normal manual installation. Each question you preseed will (if you got it right!) modify the installation in some way from that baseline.

B.1.1. Preseeding methods

There are three methods that can be used for preseeding: initrd, file and network. Initrd preseeding will work with any installation method and supports preseeding of more things, but it requires the most preparation. File and network preseeding each can be used with different installation methods. With file and network preseeding the first few installer questions cannot be preseeded because the preconfiguration file is only loaded after they have been asked.

The following table shows which preseeding methods can be used with which installation methods.

Installation method initrd file network
CD/DVD yes yes no
netboot yes no yes
hd-media (including usb-stick) yes yes no

An important difference between the preseeding methods is the point at which the preconfiguration file is loaded and processed. For initrd preseeding this is right at the start of the installation, before the first question is even asked. For file preseeding this is after the CD or CD image has been loaded. For network preseeding it is only after the network has been configured.

In practical terms this means for file and network preseeding that the questions about language, country and keyboard selection will already have been asked. For network preseeding add to that any questions related to network configuration. Some other questions that are only displayed at medium or low priority (like the first hardware detection run) will also already have been processed.

Obviously, any questions that have been processed before the preconfiguration file is loaded cannot be preseeded. Section B.2.3, “Using boot parameters to supplement preseeding” offers a way to avoid these questions being asked.

B.1.2. Limitations

Although most questions used by debian-installer can be preseeded using this method, there are some notable exceptions. You must (re)partition an entire disk or use available free space on a disk; it is not possible to use existing partitions. You currently cannot use preseeding to set up RAID.

B.1.3. Running custom commands during the installation

A very powerful and flexible option offered by the preconfiguration tools is the ability to run commands or scripts at certain points in the installation. See Section B.5.1, “Shell commands” for details.

  • preseed/early_command: is run as soon as the preconfiguration file has been loaded

  • preseed/late_command: is run just before the reboot at the end of the install, but before the /target filesystem has been unmounted

B.1.4. Using preseeding to change default values

It is possible to use preseeding to change the default answer for a question, but still have the question asked. To do this the seen flag must be reset to “false” after setting the value for a question.

d-i foo/bar string value
d-i foo/bar seen false