Official website for Linux User & Developer
FOLLOW US ON:
Jun
29

Unattended Ubuntu installations made easy

by Michael Reed

Michael Reed shows you how to automate the Ubuntu installation procedure to make light work of mass installations…

Much of Kickstart’s ease of use is thanks to its graphical configuration tool. It’s in the Ubuntu repositories, so search for it using the package manager or install it via the command line, as follows:

sudo apt-get install system-config-kickstart

Once installed, the Kickstart GUI tool should place itself in the System Tools menu of the application launcher. Launching it, you’ll be presented with about a dozen pages of options, but fortunately, all of them should be fairly self-explanatory to anyone who has installed Ubuntu before (see boxout to the right for more details).

Now save the Kickstart configuration file. By default it is called ks.cfg, but you can give it any name. It’s a good idea to check over the configuration file manually by launching it in a text editor. We now need to copy the files from the Ubuntu install CD-ROM into a directory on the hard disk. Download the alternative install ISO (rather than the live CD) from the Ubuntu website and place it in your home directory. Mount this disk from the command line:

mkdir iso_mount
sudo mount -o loop ubuntu-10.04-beta2-alternate-i386.iso iso_mount

This makes the files inside the ISO accessible via the directory ‘iso_mount’. Note that you can browse this directory using a file manager, but we’d recommend doing the actual file copying from the command line because hidden files and directories must be preserved. Copy the files to a directory inside your home directory and make them writable with:

mkdir ubuntu_files
rsync -a iso_mount/ ubuntu_files/
sudo chmod -R 777 ubuntu_files

Place the Kickstart file that you have created into the ‘ubuntu_files’ directory. Now we have to tell the install system where to find the Kickstart configuration file when it boots. Load ‘text.cfg’, located in the ‘isolinux’ directory, into a text editor. This file contains the menu options that you first see when you boot an Ubuntu installation disk. Locate the menu options for a standard install and then cut and paste them so that you have a second copy. We’re going to alter it so that it looks something like this:

label autoinstall
menu label ^Automatically Install Ubuntu
kernel /install/vmlinuz
append file=/cdrom/preseed/ubuntu.seed initrd=/install/initrd.gz ks=cdrom:/ks.cfg –

We’ve altered the label and title of this new menu entry, added a reference to the location of the Kickstart file and removed the ‘quiet’ flag so that we get lots of progress information. This constitutes the entirety of the changes we have to make, and we can now re-create the ISO file.

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

Voilà, your non-interactive install disk is now ready. Take our tip: try booting the ISO inside a virtual machine to make sure it works. Notice that it does require some interaction at the very first menu. It is possible to edit things so that it won’t prompt for even that initial confirmation, but this is dangerous as this disk will cheerfully wipe a system. It also makes a great recovery disk that a non-expert can use to zero a system. However, if used in this role, you should explain that the disk is potentially dangerous and mark it appropriately.

Pages: 1 2 3 4
  • Tell a Friend
  • Follow our Twitter to find out about all the latest Linux news, reviews, previews, interviews, features and a whole more.
    • Markus

      Hi and thank you for this guide.

      I just have one problem. I don’t have any network/internet attached to my computers. So the unattended ubuntu installation stops while searching for dhcp.. How can I skip this step? To stop it from searching for a network.
      Thank you

      Best regards Marku

    • Thomas Lange (Mrfai)

      Have a look at the FAI project. It supports Ubuntu since several years, and has a lot of users. It’s very flexible and can do much more than preseeding or installlinux.

      http://fai-project.org

    • http://www.linuxuser.co.uk/tutorials/unattended-ubuntu-installations/ Rama

      Hi,

      I have 10 system small lab i want to install fedora12 in all the system through NFS, HTTP & FTP.
      I configured nfs server one of the lab PC, but when i install through nfs in other PC it showing NFS not found.

      Can any one please help me out.

    • Pingback: SCCM 2012 SP1 Clients Uprade - 4sysops

    • http://www.utech.de Michael

      Thanks for the information, here is a shell script which is based on this article: http://www.utech.de/2013/05/shell-script-creating-a-cd-for-unattended-ubuntu-server-installations/

    • santhu ms

      iam getting this error when trying to create the iso using the above method
      error:
      I: -input-charset not specified, using utf-8 (detected in locale settings)
      genisoimage: Missing pathspec.
      Usage: genisoimage [options] -o file directory …

      Use genisoimage -help
      to get a list of valid options.