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…

The Kickstart method can be extended to network deployments. This saves creating multiple copies of the CD-ROM when performing mass installations. It’s also useful in the case of machines that don’t feature a bootable optical drive. For this to work, the target machines must have a BIOS that supports booting from the network, but most modern systems do.

First a word of warning: this is a more complex procedure and you’re going to have to take over the network while you’re carrying out the install.

Set up/disable DHCP
If the computers on your network are normally assigned an IP address by a router using DHCP, you will have to temporarily alter your setup. This is because a client will attempt to boot off the DHCP server, and it needs to boot from a computer rather than a router. On the machine that you intend to use as a boot server, find the Ubuntu network settings and assign a static IP address to your computer. Do this by disabling DHCP in the settings and assigning an address such as 196.168.1.x. Replace the x with a number between 1 and 200. Having made these changes, reboot to make sure that your configuration is working and that you can access the internet.

If you already have a computer (rather than a router) that provides DHCP services for your network, you will have to consult the documentation for whatever software you use and either temporarily disable it or configure it for network booting.

Set up Dnsmasq
Dnsmasq is a tool that can provide not only DNS forwarding but also DHCP address assignment and also TFTP, a lightweight protocol that can transfer the boot files over a network. Thankfully, it’s extremely easy to set up and configure. Install it and open its config file:

sudo apt-get install dnsmasq
sudo gedit /etc/dnsmasq.conf

Most of the contents of this file can be ignored for our purposes. Scroll to the bottom and add the following lines, modifying them for your setup.

dhcp-range=192.168.1.200,192.168.1.250,12h
enable-tftp
tftp-root=home/YOUR USERNAME/tftpboot
dhcp-boot=pxelinux.0
dhcp-option=3,192.168.1.1 #gateway (usually the router)
dhcp-option=6,192.168.1.1 #DNS address

Now type ‘/etc/init.d/dnsmasq restart’, and if you see no errors, we are ready to proceed to the next stage.

Set up boot files
Download the Ubuntu install files from here. Please note that the netboot files are specific to the version that you wish to install on your clients. You are looking for a file called netboot.tar.gz. Once you have this, place it in your home directory, create a new directory and unpack the contents.

mkdir tftpboot
tar -xvzf netboot.tar.gz -C tftpboot/

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.