Index: /trunk/src/VBox/Main/UnattendedTemplates/ol_ks.cfg
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/ol_ks.cfg	(revision 68201)
+++ /trunk/src/VBox/Main/UnattendedTemplates/ol_ks.cfg	(revision 68202)
@@ -24,5 +24,5 @@
 
 # System language
-lang en_US
+lang @@VBOX_INSERT_LOCALE@@
 
 # Disable the unsupported hardware popup (vmmdev?).
@@ -36,8 +36,8 @@
 
 # System timezone
-timezone  Europe/London
+timezone@@VBOX_COND_IS_RTC_USING_UTC@@ --utc@@VBOX_COND_END@@ @@VBOX_INSERT_TIME_ZONE_UX@@
 
 # Network information
-network  --bootproto=dhcp --device=eth0 --onboot=on
+network  --bootproto=dhcp --device=eth0 --onboot=on --hostname=@@VBOX_INSERT_HOSTNAME_FQDN_SH@@
 
 # System bootloader configuration
@@ -56,25 +56,48 @@
 
 # Reboot after installation
-reboot
+# Note! Not sure exctly when the --eject option was added. Need to find out an make it optional.
+reboot --eject
 
-## @todo @gnome-desktop is missing in OL-6.4
-%packages
+# Packages.  We currently ignore missing packages/groups here to keep things simpler.
+%packages --ignoremissing
 @base
 @core
+@@VBOX_COND_IS_NOT_MINIMAL_INSTALLATION@@
 @development
-@gnome-desktop
+@basic-desktop
 @desktop-debugging
+@desktop-platform
 @fonts
+@general-desktop
 @graphical-admin-tools
 @remote-desktop-clients
 @x11
+@@VBOX_COND_END@@
+
+# Prepare building the additions kernel module, try get what we can from the cdrom as it may be impossible
+# to install anything from the post script:
+kernel-headers
+kernel-devel
+glibc-devel
+glibc-headers
+gcc
+dkms
+make
+bzip2
+perl
+
 %end
 
-%post --log=/root/ks-post.log
-## @todo fix this.
-cp /cdrom/vboxpostinstall.sh /root/vboxpostinstall.sh && chmod a+x /root/vboxpostinstall.sh && /bin/bash /root/vboxpostinstall.sh
-eject /dev/sr0
-eject /dev/sr1
-eject /dev/sr2
-init 5
+# Post install happens in a different script.
+# Note! We mount the CDROM explictily here since the location differs between fedora 26 to rhel5
+#       and apparently there isn't any way to be certain that anaconda didn't unmount it already.
+%post --nochroot --log=/mnt/sysimage/root/ks-post.log
+df -h
+mkdir -p /tmp/vboxcdrom
+mount /dev/cdrom /tmp/vboxcdrom
+cp /tmp/vboxcdrom/vboxpostinstall.sh /mnt/sysimage/root/vboxpostinstall.sh
+chmod a+x /mnt/sysimage/root/vboxpostinstall.sh
+/bin/bash /mnt/sysimage/root/vboxpostinstall.sh --rhel
+umount /tmp/vboxcdrom
 %end
+
Index: /trunk/src/VBox/Main/UnattendedTemplates/redhat67_ks.cfg
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/redhat67_ks.cfg	(revision 68201)
+++ /trunk/src/VBox/Main/UnattendedTemplates/redhat67_ks.cfg	(revision 68202)
@@ -25,4 +25,8 @@
 # System language
 lang @@VBOX_INSERT_LOCALE@@
+
+# Disable the unsupported hardware popup (vmmdev?).
+# Note! Necessary with OL 6.4, perhaps rhel doesn't need this?
+unsupported_hardware
 
 # SELinux configuration
