Of course you will first need to create a preconfiguration file and place it in
the location from where you want to use it. Creating the preconfiguration file
is covered later in this appendix. Putting it in the correct location is fairly
straightforward for network preseeding or if you want to read the file off
a floppy or usb-stick. If you want to include the file on a CD or DVD, you
will have to remaster the ISO image. How to get the preconfiguration file
included in the initrd is outside the scope of this document; please consult
the developers documentation for debian-installer
.
An example preconfiguration file that you can use as basis for your own preconfiguration file is available from ../example-preseed.txt. This file is based on the configuration fragments included in this appendix.
If you are using initrd preseeding, you only have to make sure a file named
preseed.cfg
is included in the root directory of the
initrd. The installer will automatically check if this file is present and
load it.
For the other preseeding methods you need to tell the installer what file
to use when you boot it. This is normally done by passing the kernel a boot
parameter, either manually at boot time or by editing the bootloader
configuration file (e.g. syslinux.cfg
) and adding the
parameter to the end of the append line(s) for the kernel.
If you do specify the preconfiguration file in the bootloader configuration,
you might change the configuration so you don't need to hit enter to boot the
installer. For syslinux this means setting the timeout to 1
in syslinux.cfg
.
To make sure the installer gets the right preconfiguration file, you can optionally specify a checksum for the file. Currently this needs to be a md5sum, and if specified it must match the preconfiguration file or the installer will refuse to use it.
Boot parameters to specify: - if you're netbooting: preseed/url=http://host/path/to/preseed.cfg preseed/url/checksum=5da499872becccfeda2c4872f9171c3d - if you're booting a remastered CD: preseed/file=/cdrom/preseed.cfg preseed/file/checksum=5da499872becccfeda2c4872f9171c3d - if you're installing from USB media (put the preconfiguration file in the toplevel directory of the USB stick): preseed/file=/hd-media/preseed.cfg preseed/file/checksum=5da499872becccfeda2c4872f9171c3d
Note that preseed/url
can be shortened to just
url
and preseed/file
to just
file
when they are passed as boot parameters.
While you're at it, you may want to add a boot parameter
priority=critical
. This will avoid most
questions even if the preseeding below misses some.
It's also possible to use DHCP to specify a preconfiguration file to download from the network. DHCP allows specifying a filename. Normally this is a file to netboot, but if it appears to be an URL then installation media that support network preseeding will download the file from the URL and use it as a preconfiguration file. Here is an example of how to set it up in the dhcpd.conf for version 3 of the ISC DHCP server (the dhcp3-server Ubuntu package).
if substring (option vendor-class-identifier, 0, 3) = "d-i" { filename "http://host/preseed.cfg"; }
Note that the above example limits this filename to DHCP clients that identify themselves as "d-i", so it will not affect regular DHCP clients, but only the installer. You can also put the text in a stanza for only one particular host to avoid preseeding all installs on your network.
A good way to use the DHCP preseeding is to only preseed values specific to your network, such as the Ubuntu mirror to use. This way installs on your network will automatically get a good mirror selected, but the rest of the installation can be performed interactively. Using DHCP preseeding to fully automate Ubuntu installs should only be done with care.
Some parts of the installation process cannot be automated using some forms of preseeding because the questions are asked before the preconfiguration file is loaded. For example, if the preconfiguration file is downloaded over the network, the network setup must be done first. One reason to use initrd preseeding is that it allows preseeding of even these early steps of the installation process.
If a preconfiguration file cannot be used to preseed some steps, the install
can still be fully automated, since you can pass preseed values to the kernel
on the command line. Just pass path/to/var=value
for any of the preseed variables listed in the examples.
Note that some variables that are frequently set at the boot prompt have a shorter alias. If an alias is available, it is used in the examples in this appendix instead of the full variable.
A “--” in the boot options has special meaning. Kernel parameters that appear after it will be copied into the installed bootloader configuration (if supported by the installer for the bootloader). Note that the “--” may already be present in the default boot parameters.
The 2.4 kernel accepts a maximum of 8 command line options and 8 environment options (including any options added by default for the installer). If these numbers are exceeded, 2.4 kernels will drop any excess options and 2.6 kernels will panic. For kernel 2.6.9 and later, you can use 32 command line options and 32 environment options.
For most installations some of the default options in your bootloader
configuration file, like vga=normal
, may be safely
removed which may allow you to add more options for preseeding.
It may not always be possible to specify values with spaces for boot parameters, even if you delimit them with quotes.