In this post i will detail how to automate the installation of Debian through the use of a Seed File and DHCP. If like me you install a few Debian Servers for things like web servers and stuff. you will have had to sit through the installation, clicking options. Well now you don’t have to.
Seed file. Place preseed.cfg on a web server in the root, or easy access path.
#_preseed_V1
## Country and system locale
d-i     debian-installer/locale string en_GB.UTF-8
d-i     debconf/language        string  en_GB.utf8
d-i     console-keymaps-at/keymap select gb
d-i     console-setup/layout string "United Kingdom"
## Network config
d-i netcfg/choose_interface select eth0
## Sort Keyboard settings
d-i     keyboard-configuration/xkb-keymap select gb
d-i     kbd-chooser/method      select "United Kingdom"
d-i     kbd-chooser/method      select "British English"
d-i     keyboard-configuration/variant  select  English (UK)
keyboard-configuration  keyboard-configuration/variant  select  English (UK)
## Sort Root Password
d-i     passwd/root-password password password123456789
d-i     passwd/root-password-again password password123456789
## Add new user and set password
user-setup-udeb passwd/username string  Bob.User
d-i     passwd/user-fullname string Dob.User
d-i     passwd/user-password password password
d-i     passwd/user-password-again password password
## Set Time Zone information
d-i     time/zone string Europe/London
tzsetup-udeb    time/zone       select  Europe/London
tzdata  tzdata/Zones/Europe     select  London
d-i     clock-setup/utc-auto boolean true
d-i     clock-setup/utc boolean true
d-i clock-setup/ntp-server string uk.pool.ntp.org
## Choose Local mirror to install software
d-i     mirror/https/mirror     select  deb.debian.org
choose-mirror-bin       mirror/http/countries   select  GB
## Select Software
popularity-contest popularity-contest/participate boolean false
tasksel tasksel/first   multiselect     ssh-server, standard
d-i     tasksel/first   multiselect     SSH server, standard system utilities
d-i pkgsel/include string sudo curl snmpd nano zip gnupg ntp hyperv-daemons salt-minion salt-common bmon mc htop
## Sort out PArtition
d-i     partman-partitioning/confirm_write_new_label boolean true
d-i     partman/choose_partition select finish
d-i     partman/confirm boolean true
d-i     partman/confirm_nooverwrite boolean true
d-i     partman-auto/method string regular
d-i     partman-md/device_remove_md boolean true
d-i     partman-lvm/confirm boolean true
d-i     partman-lvm/confirm_nooverwrite boolean true
d-i     partman-lvm/device_remove_lvm boolean true
## Sort Grub Stuff
d-i     grub-installer/only_debian boolean true
d-i     grub-installer/bootdev  string /dev/sda
d-i     grub-installer/bootdev  string default
d-i     finish-install/reboot_in_progress note
## Sort End of install to eject CD and reboot
d-i     cdrom-detect/eject boolean true
d-i     kbd-chooser/method      select "United Kingdom"
DHCP Config. The below is the DHCP Config for VyOS
service {
     dhcp-server {
         shared-network-name LAB {
             subnet 10.10.10.0/24 {
                 bootfile-name http://10.10.10.2/preseed.cfg
                 default-router 10.10.10.1
                 dns-server 8.8.8.8
                 domain-name LAB.local
                 range 0 {
                     start 10.10.10.10
                     stop 10.10.10.200
			}
		}
	}
}
}
Debian Installation Options


