Redhat – CentOS 7 kickstart accept EULA and shutdown

centos7kickstartkvm-virtualizationredhat

I want to setup a kickstart to install a VM with KVM. How do I instruct KVM to accept the EULA and then shutdown the VM at the end of the installation? Here is an extract of my kickstart. I have tried to put the eula instruction before the shutdown but still installation stoped for me to accept the EULA and did not shutdown after that.

#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

Best Answer

To avoid the eula you also need to disable 'firstboot' which you currently have enabled

# Run the Setup Agent on first boot
firstboot --enable

Change that to:

# Run the Setup Agent on first boot
firstboot --disabled

Then the eula --agreed should take effect (though it's redundant here).