Ubuntu Server installation can take some time. Imagine repeating this process a dozen, even 100 times, when installing Ubuntu Server in an enterprise. Yes, you could install many services on a single server, but that’s appropriate only for a test system. Production systems today dedicate specific servers for individual services.
In fact, some organizations dedicate multiple servers to single service. (For example, I understand some enterprises dedicate a dozen servers just to the Domain Name Service [DNS].) With the advantages associated with virtualization, I suspect even some smaller organizations now configure 100 or more virtual servers (on fewer physical systems).
To keep the workload manageable, administrators need to be able to automate the Ubuntu installation process. Automation of any Linux installation requires an “answers file” that configures the installation with information that would otherwise require real-time manual input. As befits the choices associated with open source software, Ubuntu includes two different ways to automate the installation process. As Ubuntu developers (as of this writing) focus on the Kickstart tool developed by Red Hat for its Linux distributions, I focus on that choice. The principles of Kickstart for Ubuntu and Red Hat are the same. The questions asked during the installation can be automatically answered with a single text file. Once the text file is configured, it’s possible to install nearly identical systems quickly.
Before using Kickstart on an Ubuntu release, install the applicable Kickstart configuration tool.
In the Kickstart Configurator screen’s left pane, select Installation Method. The options are straightforward
$ sudo apt-get install system-config-kickstart
Assuming you’ve installed the Secure Shell (SSH) server during the installation process, first make sure it’s active on the Ubuntu server with the following command:
$ sudo /etc/init.d/ssh start
Now you should be able to log in from a remote system, through a user account on the Ubuntu Server system. From any connected remote system, log in with the following command (substitute your account name for yours):
$ ssh -X user@ubuntumyserver
Be aware that the -X switch enables forwarding of X client information
On the Ubuntu server, run the ifconfig command to look for the local IP address. An excerpt of the output should appear similar to the following. (In my case, the IP address is 192.168.0.102. Your IP address will probably be different.)
eth0 Link encap:Ethernet HWaddr 00:0c:29:15:2a:4e
inet addr: 192.168.0.102 Bcast:192.168.0.255 Mask: 255.255.255.0
# Install the Kickstart Configurator on the Ubuntu Server system with the following command:
$ sudo apt-get install system-config-kickstart
# Start the GUI in a remote system. (In this case, I do so on an Ubuntu laptop system, in the GNOME desktop environment.)
# Open a command line interface in the noted GUI. One method is to choose Applications | Accessories | Terminal.
# In the command line interface that appears, note the hostname or IP address of the Ubuntu server. Based on the IP address found in step 1, I log in to the Ubuntu server with my account, as shown below. Your IP address and account name will probably be different. If the hostname is configured in /etc/hosts or a locally authoritative DNS server, substitute the hostname for the IP address.
$ ssh -X firstname.lastname@example.org
# If you’re using ssh to connect to this particular Ubuntu server for the first time, a warning message should appear . Assuming both systems are on a private network, and you’re confident that the network is secure, type yes to the following question and press ENTER.
Are you sure you want to continue connecting (yes/no)?
# Enter the password for the specified user on the Ubuntu server. (In my case, it’s user users’s password.)
# You’re now logged into the Ubuntu server from a remote client, and can now access X clients. Run the following command to open the Kickstart Configurator:
$ sudo system-config-kickstart
Final Comments on the Kickstart Configurator
After you’ve created desired installation settings, choose File | Save File to save the settings created with a filename of your choice. The standard from Red Hat distributions (which you do not have to follow) is ks.cfg.
Even though the Kickstart Configurator is open on a remote system, the ks.cfg file is saved on the Ubuntu server. The default save directory is the home directory of the associated user (in my case, that’s the /home/username directory).
Boot an Installation with a Kickstart File
There are several ways to start an automated installation using a Kickstart configuration file. First, the Kickstart file could be included with the CD or attached to some other media such as a USB key. It’s best to set it up on a server. The default directory for the Ubuntu implementation of Apache is /var/www.
A directory on a network server is a handy way to set up multiple Kickstart files. For example, you could set up ks1.cfg for the first server to be configured, ks2.cfg for the second server, and so on. Such files can easily be customized with different IP addresses, hostnames, and more. Once loaded, they’re accessible by default
you could boot the target server with a CD using the technique, from the boot: prompt. If you boot from an Ubuntu Server CD, you’ll see the standard boot menu. Press the ESC key, and then when prompted that to leave the Graphical Boot Menu, accept by selecting OK, which leads to the boot: prompt.
Then start the installation process with the desired Kickstart file. The following directive, when run at the boot: prompt, starts the installation (install) program, using the Kickstart configuration file (ks.cfg) available from the web server at the IP address shown.
boot: install ks=http://192.168.0.102/kick/ks.cfg
If the Kickstart configuration file is properly configured, installation should proceed automatically, until the standard Ubuntu Server is installed and the login prompt is available. When you boot Ubuntu Server without a GUI, you might need to press ENTER before the following login prompt appears:
Ubuntu myserver myserver1 tty1