Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Ubuntu 12.04 kickstart script
lang en_US
langsupport en_US
keyboard us
timezone Etc/UTC
# Ridiculous URL... I know...
url --url
#rootpw pa$$word # you should replace, and use --iscrypted
auth --useshadow --enablemd5
user --disabled
bootloader --location=mbr
zerombr yes
clearpart --all --initlabel
part /boot --fstype=ext2 --size=64
part swap --size=1024
part / --fstype=ext4 --size=1 --grow
# network --device=eth0 --bootproto=static --ip= --netmask= \
# --nameserver= --gateway=
firewall --disabled
# update fstab for the root partition
perl -pi -e 's/(errors=remount-ro)/noatime,nodiratime,$1,barrier=0/' /etc/fstab
# point sh to bash instead of dash
rm /bin/sh
ln -s /bin/bash /bin/sh
# add normal apt source list
cat <<'EOP'
deb precise main restricted universe
deb precise-security main restricted universe
deb precise-updates main restricted universe
) > /etc/apt/sources.list
apt-get update
apt-get upgrade -y
# install some additional packages
apt-get install -y xenstore-utils
# set up xenserver automation scripts
# curl $AUTOMATER_REPO/master/usr/sbin/xe-set-hostname > /usr/sbin/xe-set-hostname
# curl $AUTOMATER_REPO/master/usr/sbin/xe-set-network > /usr/sbin/xe-set-network
# curl $AUTOMATER_REPO/master/usr/sbin/generate-sshd-keys > /usr/sbin/generate-sshd-keys
# curl $AUTOMATER_REPO/master/etc/init/xe-automator.conf > /etc/init/xe-automator.conf
# chmod a+x /usr/sbin/xe-set-hostname
# chmod a+x /usr/sbin/xe-set-network
# chmod a+x /usr/sbin/generate-sshd-keys
# setup locales
locale-gen en_US.UTF-8
update-locale LANG="en_US.UTF-8"
echo 'LANG=en_US.UTF-8' >> /etc/environment
echo 'LC_ALL=en_US.UTF-8' >> /etc/environment
# install xe tools
# cd /tmp
# wget http://some/url/to/xe-guest-utilities_6.0.0-743_amd64.deb
# dpkg -i xe-guest-utilities_6.0.0-743_amd64.deb
# install paravirt kernel image
apt-get install -f -y linux-virtual
dpkg -l | grep generic | grep linux | awk '{print $2}' | xargs apt-get remove -y
# clean up some stuff
rm -f /etc/ssh/ssh_host_*
rm -f /var/cache/apt/archives/*.deb
rm -f /var/cache/apt/*cache.bin
rm -f /var/lib/apt/lists/*_Packages
Copy link

hamiltont commented May 19, 2014

Any chance you've got a PXE configuration file to load this kickstart?! I can't seem to find a set of boot options that successfully load the kickstart

Copy link

shamrin commented May 27, 2014

# Ridiculous URL... I know...
url --url

@ludo, why is this url needed?

Copy link

shamrin commented Aug 25, 2014

@ludo ping! (ridiculous url)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment