Debian unattended Installation using a preseed file

I find installing Debian via VNC a time consuming process. Luckily there is an option to install Debian "unattended". You can do so using a preseed file to feed the selections and able to include advanced script customizations. If you come from CentOs World, then think of it as a kickstart file.

This is not new information, I just wanted the wonderful LES community to be aware of this great time saver.

The official source is at and a long file example at


  • A VM with Debian iso mounted e.g: Network install from a minimal CD
  • The preseed file is uploaded in some webserver and reachable by the VM.
  • The VM is online with vnc console support and is able to get an ip from your provider dhcp.
  • The VM is booted from the iso, here are screen shots on how to get there:

Here is a working file "preseed-test.cfg" that partitions the entire first disk with lvm in auto mode.

#####  save this file as preseed-test.cfg  and upload to your webserver

## locals and keys
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/xkb-keymap select fi
d-i keymap select fi

## detect network-hostname and auto setup
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string unassigned-hostname
d-i netcfg/get_domain string unassigned-domain

## mirrors and proxy if needed
d-i mirror/country string manual
d-i mirror/http/hostname string
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string

## time and zone
d-i time/zone string Europe/Helsinki
d-i clock-setup/utc boolean true
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string

 ## Partion ::: use first disk , entire disk as one with lvm
d-i partman/early_command string debconf-set partman-auto/disk "$(list-devices disk | head -n1)"
d-i partman-auto/method string lvm
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman-lvm/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman/confirm boolean true

## add root and user with passwords, change later
d-i passwd/root-login boolean true
d-i passwd/root-password password startSimple20
d-i passwd/root-password-again password startSimple20
d-i passwd/user-fullname string anthonySmith
d-i passwd/username string ant
d-i passwd/user-password password startSimple20
d-i passwd/user-password-again password startSimple20
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false

## lets install a standard server with ssh
tasksel tasksel/first multiselect standard,ssh-server
# add your cool tools
d-i pkgsel/include string ntp ssh wget curl

## upgrades
unattended-upgrades unattended-upgrades/enable_auto_updates boolean false
d-i pkgsel/update-policy select none
popularity-contest popularity-contest/participate boolean false

## install grub
d-i grub-installer/bootdev  string default
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true

 ## eject and reboot
d-i cdrom-detect/eject boolean true
d-i finish-install/reboot_in_progress note

The installation will execute in auto mode and the result of the above file is shown next, ignore sdb I was testing with another disk.


  • I advise to read each section in the above preseed file and change accordingly to you needs for example; timezone, keyboard layout, passwords.... refer to references and source page.
  • The partitioning can get tricky if you want to do a regular layout or exclude swap, but is doable.
  • You can add custom scripts before install upgrade section like this as an example:

    my other scripts

    d-i preseed/late_command string \
       in-target sh -c 'sed -i "s/^#PermitRootLogin.*\$/PermitRootLogin yes/g" /etc/ssh/sshd_config'; \
       in-target curl -sq -o /etc/sysctl.d/99-k8s.conf ;

What else have fun.


Guest post by @ehab

Previous Post