Archive

Posts Tagged ‘unattended’

Ubuntu:Creating an unattended install

September 29, 2012 2 comments

Creating an unattended install consists of the following steps:

  • Create a configuration file, ks.cfg, using the GUI Kickstart tool.
  • Extract the files from the Ubuntu install ISO.
  • Add the ks.cfg file to the install disk and alter the boot menu to add automatic install as an install option.
  • Reconstitute the ISO file.

Kickstart tool is in the Ubuntu repositories, so search for it using the package manager or install it via the command line, as follows:

# 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 will be presented with a configuration page. Modify according to your requirment.

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:

In Terminal:

 # mkdir iso_mount
 # mount -o loop ubuntu-10.04.4-alternate-i386.iso /media/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:

In Terminal:

 # mkdir ubuntu_files
 # rsync -a /media/iso_mount/ ubuntu_files/
 # 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 like this: Add the following script at the top, below “default live” line.

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.

In Terminal:

 # 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 -input-charset iso8859-1 -o ~/autoinstall.iso .
Note: “.” Dot at the end of the above command is must which intimate the end of command.
Now write this bootable iso file to CD and start unattended ubuntu installation.
                                          Thank You