<div dir="ltr">Due to changes in RHEL 8, the redhat67_ks.cfg Kickstart script included in the UnattendedTemplates directory does not work with CentOS 8. The patch below adds a Kickstart script for RHEL 8 and CentOS 8, and makes other changes to integrate the new script into VirtualBox. Following the pattern for redhat67_ks.cfg, the new script is named redhat8_ks.cfg. All comments in the new script are worded to mirror language and terms used in the RHEL 8 documentation; and all sections, commands, and options appear in the same order in both the new script and the documentation.<div><div><br></div><div>The install command has been deprecated in RHEL 8. In regard to the install command, the documentation states, "Use its methods as separate commands." The cdrom command was retained and now serves to specify that installation should occur from the first optical drive. The install command was removed from the new script.<br><br></div><div>The auth command has been deprecated in RHEL 8. Passwords are shadowed by default with sha512. The following auth command was removed from the new script:<br>auth  --useshadow  --passalgo=sha512<br><br>The default SELinux policy is enforcing. The following selinux command was removed from the new script:<br>selinux --enforcing<br><br></div><div>The documentation states, "Either the --vckeymap= or the --xlayouts= option must be used" for the required keyboard command, suggesting an OR rather than an AND. Nonetheless, both --vckeymap=us and --xlayouts='us' are used in the new script. Many examples of this usage can be found, and it does not appear to cause issues. The value "us" was specified to maintain consistency with the value that was specified in the redhat67_ks.cfg script.<br></div><div><br></div><div>In order to comply with the order demonstrated in the syntax shown in the documentation, the timezone command was changed as follows:</div><div>timezone@@VBOX_COND_IS_RTC_USING_UTC@@ --utc@@VBOX_COND_END@@ @@VBOX_INSERT_TIME_ZONE_UX@@</div><div>timezone @@VBOX_INSERT_TIME_ZONE_UX@@@@VBOX_COND_IS_RTC_USING_UTC@@ --utc@@VBOX_COND_END@@  </div><div><br></div><div>For the --plaintext option to the user command, the documentation states, "If this option is present, the password argument is assumed to be in plain text"; but it does not explicitly indicate plaintext is the default. The --plaintext option was added to the user command as follows:<br>user --name=@@VBOX_INSERT_USER_LOGIN_SH@@ --password=@@VBOX_INSERT_USER_PASSWORD_SH@@<br>user --name=@@VBOX_INSERT_USER_LOGIN_SH@@ --password=@@VBOX_INSERT_USER_PASSWORD_SH@@ --plaintext</div><div><br>For the network command, DHCP is the bootproto method used by default. In addition, due to a change in how network devices are named in RHEL 8, eth0 is not a valid device name by default; but the link keyword can be used to specify the first interface with its link in the up state. The network command was changed as follows:  <br>network  --bootproto=dhcp --device=eth0 --onboot=on --hostname=@@VBOX_INSERT_HOSTNAME_FQDN_SH@@<br>network --device=link --onboot=on --hostname=@@VBOX_INSERT_HOSTNAME_FQDN_SH@@</div><div><br>For the bootloader command, mbr is the default value for the location option. The bootloader command was changed as follows:</div><div>bootloader --location=mbr --append="nomodeset crashkernel=auto rhgb quiet"<br>bootloader --append="nomodeset crashkernel=auto rhgb quiet"<br></div><div><br>The autopart command automatically creates partitions in accordance with Red Hat recommendations. The value plain for the type option specifies "Regular partitions with no LVM." The following two part commands were changed to the single autopart command on the third line immediately below:<br>part / --fstype ext4 --size 6000 --grow --asprimary<br>part swap --size 1024<br>autopart --type=plain<br><br>Without the elfutils-libelf-devel package installed, post install scripting failed to compile kernel modules for VirtualBox Guest Additions, resulting in their failure to install. The elfutils-libelf-devel package was added to the %packages section in order to resolve this issue.<br><br>Only the new Kickstart script has been tested, and it has only been tested with CentOS 8. OS and Guest Additions both install. Full testing with RHEL 8 should be completed prior to integration.<br><br>I'm licensing this patch under the MIT license. Please review. Feedback is welcome. Thanks!<br><br>Timothy Tacker<br><br><br>---<br> src/VBox/Installer/Config.kmk                 |   1 +<br> .../Main/UnattendedTemplates/Makefile.kmk     |   1 +<br> .../Main/UnattendedTemplates/redhat8_ks.cfg   | 116 ++++++++++++++++++<br> src/VBox/Main/include/UnattendedInstaller.h   |  11 ++<br> 4 files changed, 129 insertions(+)<br> create mode 100644 src/VBox/Main/UnattendedTemplates/redhat8_ks.cfg<br><br>diff --git a/src/VBox/Installer/Config.kmk b/src/VBox/Installer/Config.kmk<br>index 077d6af6..0cbcfe8d 100644<br>--- a/src/VBox/Installer/Config.kmk<br>+++ b/src/VBox/Installer/Config.kmk<br>@@ -66,6 +66,7 @@ ifdef VBOX_WITH_UNATTENDED<br>         rhel4_ks.cfg \<br>       rhel5_ks.cfg \<br>       redhat67_ks.cfg \<br>+    redhat8_ks.cfg \<br>     win_nt5_unattended.sif \<br>     win_nt6_unattended.xml \<br>        \<br>diff --git a/src/VBox/Main/UnattendedTemplates/Makefile.kmk b/src/VBox/Main/UnattendedTemplates/Makefile.kmk<br>index c8baeaf5..cd15ffb4 100644<br>--- a/src/VBox/Main/UnattendedTemplates/Makefile.kmk<br>+++ b/src/VBox/Main/UnattendedTemplates/Makefile.kmk<br>@@ -32,6 +32,7 @@ ifdef VBOX_WITH_UNATTENDED<br>     rhel4_ks.cfg \<br>       rhel5_ks.cfg \<br>       redhat67_ks.cfg \<br>+    redhat8_ks.cfg \<br>     ol_ks.cfg \<br>          fedora_ks.cfg \<br>      suse_autoinstall.xml \<br>diff --git a/src/VBox/Main/UnattendedTemplates/redhat8_ks.cfg b/src/VBox/Main/UnattendedTemplates/redhat8_ks.cfg<br>new file mode 100644<br>index 00000000..d37f8baa<br>--- /dev/null<br>+++ b/src/VBox/Main/UnattendedTemplates/redhat8_ks.cfg<br>@@ -0,0 +1,116 @@<br>+#platform=x86, AMD64, or Intel EM64T<br>+#version=DEVEL<br>+<br>+<br>+## Installation program configuration and flow control commands:<br>+<br>+# Install from first optical drive.<br>+cdrom<br>+<br>+# Specify info as minimum log level on tty3 in Anaconda during installation.<br>+logging --level=info<br>+<br>+# Attempt to eject bootable media and reboot after installation.<br>+reboot --eject<br>+<br>+# Perform installation in text mode.<br>+text<br>+<br>+<br>+## System configuration commands:<br>+<br>+# Do not configure iptables rules.<br>+firewall --disabled<br>+<br>+# Set available keyboard layouts for system.<br>+keyboard --vckeymap=us --xlayouts='us'<br>+<br>+# Set language to use during installation and default to use on installed system.<br>+lang @@VBOX_INSERT_LOCALE@@<br>+<br>+# Set system root password using supplied plaintext.<br>+rootpw --plaintext @@VBOX_INSERT_ROOT_PASSWORD_SH@@<br>+<br>+# Set system time zone and indicate if hardware clock is UTC (Greenwich Mean) time.<br>+timezone @@VBOX_INSERT_TIME_ZONE_UX@@@@VBOX_COND_IS_RTC_USING_UTC@@ --utc@@VBOX_COND_END@@<br>+<br>+# Create new user on system and set password using supplied plaintext.<br>+user --name=@@VBOX_INSERT_USER_LOGIN_SH@@ --password=@@VBOX_INSERT_USER_PASSWORD_SH@@ --plaintext<br>+<br>+<br>+## Network configuration commands:<br>+<br>+# Configure network device and activate in Anaconda installation environment.<br>+#  Device specified in first network command activated automatically.<br>+#  DHCP method used by default.<br>+#  Device: Link keyword specifies first interface with link in up state.<br>+#  Onboot: Enable device at boot time.<br>+#  Hostname: Specify host name for installed system.<br>+network --device=link --onboot=on --hostname=@@VBOX_INSERT_HOSTNAME_FQDN_SH@@<br>+<br>+<br>+## Storage handling commands:<br>+<br>+# Specifify how boot loader installed.<br>+#  Location boot record written dependent on drive usage of MBR or GPT scheme.<br>+#  Append: Specifies additional kernel parameters.<br>+bootloader --append="nomodeset crashkernel=auto rhgb quiet"<br>+<br>+# Remove partitions from system prior to creation of new partitions.<br>+#  All: Erase all partitions on disks reachable by installation program, including attached network storage.<br>+#  Initlabel: Initialize disk(s) by creating default labels in respective architectures designated for formatting.<br>+clearpart --all --initlabel<br>+<br>+# Automatically create partitions.<br>+#  Type: Plain keyword specifies regular partitioning scheme with no LVM.<br>+#  Default file system is xfs.<br>+autopart --type=plain<br>+<br>+# Initialize invalid partition tables and destroy contents of disks with invalid partition tables.<br>+zerombr<br>+<br>+<br>+# Packages.  We currently ignore missing packages/groups here to keep things simpler.<br>+%packages --ignoremissing<br>+@base<br>+@core<br>+@@VBOX_COND_IS_NOT_MINIMAL_INSTALLATION@@<br>+@development<br>+@basic-desktop<br>+@desktop-debugging<br>+@desktop-platform<br>+@fonts<br>+@general-desktop<br>+@graphical-admin-tools<br>+@remote-desktop-clients<br>+@x11<br>+@@VBOX_COND_END@@<br>+<br>+# Prepare building the additions kernel module, try get what we can from the cdrom as it may be impossible<br>+# to install anything from the post script:<br>+kernel-headers<br>+kernel-devel<br>+glibc-devel<br>+glibc-headers<br>+gcc<br>+dkms<br>+make<br>+bzip2<br>+perl<br>+elfutils-libelf-devel<br>+<br>+%end<br>+<br>+<br>+# Post install happens in a different script.<br>+# Note! We mount the CDROM explictily here since the location differs between fedora 26 to rhel5<br>+#       and apparently there isn't any way to be certain that anaconda didn't unmount it already.<br>+%post --nochroot --log=/mnt/sysimage/root/ks-post.log<br>+df -h<br>+mkdir -p /tmp/vboxcdrom<br>+mount /dev/cdrom /tmp/vboxcdrom<br>+cp /tmp/vboxcdrom/vboxpostinstall.sh /mnt/sysimage/root/vboxpostinstall.sh<br>+chmod a+x /mnt/sysimage/root/vboxpostinstall.sh<br>+/bin/bash /mnt/sysimage/root/vboxpostinstall.sh --rhel<br>+umount /tmp/vboxcdrom<br>+%end<br>diff --git a/src/VBox/Main/include/UnattendedInstaller.h b/src/VBox/Main/include/UnattendedInstaller.h<br>index 5003613d..09988815 100644<br>--- a/src/VBox/Main/include/UnattendedInstaller.h<br>+++ b/src/VBox/Main/include/UnattendedInstaller.h<br>@@ -518,6 +518,17 @@ protected:<br> };<br> <br> <br>+/**<br>+ * RHEL 8 installer (same as RHEL 6 & 7, except for the kickstart template).<br>+ */<br>+class UnattendedRhel5Installer : public UnattendedRhel6And7Installer<br>+{<br>+public:<br>+    UnattendedRhel5Installer(Unattended *pParent) : UnattendedRhel6And7Installer(pParent, "redhat8_ks.cfg") {}<br>+    ~UnattendedRhel5Installer() {}<br>+};<br>+<br>+<br> /**<br>  * RHEL 5 installer (same as RHEL 6 & 7, except for the kickstart template).<br>  */<br>-- <br></div></div></div>