我正在尝试使用 Ubuntu 16.04 通过 pxe 安装服务器。那么 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
我在日志中看到 kickstart 文件已加载,但网络设置失败。每次它都会回到 dhcp 并卡在那里。
我的 kickstart 文件如下所示
#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
看起来网络设置未加载...但我没有收到任何错误,为什么会发生这种情况...