我想设置一个 kickstart 来安装带有 KVM 的 VM。我如何指示 KVM 接受 EULA,然后在安装结束时关闭 VM?这是我的 kickstart 的摘录。我曾尝试将指令放在eula
前面shutdown
,但安装仍然停止,让我接受 EULA,之后没有关闭。
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use network installation
url --url="ftp://192.168.100.1/pub/inst"
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=vda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
# Network information
#network --bootproto=dhcp --device=eth0 --ipv6=auto --activate
network --bootproto=static --device=eth0 --gateway=192.168.100.1 --ip=192.168.100.151 --netmask=255.255.255.0 --nameserver=192.168.100.1 --activate
network --hostname=server.example.com
# Root password
rootpw --iscrypted $6$Kvuu9o2KGb35V8tO$gpHiAYy74tbhEO2rtruyGLNSnajNqfo9aB0/llewAO4o6ExsvFEFgkiprUdZRY5Zv/kj0PxnrimlcYmRIAWKq/
# System services
services --enabled="chronyd"
# System timezone
timezone Europe/Dublin --isUtc
user --name=user1 --password=$6$9sYmWd77jFtPW1Yq$GdTp3.trrKZfPJq92Edy0uI1De46Urel9biSrYUB/TKkXgowck5u0lQxiwe4HTy6D7I7fGQwkelJJOApYZ2a00 --iscrypted --gecos="user1"
# X Window System configuration information
xconfig --startxonboot
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=vda
#autopart --type=lvm
# Partition clearing information
clearpart --all --initlabel --drives=vda
part /boot --fstype="xfs" --size=500
part swap --fstype="swap" --size=1000
part / --fstype="xfs" --size=10000
part /home --fstype="xfs" --size=1000
shutdown
eula --agreed
%packages
@^graphical-server-environment
@base
@core
@desktop-debugging
@dial-up
@fonts
@gnome-desktop
@guest-agents
@guest-desktop-agents
@input-methods
@internet-browser
@multimedia
@print-client
@x11
chrony
kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end
答案1
为了避免 eula,您还需要禁用当前已启用的“firstboot”
# Run the Setup Agent on first boot
firstboot --enable
将其更改为:
# Run the Setup Agent on first boot
firstboot --disabled
然后它eula --agreed
应该就会生效(尽管在这里是多余的)。
答案2
#version=DEVEL
# System authorization information
auth --enableshadow --passalgo=sha512
# Use network installation
url --url="ftp://192.168.100.1/pub/inst"
# Use graphical install
graphical
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=vda
# Keyboard layouts
keyboard --vckeymap=us --xlayouts='us'
# System language
lang en_US.UTF-8
poweroff
# Network information
#network --bootproto=dhcp --device=eth0 --ipv6=auto --activate
network --bootproto=static --device=eth0 --gateway=192.168.100.1 --ip=192.168.100.151 --netmask=255.255.255.0 --nameserver=192.168.100.1 --activate
network --hostname=server.example.com
# Root password
rootpw --iscrypted $6$Kvuu9o2KGb35V8tO$gpHiAYy74tbhEO2rtruyGLNSnajNqfo9aB0/llewAO4o6ExsvFEFgkiprUdZRY5Zv/kj0PxnrimlcYmRIAWKq/
# System services
services --enabled="chronyd"
# System timezone
timezone Europe/Dublin --isUtc
user --name=user1 --password=$6$9sYmWd77jFtPW1Yq$GdTp3.trrKZfPJq92Edy0uI1De46Urel9biSrYUB/TKkXgowck5u0lQxiwe4HTy6D7I7fGQwkelJJOApYZ2a00 --iscrypted --gecos="user1"
# X Window System configuration information
xconfig --startxonboot
# System bootloader configuration
bootloader --append=" crashkernel=auto" --location=mbr --boot-drive=vda
#autopart --type=lvm
# Partition clearing information
clearpart --all --initlabel --drives=vda
part /boot --fstype="xfs" --size=500
part swap --fstype="swap" --size=1000
part / --fstype="xfs" --size=10000
part /home --fstype="xfs" --size=1000
%packages
@^graphical-server-environment
@base
@core
@desktop-debugging
@dial-up
@fonts
@gnome-desktop
@guest-agents
@guest-desktop-agents
@input-methods
@internet-browser
@multimedia
@print-client
@x11
chrony
kexec-tools
%end
%addon com_redhat_kdump --enable --reserve-mb='auto'
%end