问题
如果配置错误或者症状是已知问题,请提出建议。
查看其他文章并将 netcfg/choose_interface=eth0 设置为启动参数。
问题
预计静态网络和主机/域将根据以下预置文件中的设置在 /etc/network/interfaces 中配置。但是,已配置 DHCP。
cat /etc/network/interfaces
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
预置文件中的其他配置(如用户、磁盘分区等)均按预期配置。安装程序日志显示预置。
/var/log/installer# grep preseed syslog
Jun 21 17:24:51 kernel: [ 0.000000] Command line: initrd=/install/initrd.gz ks=http://xxx.96.102.150/ks.cfg preseed/url=http://xxx.96.102.150/preseed.txt
Jun 21 17:24:51 kernel: [ 0.000000] Kernel command line: initrd=/install/initrd.gz ks=http://xxx.96.102.150/ks.cfg preseed/url=http://xxx.96.102.150/preseed.txt
Jun 21 17:24:58 preseed: successfully loaded preseed file from file:///preseed.cfg
Jun 21 17:25:20 preseed: successfully loaded preseed file from /var/spool/kickseed/parse/preseed.cfg
Jun 21 17:25:46 anna[8833]: DEBUG: retrieving network-preseed 1.62ubuntu1
Jun 21 17:26:01 main-menu[7701]: INFO: Menu item 'network-preseed' selected
Jun 21 17:26:01 preseed: successfully loaded preseed file from http://xxx.96.102.150/preseed.txt
Jun 21 17:26:01 main-menu[7701]: (process:12262): 2016-06-21 17:26:01 URL:http://xxx.96.102.150/preseed.txt [7089/7089] -> "/tmp/debconf-seed" [1]
Jun 21 07:36:37 finish-install: info: Running /usr/lib/finish-install.d/07preseed
/var/log/installer/cdebconf/questions.dat 文件包含以下信息。
Name: netcfg/get_domain
Template: netcfg/get_domain
Value: demo.local
Owners: netcfg
Flags: seen
Name: netcfg/get_ipaddress
Template: netcfg/get_ipaddress
Value: xxx.96.102.139
Owners: netcfg
Flags: seen
...
解决方法
将网络配置放入 kickstart 中。
network --bootproto=static --device=eth0 --hostname=myhost --ip=xxx.96.102.139 --netmask=255.255.255.192 --gateway=xxx.96.102.129 --nameserver=xxx.96.102.141
环境
Static hostname: kickseed
Icon name: computer-vm
Chassis: vm
Boot ID: 2e4cc092b21c429e9e0e0d1a3316cf5d
Operating System: Ubuntu 14.04.3 LTS
Kernel: Linux 3.19.0-25-generic
Architecture: x86_64
快速启动
使用kickstart设置安装菜单语言、键盘。
配置
isolinux/isolinux.cfg
# D-I config version 2.0
include menu.cfg
default vesamenu.c32
prompt 0
timeout 1
ui gfxboot bootlogo
isoinux/txt.cfg
default install
label install
menu label ^Install Ubuntu Server
kernel /install/vmlinuz
append initrd=/install/initrd.gz ks=http://xxx.96.102.150/ks.cfg preseed/url=http://xxx.96.102.150/preseed.txt netcfg/choose_interface=eth0
预置文件
#--------------------------------------------------------------------------------
# NETWORK
#--------------------------------------------------------------------------------
# netcfg will choose an interface that has link if possible. This makes it
# skip displaying a list if there is more than one interface.
# netcfg/choose_interface=eth0 is set as the boot parameter.
#d-i netcfg/choose_interface select auto
# If you prefer to configure the network manually, uncomment this line and
# the static network configuration below.
d-i netcfg/disable_autoconfig boolean true
# Disable that annoying WEP key dialog.
d-i netcfg/wireless_wep string
# Static network configuration.
# IPv4 example
d-i netcfg/get_ipaddress string xxx.96.102.139
d-i netcfg/get_netmask string 255.255.255.192
d-i netcfg/get_gateway string xxx.96.102.129
d-i netcfg/get_nameservers string xxx.96.102.141
d-i netcfg/confirm_static boolean true
# Any hostname and domain names assigned from dhcp take precedence over
# values set here. However, setting the values still prevents the questions
# from being shown, even if values come from dhcp.
# Hostname:
netcfg netcfg/get_hostname string myhost
# Domain name:
netcfg netcfg/get_domain string demo.local
# If you want to force a hostname, regardless of what either the DHCP
# server returns or what the reverse DNS entry for the IP is, uncomment
# and adjust the following line.
d-i netcfg/hostname string myhost