Ubuntu 16.04. Netinstall kickstart fails

i’m trying to install a server via pxe with ubuntu 16.04. server. So what does fine is the PXE Boot

label   install (x86_64 - Ubuntu 16.04)
    menu    label   Installer (x86_64 - Ubuntu 16.04)
    kernel  install/Ubuntu/16.04/linux
    append  ks=http://insXXXX.XXXXXXX/kickstart/Ubuntu/16.04/release-XXXXXX.XXXXXXXXX.ks initrd=install/Ubuntu/16.04/initrd.gz

i see in the log the the kickstart file is loaded but i fails on network setup. evrytime it falls back to dhcp and there it stucks.

My kickstart file looks like this

#Generated by Kickstart Configurator
#platform=AMD64 or Intel EM64T

#System language
lang de_DE
#Language modules to install
langsupport de_DE
#System keyboard
keyboard de
#System mouse
mouse
#System timezone
timezone Europe/Berlin
#Network information
network --bootproto=static --ip=192.168.14.XXX --netmask=255.255.255.0 --nameserver=192.168.14.XXX --device=ens3
network --bootproto=static --ip=XXX.XXXXXXXXXXX --netmask=255.255.255.0 --gateway=XXX.XXX.XXX.1 --device=ens6
#Root password
auth       --enableshadow --enablemd5
rootpw     --iscrypted XXXXXXXXXXXXXXXXXXXXXXX
sshpw      --username=root XXXXXXXXXXXXXXXXXXXXXXX --iscrypted
#Initial user
user --disabled
#Reboot after installation
reboot
#Use text mode install
text
#Use interactive kickstart installation method
interactive
#Install OS instead of upgrade
install
#Use Web installation
url --url http://insXXX.XXXXXXXXXXX.com/Ubuntu/16.04/install
#System bootloader configuration
bootloader --location=mbr 
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel 
#Disk partitioning information
part swap --size 4000 
part / --fstype ext4 --size 1 --grow --noformat 
#System authorization infomation
auth  --useshadow  --enablemd5 
#Firewall configuration
firewall --disabled 
#Do not configure the X Window System
skipx
#Package install information
# Additional packages to install
%packages
ca-certificates
openssl
python
openssh-server
vim
nano

# Unmount drives with active partitions. Without this command all the installation process would stop and require confirmation to unmount drives that are already mounted.
d-i preseed/early_command string umount /media || true

# Don't install recommended items
d-i preseed base-installer/install-recommends boolean false

# Install only security updates automatically
d-i preseed pkgsel/update-policy select unattended-upgrades

# Fix locale
echo 'LANG="en_US.UTF-8"' > /etc/default/locale
echo 'LANGUAGE="en_US:en"' >> /etc/default/locale
echo 'LC_ALL="en_US.UTF-8"' >> /etc/default/locale

# Set hostname
sed -i "s/ubuntu/release-XXXXXX.XXXXXXXXXXX.de/g" /etc/hostname
sed -i "s/ubuntu/release-XXXXXX.XXXXXXXXXXX.de/g" /etc/hosts

%post
# SSH settings
sed -i -e 's/^PasswordAuthentication yes$/PasswordAuthentication no/g' \
       -e 's/^#PermitUserEnvironment no$/PermitUserEnvironment yes/g' \
       -e 's/^X11Forwarding yes$/X11Forwarding no/g' \
       -e 's/^Subsystem/#Subsystem/g' \
    /etc/ssh/sshd_config

# SSH keys
mkdir -m 0700                       /root/.ssh
wget  -O /root/.ssh/authorized_keys http://insXXXX.XXXXXXXXX.com/ssh/authorized_keys
chmod 0600                          /root/.ssh/authorized_keys


# Clean
apt-get -f -y install
apt-get -y autoremove
apt-get clean

it looks like network setting are not loaded… but i dont get any error why this happends …

Answer

Attribution
Source : Link , Question Author : Kjellson , Answer Author : Community

Leave a Comment