preseed安装ubuntu见:https://www.haiyun.me/archives/1246.html
启动参数:
ks=https://www.haiyun.me/ubuntu-ks.cfg domain= hostname=ubuntu-server interface=auto netcfg/get_ipaddress=${ip} netcfg/get_netmask=${mask} netcfg/get_gateway=${rou} netcfg/get_nameservers=8.8.8.8 netcfg/disable_autoconfig=true
配置文件,ks不支持部分ubuntu设置,可在ks文件中嵌入preseed命令:
install
url --url=http://mirrors.aliyun.com/ubuntu/
text
skipx
unsupported_hardware
eula --agreed
#rootpw --plaintext 123456
#echo 'import crypt,getpass; print crypt.crypt(getpass.getpass(), "$6$16_CHARACTER_SALT_HERE")' | python -
rootpw --iscrypted $6$16_CHARACTER_SAL$dvFZEFR66m38M3u3K4os2Yi4j88oTRaF9Q7XkKK4VFlMlwS9l17oTjXI043rfpNxDkB8/1ntrOiAFQGeYgwEZ.
authconfig --enableshadow --passalgo=sha512
preseed passwd/make-user boolean false
keyboard --vckeymap=us --xlayouts='us'
lang en_US.UTF-8
timezone Asia/Shanghai
firstboot --disable
firewall --disabled
selinux --disabled
reboot
#network --bootproto=static --device=eth0 --gateway=192.168.168.1 --ip=192.168.168.50 --nameserver=192.168.168.1 --netmask=255.255.255.0 --ipv6=auto --activate
#network --hostname=ubuntu-server
preseed partman-lvm/device_remove_lvm boolean true
preseed partman-md/device_remove_md boolean true
#preseed partman-lvm/confirm boolean true
#preseed partman-lvm/confirm_nooverwrite boolean true
zerombr
clearpart --all --drives=sda
ignoredisk --only-use=sda
bootloader --location=mbr --boot-drive=sda
#autopart
#part / --asprimary --fstype ext4 --size=5120
#part swap --asprimary --size=1024
#part /home --asprimary --fstype ext4 --size=5120 --grow
part /boot --fstype ext4 --size 200 --asprimary
part swap --size 1024 --asprimary
part pv.01 --size 1 --grow --asprimary
volgroup rootvg pv.01
logvol / --fstype ext4 --vgname=rootvg --size=1 --grow --name=rootlv
#preseed anna/choose_modules string network-console
#preseed network-console/password password 123456
#preseed network-console/password-again password 123456
preseed pkgsel/update-policy select none
preseed pkgsel/upgrade select none
#ubuntu-minimal
%packages
openssh-server
%post
sed -ri 's/^#?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
%end
参考:
https://help.ubuntu.com/community/KickstartCompatibility
https://help.ubuntu.com/lts/installation-guide/i386/ch04s06.html
标签:none