Automating the install with preseedings

strict warning: Only variables should be passed by reference in /home/cknowadmin/wiki.cknow.org/modules/book/book.module on line 559.

What is preseeding

When you are manually installing debian, you'll be presented with various questions which will be used to configure your debian system. What happens behind the scenes is that you're populating the debconf database, which is what debian and the d-i uses to configure your system. But instead of manually answering the question to fill the debconf database, there's also a way to pre-populate that database and the way to do that is through preseeding.

Preseeding is described in Appendix B of the debian manual.

Why preseeding

If you're a system administrator and need to install many workstations, chances are that you want some or all parts of it to be automated. Automating the install will save time and will ensure a (baseline) configuration on all your systems is the same.
In my case I have 2 reasons for automating the installation:

  1. When I install a debian system, I opt for a minimal installation and (later) add the various packages I want to create my working system. The reason for that is that I like to know (in general) which packages get installed so I know what my system is made of. Another reason is that I use KDE on my desktop, but I don't want to install the (meta-) package kde-full, since it will install a lot of packages I don't need. A third reason is that debian installs recommended packages by default now and that can cause packages to get installed which I don't want or need. The trigger for me to not install recommends by default is when I wanted to install subversion, it also wanted to install cvs.
    Maybe things have changed for the better now, which brings me to my second point.
  2. I like to experiment/play with a debian system, without messing up my main machine. I usually do that by creating a virtual machine (VirtualBox) and doing my experiments in there before 'committing' it to my main desktop or server. A virtual machine is also handy for testing other things out, like upgrading drupal from version 6 to 7. I also want to create virtual machines which help me with my programming (Java) tasks/hobbies.

Some of my wishes could also be fullfilled by using the snapshot feature of VirtualBox, but then you'd have to remember/document the things that you did in order to get where you wanted to. By creating a preseeding file I get the documentation automatically and allows me to execute that as many times as I want.
It should also be possible to use preseedings to create your own live-cd/system based on Debian Live, which is what I also like to experiment with.

Now that I've describe what preseeding is and reasons for using it, it's time to get down to business and start creating a preseed file.