This script lets you create a completely automated Ubuntu Server installation CD (default:18.04.2 64 bit) that you can boot on any PC and have a working server in minutes without ever touching a keyboard.
To do so, simply modify the Requesting hostname
section.
By default, you are required to enter the hostname for each installation.
It downloads the official installation CD ISO from the ubuntu file servers, remasters it with a KickStart file, configures a few other files, and creates a new ISO file you can burn onto a disk.
Based on this askubuntu.com thread.
If you're happy with Ubuntu server 18.04.2 64 bit, just download/clone the repository, chdir to it, and run the script:
./make-automated-install-cd.sh
If you want another version, edit the script. (TODO: preload other distros/versions).
Default username is user
and password is pass
.
3 files are copied onto the CD image:
ks.cfg
- This is the kickstart configuration file. Either edit by hand, or usesystem-config-kickstart
. Copied to the root directory of the image (/
).isolinux.cfg
- Copied to /isolinux on the image. The only thing I changed from the default is to set thetimeout
value to 10 (instead of 0, which means no timeout) so that you don't have to select a language upon boot.txt.cfg
- This is the file that contains that list boot options when you boot a Linux box. You can set kernel boot parameters here. Note that I addedks=cdrom:/ks.cfg
to the params. Also copied to /isolinux on the image.
*.MD5SUM
is the md5sum file for default ISO file which the script points to. If you want to try a different distro, you'll need to download it manually, create a similar file with (md5sum foobar.iso > foobar.iso.MD5SUM
) and edit the script accordingly.
CD installation does not depend on a central network boot server to be configured on the same network as the machine. Also, I don't configure PXE/TFTP/DHCP often enough to be able to trouble-shoot them without googling. Then again, I only manage a few dozen machines.
I don't know much about kickstart besides what is in this repo. But, consider this: you can add a [%post] post section to the kick start configuration file which lets you run arbitrary commands after the installation (but before rebooting). This should be enough to create config files for you favorite configuration management system (puppet/chef/salt/cfengine/whatever), which you should be using instead of trying to hack at kickstart for post-installation configuration.
You can add the packages at the end of the ks.cfg file.
Probably, at least for Ubuntu and Debian based distros. Just edit the variables in the script and create a iso-file-name.MD5SUM file.
Because apparently, in order to extract an ISO file on linux, you need to mount it with the 'loop' option, and you need root permissions to mount anything on Linux. This is stupid. Note that if you google this, you'll find links that says you can use the 7zip program, BUT do not believe them: 7zip has a bug in Linux where files extracted from an ISO with long file names get truncated (!).
I'm not sure, but apparently you need to pass it to the kernel params along with the ks.cfg
file. There are default preseed files on the CD under the /preseed/ directory, and I use the ubuntu-server.seed
file. Perhaps there are interesting things in there.