I need a CD or USB stick, that will install Ubuntu on a completely headless machine. Stick CD in and restart, no keyboard or screen should be involved.
There are a few obstacles:
- The language selection menu when you first boot the CD.
- The fact that the CD menu waits.
- The installer's asking questions during installation.
The complete solution is:
Remaster a CD, ie, download a non graphical ubuntu installation ISO (server or alternate installation CD), mount it
Copy the relevant files to a different directory
Prevent the language selection menu from appearing
Use GUI program to add a kickstart file named
ks.cfg
To add packages for the installation, add a
%package
section to theks.cfg
kickstart file, append to the end ofks.cfg
file something like this.This will install the ubuntu-server "bundle", and will add the
openssh-server
,ftp
andbuild-essential
packages.Add a preseed file, to suppress other questions
Set the boot command line to use the kickstart and preseed files
Search for
add
ks=cdrom:/ks.cfg
andpreseed/file=/cdrom/ks.preseed
to the append line. You can remove thequiet
andvga=788
words. It should look likeNow create a new iso
That's it. You'll have a CD that would install an Ubuntu system once you boot from it, without requiring a single keystroke.
The instructions at this question cover the process for creating an EFI bootable ISO (like the official Ubuntu x86_64 ISO).:
How do I create an EFI-bootable ISO of a customized version of Ubuntu?
The key differences are setting this as the preseed file:
Use this as the kickstart file:
Edit the grub EFI boot configuration for the ISO:
Set to:
Set isolinux/txt.cfg like this:
Create a dual boot catalog ISO:
Verify an EFI-bootable ISO has been created:
Outputs:
Here is a shell script which performs this procedure, thanks for the introduction: http://www.utech.de/2013/05/shell-script-creating-a-cd-for-unattended-ubuntu-server-installations/
The script you find following the link basically implements the procedure that @Elazar described, so the essential parts are just a screen above. I added the link to save somebody some time, and to make it a bit easier to repeat this for other versions of Ubuntu.
A rather simple method is described at the following link to an answer at AskUbuntu,
How can I make a bootable, unattended USB restore disk?
Create the system that you want with portable network connection, for example according to
Make a [compressed] dd-image file of the system (I think this is easier than remastering).
Make a shellscript and call it via 'autostart' in a persistent live system according to this description. You can do it with minimal modifications (maybe match only the name of the compressed image file), or you can modify it to fit your particular case.