Skip to content

Instantly share code, notes, and snippets.

@dariusc93
Forked from vrillusions/_README.mkd
Last active August 29, 2015 14:19
Show Gist options
  • Save dariusc93/b9729deab48a1e43d76c to your computer and use it in GitHub Desktop.
Save dariusc93/b9729deab48a1e43d76c to your computer and use it in GitHub Desktop.
#
#Generic Kickstart template for Ubuntu
#Platform: x86 and x86-64
#
# Customized for Server 14.04 minimal vm install
#
# Usage:
# - Look through config for any changes you want to do. You may want to change
# the initial admin user. Currently username is ubuntu and password is
# ChangeMe. Also may want to change the list of installed packages. Tried to
# keep it as minimal as possible.
# - Place this somewhere that the vm will be able to see. Web server on LAN
# would work best.
# - OPTIONAL: If you are going to make a bunch of these then may want to setup
# a local apt proxy. Install apt-cacher-ng on some system and edit the line
# below.
# - Create a vm with 8gb drive. You can make a larger one but should have 8
# minimum. Also tip for people setting up in vmware the kernel has support
# for VMXNET3 compiled in so you can use it for initial install.
# - Boot up from iso.
# - Hit F4 and choose 'Install a minimal virtual machine'
# - This is required even though we set it below.
# - Press F6 and hit escape so you edit the boot line. Add the following to the
# end before the --. For example if you did include the '--' the end of boot
# line would be:
#
# ks=http://your-server.example.com/ks-minimalvm.cfg --
#
# - That's it! It will grab an ip via dhcp on eth0 and setup the system.
#
# Tweaks:
# - Some people would argue I made too many partitions. Feel free to adjust if
# you set things up differently. I highly recommend at least a /var and /home
# to make sure neither of those filling up will halt the whole system.
# - After partitioning with an 8gb volume you'll have about 1gb left in lvm to
# either expand one of the existing vms or to add a new partition. Again my
# suggesting is a second drive for /opt and/or /srv. If you mess up the OS
# you can unmount the second drive and mount it on a new vm that has the OS
# rebuilt on it.
# - The post script adds the noatime,nodev to options. In some circumstances
# you need the access time (most common use is the mail spool to know when
# you last checked for mail). In those instances you may want to change it to
# relatime for home and/or var.
# - The post script will set the default umask from 022 to 027. This means
# files created will not be world-readable. This is good to have for security
# but if you don't want that comment it out.
#
# License:
# I'm pretty sure this falls under being so small it's not copyrightable but
# just in case anyone is worried I am licensing this under creative commons
# CC-0 (public domain), the full license text is availabe at
# https://creativecommons.org/publicdomain/zero/1.0/
#
# References:
# - http://petersmithphotog.no-ip.biz/wiki/index.php/Unattended_Install
# - https://help.ubuntu.com/14.04/installation-guide/amd64/ch04s06.html
# Load the minimal server preseed off cdrom
# This should be done when you follow directions above
preseed preseed/file=/cdrom/preseed/ubuntu-server-minimalvm.seed
# Use proxy. Install apt-cacher-ng somewhere. Uncomment this and adjust the
# url as appropriate (default port is 3142)
#preseed mirror/http/proxy string http://192.168.1.2:3142/
# System language
lang en_US
# Language modules to install
langsupport en_US
# System keyboard
keyboard us
# System mouse
mouse
# System timezone
timezone America/New_York
# Root password
rootpw --plaintext RootTest2015
# Reboot after installation
reboot
# Use text mode install
text
# Install OS instead of upgrade
install
# Installation media
cdrom
# Ignore errors about unmounting current drive (happens if reinstalling)
# BUG: this just seems to default the selection to yes?
# Both without owner:
#preseed partman/unmount_active boolean true
# And with owner:
#preseed --owner partman-base partman/unmount_active boolean true
# When I run the debconf-get-selections --installer it shows the owner as unknown
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr yes
# Partition clearing information
clearpart --all --initlabel
# partition
part / --fstype=ext4
# Don't install recommended items by default
preseed base-installer/install-recommends boolean false
# System authorization infomation
# The enablemd5 has to be there although it will still use salted sha256
auth --useshadow --enablemd5
# Network information
network --bootproto=static --device=eth0
# Firewall configuration
firewall --disabled --trust=eth0 --ssh
# Policy for applying updates. May be "none" (no automatic updates),
# "unattended-upgrades" (install security updates automatically), or
# "landscape" (manage system with Landscape).
preseed pkgsel/update-policy select unattended-upgrades
# Do not configure the X Window System
skipx
# Additional packages to install
# - Uncomment the open-vm-tools line if this is going to run in vmware and are
# not going to use vmware-tools that's distributed with it. Don't think the
# --no-install-recommends is needed to not install desktop tools but doesn't
# hurt anything
%packages
# Since I don't install recommended it leaves out some things that should
# probably be installed like openssl and python 2.7
ca-certificates
openssl
python
wget
tcpd
# End all the recommended packages that are still useful
openssh-server
#open-vm-tools --no-install-recommends
curl
screen
vim
%post
# Clean up
apt-get -qq -y autoremove
apt-get clean
rm -f /var/cache/apt/*cache.bin
rm -f /var/lib/apt/lists/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment