Skip to content

Instantly share code, notes, and snippets.

@chusiang
Last active December 20, 2018 19:16
Show Gist options
  • Save chusiang/ed72adfd6e20ac3a0ddf to your computer and use it in GitHub Desktop.
Save chusiang/ed72adfd6e20ac3a0ddf to your computer and use it in GitHub Desktop.
Kickstart script for Ubuntu 14.04
# ====================================================================
# Author: 凍仁翔 / chusiang.lai (at) gmail.com
# Blog: http://note.drx.tw
# Filename: ks.cfg.
# Modified: 2015-02-25 10:20
# Description: Kickstart Configurator for Ubuntu 14.04.1 LTS server (amd64)
# Reference:
#
# 1. 作業系統自動安裝應答 CD 製作 - kickstart | iThome Download
# - http://download.ithome.com.tw/article/index/id/1792
# 2. KickstartCompatibility | Community Help Wiki
# - https://help.ubuntu.com/community/KickstartCompatibility
# 3. How do I create a completely unattended install of Ubuntu? | Ask Ubuntu
# - http://askubuntu.com/a/122506/74671
#
# ====================================================================
#platform=x86
#System language
lang en_US
#Language modules to install
langsupport en_US
#System keyboard
keyboard us
#System mouse
mouse
#System timezone
timezone Asia/Taipei
#Root password
rootpw --disabled
#Initial user
user jonny --fullname "Chu-Siang Lai" --iscrypted --password $1$3saQvX1g$Z0nr0oPCzKExBBGHunn6G0
#Reboot after installation
reboot
#Use text mode install
text
#Install OS instead of upgrade
install
#Use CDROM installation media
cdrom
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part /boot --fstype ext4 --asprimary --size=200
part / --fstype ext4 --asprimary --size=20000
part swap --asprimary --size=8000
part /home --fstype ext4 --grow --size=1
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=static --ip=10.62.173.121 --netmask=255.255.255.128 --gateway=10.62.173.126 --nameserver=8.8.8.8 --device=eth0
#Firewall configuration
firewall --disabled
#Do not configure the X Window System
skipx
# Intall the packages at setup
###############################
%packages
dnsutils
gdisk
iputils-tracepath
mdadm
openssh-server
openssh-client
tmux
vim
w3m
screen
# Run script after setup
#########################
%post
# Setting the default editor to Vim.
update-alternatives --set editor /usr/bin/vim.basic
default kickstart
label kickstart
menu label ^Auto install with Kickstart
kernel /install/vmlinuz
append file=/cdrom/preseed/ubuntu-server.seed vga=788 initrd=/install/initrd.gz ks=cdrom:/ks.cfg
label install
menu label ^Install Ubuntu Server
kernel /install/vmlinuz
append file=/cdrom/preseed/ubuntu-server.seed vga=788 initrd=/install/initrd.gz quiet --
label cloud
menu label ^Multiple server install with MAAS
kernel /install/vmlinuz
append modules=maas-enlist-udeb vga=788 initrd=/install/initrd.gz quiet --
label check
menu label ^Check disc for defects
kernel /install/vmlinuz
append MENU=/bin/cdrom-checker-menu vga=788 initrd=/install/initrd.gz quiet --
label memtest
menu label Test ^memory
kernel /install/mt86plus
label hd
menu label ^Boot from first hard disk
localboot 0x80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment