Ubuntu kickstart configuration file fails with error: The file may be corrupt

kickstarttftpUbuntu

I'm trying to install my ubuntu servers with iPXE. I have created the kickstart file with system-config-kickstart, but once downloaded by the installing server, the parsing fails with the error:

The installer failed to process the preconfiguration file from http://... The file may be corrupt

When looking at /var/lib/preseed/log, the last line is always

Syntax error: unable to determine template name

which does not provide much help while googling.

Here is a working (but incomplete) kickstart file:

preseed mirror/country string manual
preseed mirror/http/hostname string 192.168.1.70
preseed mirror/http/directory string /ubuntu
preseed apt-setup/security_host string 192.168.1.70
preseed apt-setup/security_path string /ubuntu

When I add any other line, (such as "lang en_US") the described error is shown.

Obviously, there is an error in the interpretation of the kickstart.cfg file, but I can't see where. Is there anyone having a clue on this issue?

EDIT: Is there any kind of order when creating the configuration file? Maybe the trouble comes from the fact that the instructions are not in the appropriate order? I'm starting to explore the less relevant ideas I'm afraid :/

Many thanks!

EDIT2: Here is my non working file:

preseed mirror/country string manual
preseed mirror/http/hostname string 192.168.1.70
preseed mirror/http/directory string /ubuntu
preseed apt-setup/security_host string 192.168.1.70
preseed apt-setup/security_path string /ubuntu
lang en_US

EDIT3: Here is the iPXE instructions to let the client download the kickstart file:

:ubuntu-amd64
echo Install Ubuntu
set base-url http://$my_ip_address/
kernel ${base-url}/ubuntu/linux
initrd ${base-url}/ubuntu/initrd.gz
imgargs linux auto=true hostname=ubuntu domain=my_domain interface=eth0 preseed/url=${base-url}/ubuntu/kickstart.cfg
boot

The appropriate file is getting downloaded. I suspect more a trouble while interpreting the instructions contained in this kickstart.

Best Answer

Change:

preseed/url=${base-url}/ubuntu/kickstart.cfg

into:

ks=${base-url}/ubuntu/kickstart.cfg

The boot option preseed/url expects to find a Preseed configuration file, but what you have here is a KickStart configuration file. These are two different systems, which is why you're getting the error. Using ks= tells the system it's loading a ks file, not a ps file.

For more info: Preseed is made by Debian, and can therefore automate almost anything on an Ubuntu installation. KickStart is made by RedHat and there is a project to make Ubuntu support Kickstart. This project is pretty dependable - most of the Ubuntu installation can be automated using a Kickstart file. However, if you want to automate some of the more minor stuff done by the Debian installer, you'll need to use preseed. Note that a Kickstart file can contain most of the preseed commands, simply by prefixing those commands with "preseed" and dropping the "d-i". That's what you're doing with lines like preseed mirror/country string manual - this is actually a preseed command that you are calling from within your kickstart configuration. Hope that helps!

Also, random note - for simple local CD mirrors you can probably remove most of the mirror/* commands and just use the kickstart keyword "url", which is properly understood by the ubuntu installer to be specifying the location of the installation media.

Related Topic