preseed
Table of Content
preseed¶
brief steps¶
You can feed the preseed configuration file to let Debian installer complete the OS installation.
- Prepare preseed.cfg files, each with machine-specific parameters such as hostname and NIC settings
- Host the preseed files on plain http
- quick one would be to just run
python -m http.server 8080
- quick one would be to just run
- On Debian Installation menu, enter grub menu and run three lines below
grub command line
linux /install.amd/vmlinuz auto=true preseed/url={IPADDR of the server hosting the preseed file}:8080/{preseed file name} priority=critical ---
initrd /install.amd/initrd.gz
boot
Debian official docs¶
https://www.debian.org/releases/stable/amd64/index.en.html
Appendix B. Automating the installation using preseeding
Example¶
Here is my preseed.cfg I used to install Debian 12.4 on [Hyper-V].
- lang is English
- country is Japan
- keymap is jp
- tz is utc
- nic ipv4 static address
- root user password set
- user name and password set
- disk is lvm, guided
- installation packages are standard and ssh
preseed.cfg
# static nic configuration
d-i preseed/early_command string kill-all-dhcp; netcfg
# language, keymap, and locale
d-i debian-installer/language string en
d-i debian-installer/country string JP
d-i debian-installer/locale string en_US.UTF-8
d-i keyboard-configuration/xkb-keymap select jp
# nic
d-i netcfg/choose_interface select auto
d-i netcfg/use_autoconfig boolean false
d-i netcfg/disable_autoconfig boolean true
d-i netcfg/disable_dhcp boolean true
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options select Configure network manually
d-i netcfg/get_ipaddress string 192.168.1.71
d-i netcfg/get_netmask string 255.255.255.0
d-i netcfg/get_gateway string 192.168.1.1
d-i netcfg/get_nameservers string 192.168.1.55 192.168.1.59
d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string vcp
d-i netcfg/get_domain string v.blink-1x52.net
d-i netcfg/hostname string vcp
d-i netcfg/wireless_wep string
# hardware firmware
d-i hw-detect/firmware-lookup string never
d-i hw-detect/load_firmware boolean false
# apt mirror and proxy
d-i mirror/country string manual
d-i mirror/http/hostname string deb.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
# root
# generate password string using mkpasswd
d-i passwd/root-password-crypted password {root password crypted string using mkpasswd here}
# user
d-i passwd/user-fullname string {username here}
d-i passwd/username string {username here}
d-i passwd/user-password-crypted password {user password crypted string using mkpasswd here}
# clock, ntp
d-i clock-setup/utc boolean true
d-i time/zone string UTC
d-i clock-setup/ntp boolean true
# disk
d-i partman-auto/method string lvm
d-i partman-auto-lvm/guided_size string max
d-i partman-lvm/device_remove_lvm boolean true
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-auto/choose_recipe select atomic
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-md/confirm boolean true
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
# package installation - standard and ssh-server
d-i apt-setup/cdrom/set-first boolean false
tasksel tasksel/first multiselect standard, ssh-server
# grub
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
# done
d-i finish-install/reboot_in_progress note