Unattended Install for Ubuntu Image Processing Server

UNATTENDED INSTALL FOR UBUNTU IMAGE PROCESSING SERVER

 

Prepare the Ubuntu ISO for Unattended Installation

 

Australian mirror site with all recent Ubuntu releases:

http://mirror.waia.asn.au/ubuntu-releases/

Download a non graphical ubuntu installation ISO – server will do it.

Mount it

sudo su –

mkdir -p /mnt/iso
mount -o loop ubuntu_install.iso /mnt/iso

Copy the relevant files to a different directory

mkdir -p /opt/ubuntuiso
cp -rT /mnt/iso /opt/ubuntuiso

Prevent the language selection menu from appearing

cd /opt/ubuntuiso
echo en >isolinux/lang

Use GUI program to add a kickstart file named ks.cfg

apt-get install system-config-kickstart
system-config-kickstart

 

Sample ks.cfg:

Change the IP address details and user details and packages to match your needs. password is encrypted by system-config-kickstart program.

#Generated by Kickstart Configurator
#platform=AMD64 or Intel EM64T

#System language
lang en_AU
#Language modules to install
langsupport en_AU
#System keyboard
keyboard us
#System mouse
mouse
#System timezone
timezone –utc Australia/Sydney
#Root password
rootpw –disabled
#Initial user
user sample –fullname “Sample User” –iscrypted –password $1$xm6rggTW$VCwW3fbHA9hiube3eA1ZP1
#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
#System authorization infomation
auth –useshadow –enablemd5
#Network information
network –bootproto=static –ip=192.168.0.XXX –netmask=255.255.255.0 –gateway=192.168.0.254 –nameserver=8.8.8.8 –device=eth0
#Firewall configuration
firewall –disabled
#Install Extra Packages
%package
@ ubuntu-server
openssh-server
build-essential
net-tools
screen

 

Create a Preseed file

Next create a preseed file, to suppress other questions – I tried a few things and couldn’t prevent it asking me to press yes or not to partition the disk but that is the only part of the install which requires a response in the install.

Mine is ks.preseed in /opt/cd-image/preseed:

d-i partman/confirm_write_new_label boolean true
d-i partman/choose_partition select Finish partitioning and write changes to disk
d-i partman/confirm boolean true
d-i partman/confirm_write_new_label boolean true
d-i partman-lvm/confirm_nooverwrite boolean true

 

Edit isolinux/txt.cfg

Search for

label install
menu label ^Install Ubuntu Server
kernel /install/vmlinuz
append file=/cdrom/preseed/ubuntu-server.seed vga=788 initrd=/install/initrd.gz quiet —

add ks=cdrom:/ks.cfg and preseed file=/cdrom/preseed/ks.preseed to the append line. You can remove the quiet and vga=788 words. It should look like:

 

default install
label install
menu label ^Install Ubuntu Server
kernel /install/vmlinuz
append file=/cdrom/preseed/ubuntu-server.seed initrd=/install/initrd.gz ks=cdrom:/ks.cfg preseed/file=/cdrom/preseed/ks.preseed —

 

/opt/cd-image/preseed/ubuntu-server.seed:


# Suggest LVM by default.
d-i partman-auto/init_automatically_partition string some_device_lvm
d-i partman-auto/init_automatically_partition seen false
# Install the Ubuntu Server seed.
tasksel tasksel/force-tasks string server
# Only install basic language packs. Let tasksel ask about tasks.
d-i pkgsel/language-pack-patterns string
# No language support packages.
d-i pkgsel/install-language-support boolean false
# Only ask the UTC question if there are other operating systems installed.
d-i clock-setup/utc-auto boolean true
# Verbose output and no boot splash screen.
d-i debian-installer/quiet boolean false
d-i debian-installer/splash boolean false
# Install the debconf oem-config frontend (if in OEM mode).
d-i oem-config-udeb/frontend string debconf
# Wait for two seconds in grub
d-i grub-installer/timeout string 2
# Add the network and tasks oem-config steps by default.
oem-config oem-config/steps multiselect language, timezone, keyboard, user, network, tasks

 

Make the iso:

mkisofs -D -r -V “ATTENDLESS_UBUNTU” -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o /opt/autoinstall.iso /opt/cd-image/

 

Now you have an (almost) unattended install iso to create a bootable USB or CD if you’re feeling old school.

 

With thanks to:

https://askubuntu.com/questions/122505/how-do-i-create-a-completely-unattended-install-of-ubuntu

 

Further reading:

http://web.archive.org/web/20131102024835/https://help.ubuntu.com/community/InstallCDCustomization