I'd like to create a customized Ubuntu Server 12.04 ISO but couldn't find a clear approach on how to do it. I see that Ubuntu-builder is a very good app to create a customized Ubuntu Desktop, but what about Ubuntu Server?
I'd like to create a customized Ubuntu Server 12.04 ISO but couldn't find a clear approach on how to do it. I see that Ubuntu-builder is a very good app to create a customized Ubuntu Desktop, but what about Ubuntu Server?
Download
Download the Ubuntu server ISO from this location. You have the option to go 32-bit or 64-bit. The file name for the server edition will look similar to this:
I will assume the 13.10 64-bit version in the following instructions, so adjust the commands to the download you did. Keep a copy of your download so you can create multiple new versions from the original download in case you need to improve your project. I will also assume we use
~/Downloads/
to do all our work.Initial setup
This will create 2 directories "iso" and "isoNew" inside your Downloads directory, mount the ISO and copy the contents from "iso" over to "isoNew" to start a new project.
Put this in a text file, save it, make it executable and execute it:
mount: block device /discworld/Downloads/ubuntu-13.10-server-amd64.iso is write-protected, mounting read-only
Example images on how this will look like:
Executing:
Result:
Adding a Boot Menu Option
The menu options for the installer are stored in
isolinux/txt.cfg
and you can create new options in-betweendefault install
andlabel install
.This will create a new option called "Install Custom Ubuntu server" and it will add a kickstart file (the kickstart file is used to alter options; explained below):
myownoption
is just a label you can use to identify your option.default install
todefault myownoption
.Example:
and editing the file (I used nano but if available use gedit, vim or another editor). Here is my addition to this file where I used "lampserver" as a label and my seed will be named "lampserver" too.
Kickstart (graphically setting up a configuration file)
Documentation on preseeding/kickstart for Ubuntu. Ubuntu has limited support for kickstart (and preseeding); one of the missing things is a graphical interface for preseeding. Kickstart does have options for this (see the images) but these do not seem to work on Ubuntu. You can do this manually though (see Preseeding below).
Installation and starting kickstart:
** WARNING **
kickstart is bugged in Ubuntu 13.10 and when starting it, it errors out. Here is a fix. Put the patch in the comment into a text file, save it (I named it "patch") and commit it:
After that
ksconfig
worked and it will start a configuration editor that allows for you to manipulate a lot of options.See the Red Hat Linux 7.2: The Official Red Hat Linux Customization Guide for a description for all of the options you can set.
After you are done, save the changes to a
ks.cfg
file and copy it over to the ISO we are changing:ks-custom.cfg
in~/Downloads/newIso/preseed/
.Example where I inserted my credentials. I started it with
sudo ksconfig
from commandline.And saving it to the project:
Preseeding (manually setting up a configuration file)
Preseeding provides a way to set answers to questions asked during the installation process, without having to manually enter the answers while the installation is running. This makes it possible to fully automate most types of installation and even offers some features not available during normal installations.
Copy the preseed for the normal install over to your own label:
myownoption
to what you used.Now for changing settings. Using
debconf-get-selections
from thedebconf-utils
you can investigate what parameters you can use with specific software.Example setting this up:
And adding lamp-server to be installed with tasksel:
If you want to add packages "openssh" and "build-essential" you can include this in the seed file:
An example for openssh:
You can add these options to
custom-iso/preseed/ubuntu-myownoption.seed
.At the end of the preseed file you can add packages (random examples) like this:
%packages openssh-server mysql-server apache2
Offline installation
In case you add packages and those are NOT in the ISO the installer will download these from the repository. If you do not have an active internet connection this will be problematic so you will need to add all those packages (and dependencies) to your project and burn them to a DVD. Luckily the normal server ISO has a lot of room but beware: CD and/or DVDs do have a limited size.
Download all the DEB packages you need and store them in
~/Downloads/
. These 2 directories are needed on the new ISO:And this will update our project with the new packages:
Create the ISO
Result:
And now you can try the it out by actually burning and installing it. I would advise to use as virtual machine since it will be quicker for testing the initial created ISO (otherwise you keep rebooting).
And after installing VirtualBox I get the following menu:
Bug hunting
Ran into 1 problems while installing: the default was not selected.
Shadin. From your seed file in comment
probably needs to be like this:
Ditch the tasksel line of you do not want a LAMP server (ie. Apache, Mysql, Php)