Skip to content

Instantly share code, notes, and snippets.

@squarism
Last active November 2, 2023 20:18
Show Gist options
  • Save squarism/247ad7d8f2ebadb88d5566cfbdd7beb7 to your computer and use it in GitHub Desktop.
Save squarism/247ad7d8f2ebadb88d5566cfbdd7beb7 to your computer and use it in GitHub Desktop.
A debian 12 preseed
#_preseed_V1
# <CHECK_THIS>
d-i debian-installer/locale string en_US
d-i keyboard-configuration/xkb-keymap select us
d-i netcfg/choose_interface select auto
# we will set the hostname on the grub boot off the .iso
# you can set it here but you'll have to edit this txt file before every machine install
# d-i netcfg/get_hostname string unassigned-hostname
# it will detect our domain name, so we don't need this
# d-i netcfg/get_domain string unassigned-domain
# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string
# <CHECK_THIS> you might want to change these too ...
d-i mirror/country string US
d-i mirror/http/hostname string debian.osuosl.org
d-i mirror/http/directory string /debian
d-i passwd/root-login boolean true
d-i passwd/make-user boolean true
d-i passwd/root-password-crypted password <REPLACE_ME>
# To create a normal user account.
d-i passwd/user-fullname string You
d-i passwd/username string you
d-i passwd/user-password-crypted password <REPLACE_ME>
# The user account will be added to some standard initial groups
d-i passwd/user-default-groups string audio cdrom video sudo
# Controls whether or not the hardware clock is set to UTC.
d-i clock-setup/utc boolean true
# <CHECK_THIS> timezone setting, you can google these timezone strings
d-i time/zone string US/Pacific
# Controls whether to use NTP to set the clock during the install
d-i clock-setup/ntp boolean true
# NTP server to use. The default is almost always fine here.
#d-i clock-setup/ntp-server string ntp.example.com
### Partitioning
d-i partman-auto/init_automatically_partition select biggest_free
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
# You can choose one of the three predefined partitioning recipes:
# - atomic: all files in one partition
# - home: separate /home partition
# - multi: separate /home, /var, and /tmp partitions
d-i partman-auto/choose_recipe select atomic
# This makes partman automatically partition without confirmation, provided
# that you told it what to do using one of the methods above.
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
### Apt setup
# Choose, if you want to scan additional installation media
# (default: false).
d-i apt-setup/cdrom/set-first boolean false
### Package selection
tasksel tasksel/first multiselect standard
d-i pkgsel/include string openssh-server build-essential sudo
# disable dial-home, this is a VM
popularity-contest popularity-contest/participate boolean false
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
# Avoid that last message about the install being complete.
d-i finish-install/reboot_in_progress note
# This will prevent the installer from ejecting the CD during the reboot,
# which is useful in some situations. This won't actually eject the CD or .ISO in UTM.
d-i cdrom-detect/eject boolean true
# post install commands are not exactly secure because the system is in single-user mode
# so be careful what you do.
# the system is mounted under /target until it reboots
# add sudo group for no password because this is what we want for ansible (in the future)
d-i preseed/late_command string sed -i 's|^%sudo\s\+ALL=(ALL:ALL) ALL|%sudo ALL=(ALL:ALL) NOPASSWD: ALL|' /target/etc/sudoers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment