Skip to content

Instantly share code, notes, and snippets.

@mlgrm
Last active October 21, 2023 01:21
Show Gist options
  • Save mlgrm/59c4c35114bb3c9c971e7f3c7eb349b0 to your computer and use it in GitHub Desktop.
Save mlgrm/59c4c35114bb3c9c971e7f3c7eb349b0 to your computer and use it in GitHub Desktop.
preseed file for automating the install of ubuntu 18.04 desktop
# preseed.cfg
# adapted from http://bit.ly/2JjXqVF
# Newer ubiquity command
ubiquity partman-auto/disk string /dev/sda
ubiquity partman-auto/method string regular
ubiquity partman-lvm/device_remove_lvm boolean true
ubiquity partman-md/device_remove_md boolean true
ubiquity partman-auto/choose_recipe select atomic
# This makes partman automatically partition without confirmation
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
# Locale
d-i debian-installer/locale string en_US
d-i console-setup/ask_detect boolean false
d-i console-setup/layoutcode string us
# Network
d-i netcfg/get_hostname string $HOST
d-i netcfg/get_domain string localdomain
d-i netcfg/choose_interface select auto
# Clock
d-i clock-setup/utc-auto boolean true
d-i clock-setup/utc boolean true
d-i time/zone string $TIME_ZONE
d-i clock-setup/ntp boolean true
# Packages, Mirrors, Image
d-i mirror/country string $MIRROR_COUNTRY
d-i apt-setup/multiverse boolean true
d-i apt-setup/restricted boolean true
d-i apt-setup/universe boolean true
# Users
d-i passwd/user-fullname string $USER
d-i passwd/username string $USER
d-i passwd/user-password-crypted password $PASSWD_HASH
d-i passwd/user-default-groups string \
adm audio cdrom dip lpadmin sudo plugdev sambashare video
d-i passwd/root-login boolean false
# d-i passwd/root-password-crypted password rootEncryptedPasswd
d-i user-setup/allow-password-weak boolean true
# Grub
d-i grub-installer/grub2_instead_of_grub_legacy boolean true
d-i grub-installer/only_debian boolean true
d-i finish-install/reboot_in_progress note
# Custom Commands
ubiquity ubiquity/success_command string \
echo -e '#!/bin/bash\nsudo apt-get install -y curl && curl -sL bit.ly/mlgrm-post-install | bash' > /target/home/$USER/run_me
chmod +x /target/home/$USER/run_me
# apt-get update ;\
# apt-get install -y nvidia-driver-390 ;\
# sed -i -e 's/dns=dnsmasq/#dns=dnsmasq/' /target/etc/NetworkManager/NetworkManager.conf ;\
# cp -a /cdrom/scripts/ /target/root/ ;\
# cp -a /cdrom/salt/ /target/root/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment