Index: /trunk/src/VBox/Installer/Config.kmk
===================================================================
--- /trunk/src/VBox/Installer/Config.kmk	(revision 68056)
+++ /trunk/src/VBox/Installer/Config.kmk	(revision 68057)
@@ -54,4 +54,22 @@
 
 #
+# List of unattended installation script templates (lives in
+# src/VBox/Main/UnattendedTemplates).
+#
+ifdef VBOX_WITH_UNATTENDED
+ VBOX_UNATTENDED_TEMPLATES := \
+ 	debian_preseed.cfg \
+ 	ubuntu_preseed.cfg \
+ 	fedora_ks.cfg \
+ 	ol_ks.cfg \
+ 	redhat67_ks.cfg \
+ 	win_nt5_unattended.sif \
+ 	win_nt6_unattended.xml
+else
+ VBOX_UNATTENDED_TEMPLATES :=
+endif
+
+
+#
 # DTrace globals.
 #
Index: /trunk/src/VBox/Installer/common/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Installer/common/Makefile.kmk	(revision 68056)
+++ /trunk/src/VBox/Installer/common/Makefile.kmk	(revision 68057)
@@ -35,21 +35,4 @@
 endif # VBOX_WITH_PYTHON
 
-ifdef VBOX_WITH_UNATTENDED
-
-INSTALLS += VBox-unattended-templates
-
-VBox-unattended-templates_INST = bin/unattended_templates/
-VBox-unattended-templates_MODE = a+r,u+w
-VBox-unattended-templates_SOURCES = $(VBOX_PATH_INST_COMMON_SRC)/unattended_templates/debian_preseed.cfg \
-	$(VBOX_PATH_INST_COMMON_SRC)/unattended_templates/ubuntu_preseed.cfg \
-	$(VBOX_PATH_INST_COMMON_SRC)/unattended_templates/redhat67_ks.cfg \
-	$(VBOX_PATH_INST_COMMON_SRC)/unattended_templates/ol_ks.cfg \
-	$(VBOX_PATH_INST_COMMON_SRC)/unattended_templates/fedora_ks.cfg \
-	$(VBOX_PATH_INST_COMMON_SRC)/unattended_templates/suse_autoinstall.xml \
-	$(VBOX_PATH_INST_COMMON_SRC)/unattended_templates/win_nt5_unattended.sif \
-	$(VBOX_PATH_INST_COMMON_SRC)/unattended_templates/win_nt6_unattended.xml
-
-endif # VBOX_WITH_UNATTENDED
-
 include $(FILE_KBUILD_SUB_FOOTER)
 
Index: /trunk/src/VBox/Installer/darwin/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Installer/darwin/Makefile.kmk	(revision 68056)
+++ /trunk/src/VBox/Installer/darwin/Makefile.kmk	(revision 68057)
@@ -567,4 +567,5 @@
 		$$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/components/*) \
 		$$(wildcard $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/accessible/*) \
+		$(addprefix $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UnattendedTemplates/, $(VBOX_UNATTENDED_TEMPLATES)) \
 		$(if-expr defined(VBOX_WITH_PYTHON), $(addprefix $(VBOX_PATH_DIST)/, $(VBOX_DI_VBAPP_PYTHON_FILES)),) \
                 $(if-expr defined(VBOX_WITH_JXPCOM), $(addprefix $(VBOX_PATH_DIST)/, sdk/bindings/xpcom/java/vboxjxpcom.jar),) \
@@ -700,6 +701,13 @@
 			$(VBOX_PATH_VBOX_APP_TMP)/Contents/$(f)$(NLTAB) )
 endif
+ifdef VBOX_UNATTENDED_TEMPLATES
+# Unattended installation template scripts.
+	$(MKDIR) -p -m 0755 -- $(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/UnattendedTemplates)
+	$(foreach file, $(VBOX_UNATTENDED_TEMPLATES) \
+		,$(INSTALL) -m 0655 $(VBOX_PATH_DIST)/VirtualBox.app/Contents/MacOS/UnattendedTemplates/$(file) \
+			$(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/UnattendedTemplates/$(file)$(NLTAB))
+endif
 ifdef VBOX_WITH_DTRACE
-	@# DTrace library, testcases and scripts.
+# DTrace library, testcases and scripts.
 	$(MKDIR) -p -m 0755 -- \
 		$(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/lib/$(KBUILD_TARGET_ARCH)/ \
@@ -712,5 +720,4 @@
 			$(VBOX_PATH_VBOX_APP_TMP)/Contents/MacOS/dtrace/$(file)$(NLTAB))
 endif
-
 	@# Signed the binaries and the application bundle.
 ifdef VBOX_SIGNING_MODE
Index: /trunk/src/VBox/Installer/linux/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Installer/linux/Makefile.kmk	(revision 68056)
+++ /trunk/src/VBox/Installer/linux/Makefile.kmk	(revision 68057)
@@ -241,12 +241,5 @@
 	vboxweb-service.sh \
 	VBox.png \
-	$(if $(VBOX_WITH_UNATTENDED), \
-	  unattended_templates/debian_preseed.cfg \
-	  unattended_templates/ubuntu_preseed.cfg \
-	  unattended_templates/fedora_ks.cfg \
-	  unattended_templates/ol_ks.cfg \
-	  unattended_templates/redhat67_ks.cfg \
-	  unattended_templates/win_nt5_unattended.sif \
-	  unattended_templates/win_nt6_unattended.xml,)
+	$(addprefix UnattendedInstall/,$(VBOX_UNATTENDED_TEMPLATES))
 
 ifdef VBOX_WITH_EXTPACK
Index: /trunk/src/VBox/Installer/solaris/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Installer/solaris/Makefile.kmk	(revision 68056)
+++ /trunk/src/VBox/Installer/solaris/Makefile.kmk	(revision 68057)
@@ -500,4 +500,9 @@
 endif
 
+# Unattended installation template scripts.
+ifdef VBOX_UNATTENDED_TEMPLATES
+ SOLARIS_COMMON += $(addprefix UnattendedTemplates/,$(VBOX_UNATTENDED_TEMPLATES))
+endif
+
 # DTrace library, testcase and scripts (as the rest of this file, this makes bold
 # ASSUMPTIONS about VBPX_INST_XXX variable values).
Index: /trunk/src/VBox/Installer/win/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Installer/win/Makefile.kmk	(revision 68056)
+++ /trunk/src/VBox/Installer/win/Makefile.kmk	(revision 68057)
@@ -168,4 +168,5 @@
 	$(if $(VBOX_WITH_QTGUI),$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi) \
 	$(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi \
+	$(VBOX_WIN_INST_OUT_DIR)/VBoxUnattendedTemplateComponent.wxi \
 	$(foreach lang,$(VBOX_INSTALLER_LANGUAGES), \
 		$(VBOX_WIN_INST_OUT_DIR)/NLS/Language_$(lang).wxl \
@@ -503,5 +504,6 @@
 	$(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi \
 	$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi \
-	$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi
+	$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib.wxi \
+	$(VBOX_WIN_INST_OUT_DIR)/VBoxUnattendedTemplateComponent.wxi
 
 #
@@ -520,4 +522,5 @@
 				$(if $(VBOX_WITH_32_ON_64_MAIN_API),$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib_x86.wxi,) \
 				$(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi \
+				$(VBOX_WIN_INST_OUT_DIR)/VBoxUnattendedTemplateComponent.wxi \
 				$(if $(VBOX_WITH_QTGUI),$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi) \
 				$(VBOX_MSI_DEPENDENCIES)) \
@@ -580,5 +583,4 @@
 		-E 'VBOX_WITH_WEBSERVICES=$(if $(VBOX_WITH_WEBSERVICES),yes,no)' \
 		-E 'VBOX_WITH_SDS=$(if $(VBOX_WITH_SDS),yes,no)' \
-		-E 'VBOX_WITH_UNATTENDED=$(if $(VBOX_WITH_UNATTENDED),yes,no)' \
 		-E 'BUILD_TYPE=$(KBUILD_TYPE)' \
 		-E 'BUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)' \
@@ -614,4 +616,5 @@
 		$(if $(VBOX_WITH_32_ON_64_MAIN_API),$(VBOX_WIN_INST_OUT_DIR)/VirtualBox_TypeLib_x86.wxi,) \
 		$(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi \
+		$(VBOX_WIN_INST_OUT_DIR)/VBoxUnattendedTemplateComponent.wxi \
 		$(if $(VBOX_WITH_QTGUI),$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi) \
 		$(VBOX_MSI_DEPENDENCIES) \
@@ -671,5 +674,4 @@
 		-E 'VBOX_WITH_WEBSERVICES=$(if $(VBOX_WITH_WEBSERVICES),yes,no)' \
 		-E 'VBOX_WITH_SDS=$(if $(VBOX_WITH_SDS),yes,no)' \
-		-E 'VBOX_WITH_UNATTENDED=$(if $(VBOX_WITH_UNATTENDED),yes,no)' \
 		-E 'BUILD_TYPE=$(KBUILD_TYPE)' \
 		-E 'BUILD_TARGET_ARCH=$(KBUILD_TARGET_ARCH)' \
@@ -718,5 +720,6 @@
 #
 include $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
-$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi: $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk $(VBOX_WIN_INST_MAKEFILE_DEP) | $$(dir $$@)
+$(call KB_FN_AUTO_CMD_DEPS,$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi)
+$(VBOX_WIN_INST_OUT_DIR)/VBoxGuiNLS.wxi: $(PATH_ROOT)/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk | $$(dir $$@)
 	$(APPEND) -t $@ '<?xml version="1.0" ?>'
 	$(APPEND) $@ '<Include>'
@@ -729,8 +732,29 @@
 # Edit the version stored in the registry.
 #
+$(call KB_FN_AUTO_CMD_DEPS,$(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi)
 $(VBOX_WIN_INST_OUT_DIR)/VBoxKey.wxi: $(PATH_SUB_CURRENT)/VBoxKey.wxi $(VBOX_VERSION_STAMP) | $$(dir $$@)
 	$(SED)	-e 's/%VER%/$(VBOX_VERSION_STRING_RAW)/' \
 		-e 's/%VER_EXT%/$(VBOX_VERSION_STRING)/' \
 		--output $@ $<
+
+#
+# Generate the list of unattended template script files.
+#
+$(call KB_FN_AUTO_CMD_DEPS,$(VBOX_WIN_INST_OUT_DIR)/VBoxUnattendedTemplateComponent.wxi)
+$(VBOX_WIN_INST_OUT_DIR)/VBoxUnattendedTemplateComponent.wxi: | $$(dir $$@)
+	$(APPEND) -t -n $@ \
+		'<?xml version="1.0" ?>' \
+		'<Include>'
+ifdef VBOX_UNATTENDED_TEMPLATES
+	$(APPEND) -n $@ \
+		'  <Directory Id="dir_VBoxUnattendedTemplates" Name="UnattendedTemplates">' \
+		'    <Component Id="cp_UnattendedTemplates" Guid="0571550d-aaa5-4723-c17b-5ddcc29f5686" Win64="$$(var.Property_Win64)">' \
+		$@ $(foreach file,$(VBOX_UNATTENDED_TEMPLATES), \
+		'      <File Id="$(file)" Name="$(file)" Source="$$(env.PATH_OUT)\bin\UnattendedTemplates\$(file)" />') \
+		'    </Component>' \
+		'  </Directory>'
+endif
+	$(APPEND) $@ '</Include>'
+
 
 #
Index: /trunk/src/VBox/Installer/win/VBoxMergeApp.wxi
===================================================================
--- /trunk/src/VBox/Installer/win/VBoxMergeApp.wxi	(revision 68056)
+++ /trunk/src/VBox/Installer/win/VBoxMergeApp.wxi	(revision 68057)
@@ -423,25 +423,7 @@
     </Component>
 
-<?if $(env.VBOX_WITH_UNATTENDED) = "yes" ?>
-    <!-- Unattended templates -->
-    <Directory Id="dir_VBoxUnattendedTemplates" Name="unattended_templates">
-        <Component Id="cp_UnattendedTemplates" Guid="8f89ec7e-ae83-490d-a293-c7ab276c5678" Win64="$(var.Property_Win64)">
-            <!-- VBox unattended template files -->
-            <File Id="file_debian_preseed.cfg" Name="debian_preseed.cfg"
-                  Source="$(env.PATH_OUT)\bin\unattended_templates\debian_preseed.cfg" />
-            <File Id="file_fedora_ks.cfg" Name="fedora_ks.cfg"
-                  Source="$(env.PATH_OUT)\bin\unattended_templates\fedora_ks.cfg" />
-            <File Id="file_ol_ks.cfg" Name="ol_ks.cfg"
-                  Source="$(env.PATH_OUT)\bin\unattended_templates\ol_ks.cfg" />
-            <File Id="file_redhat67_ks.cfg" Name="redhat67_ks.cfg"
-                  Source="$(env.PATH_OUT)\bin\unattended_templates\redhat67_ks.cfg" />
-            <File Id="file_ubuntu_preseed.cfg" Name="ubuntu_preseed.cfg"
-                  Source="$(env.PATH_OUT)\bin\unattended_templates\ubuntu_preseed.cfg" />
-            <File Id="file_win_nt6_unattended.xml" Name="win_nt6_unattended.xml"
-                  Source="$(env.PATH_OUT)\bin\unattended_templates\win_nt6_unattended.xml" />
-            <File Id="file_win_nt5_unattended.sif" Name="win_nt5_unattended.sif"
-                  Source="$(env.PATH_OUT)\bin\unattended_templates\win_nt5_unattended.sif" />
-        </Component>
-    </Directory>
+    <!-- Unattended installation template scripts if enabled -->
+    <?include $(env.PATH_TARGET)\VBoxUnattendedTemplateComponent.wxi ?>
+
 <?endif?>
 
Index: /trunk/src/VBox/Main/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Main/Makefile.kmk	(revision 68056)
+++ /trunk/src/VBox/Main/Makefile.kmk	(revision 68057)
@@ -34,4 +34,5 @@
 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
 include $(PATH_SUB_CURRENT)/cbinding/Makefile.kmk
+include $(PATH_SUB_CURRENT)/UnattendedTemplates/Makefile.kmk
 
 
Index: /trunk/src/VBox/Main/UnattendedTemplates/debian_preseed.cfg
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/debian_preseed.cfg	(revision 68057)
+++ /trunk/src/VBox/Main/UnattendedTemplates/debian_preseed.cfg	(revision 68057)
@@ -0,0 +1,79 @@
+### Partitioning
+d-i partman-auto/disk string /dev/sda
+d-i partman-auto/method string regular
+d-i partman-lvm/device_remove_lvm boolean true
+d-i partman-md/device_remove_md boolean true
+d-i partman-auto/choose_recipe select atomic
+
+# This makes partman automatically partition without confirmation
+d-i partman-partitioning/confirm_write_new_label boolean true
+d-i partman/choose_partition select finish
+d-i partman/confirm boolean true
+d-i partman/confirm_nooverwrite boolean true
+
+# Locale
+d-i debian-installer/locale string en_US
+d-i console-setup/ask_detect boolean false
+d-i console-setup/layoutcode string us
+d-i keyboard-configuration/xkb-keymap select us
+
+# Network
+d-i netcfg/get_hostname string ubuntu
+d-i netcfg/get_domain string virtualMachine
+d-i netcfg/choose_interface select auto
+
+# Clock
+d-i clock-setup/utc-auto boolean true
+d-i clock-setup/utc boolean true
+d-i time/zone string US/Pacific
+d-i clock-setup/ntp boolean true
+
+# Packages, Mirrors, Image
+d-i base-installer/kernel/override-image string linux-server
+d-i base-installer/kernel/override-image string linux-image-amd64
+d-i mirror/country string US
+d-i mirror/http/proxy string
+d-i apt-setup/restricted boolean true
+d-i apt-setup/universe boolean true
+d-i pkgsel/install-language-support boolean false
+
+# Users
+d-i passwd/user-fullname string @@VBOX_INSERT_USER_FULL_NAME@@
+d-i passwd/username string @@VBOX_INSERT_USER_LOGIN@@
+d-i passwd/user-password password @@VBOX_INSERT_USER_PASSWORD@@
+d-i passwd/user-password-again password @@VBOX_INSERT_USER_PASSWORD@@
+d-i passwd/root-login boolean true
+d-i passwd/root-password password @@VBOX_INSERT_ROOT_PASSWORD@@
+d-i passwd/root-password-again password @@VBOX_INSERT_ROOT_PASSWORD@@
+d-i user-setup/allow-password-weak boolean true
+d-i passwd/user-default-groups string admin
+
+# Grub
+d-i grub-installer/grub2_instead_of_grub_legacy boolean true
+d-i grub-installer/only_debian boolean true
+
+# Due notably to potential USB sticks, the location of the MBR can not be
+# determined safely in general, so this needs to be specified:
+#d-i grub-installer/bootdev  string /dev/sda
+# To install to the first device (assuming it is not a USB stick):
+d-i grub-installer/bootdev  string default
+
+d-i finish-install/reboot_in_progress note
+
+# Custom Commands
+d-i preseed/late_command string \
+mkdir -p /target/postinstall && \
+cd /target/postinstall && \
+echo '#!/bin/bash' > post-install.sh && \
+echo 'apt-get -y install build-essential' >> post-install.sh && \
+echo 'apt-get -y install linux-headers-$(uname -r)' >> post-install.sh && \
+@@VBOX_COND_IS_INSTALLING_ADDITIONS@@echo 'echo' >> post-install.sh && \
+echo 'echo "Installing VirtualBox Guest Additions..."' >> post-install.sh && \
+echo 'bash /cdrom/VBoxAdditions/VBoxLinuxAdditions.run' >> post-install.sh && \
+echo 'usermod -a -G vboxsf "@@VBOX_INSERT_USER_LOGIN@@"' >> post-install.sh && \
+@@VBOX_COND_END@@@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@echo 'echo' >> post-install.sh && \
+echo 'echo "TODO: Installing Test Execution Service..."' >> post-install.sh && \
+@@VBOX_COND_END@@echo exit 0' >> post-install.sh && \
+chmod +x /target/postinstall/post-install.sh && \
+chroot /target /bin/bash /postinstall/post-install.sh
+
Index: /trunk/src/VBox/Main/UnattendedTemplates/fedora_ks.cfg
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/fedora_ks.cfg	(revision 68057)
+++ /trunk/src/VBox/Main/UnattendedTemplates/fedora_ks.cfg	(revision 68057)
@@ -0,0 +1,77 @@
+#platform=x86, AMD64, or Intel EM64T
+#version=DEVEL
+
+# Firewall configuration
+firewall --disabled
+
+# Install OS instead of upgrade
+install
+
+# Use CDROM installation media
+cdrom
+
+# Root password
+rootpw --plaintext @@VBOX_INSERT_ROOT_PASSWORD_SH@@
+
+# System authorization information
+auth  --useshadow  --passalgo=sha512
+
+# Use text mode install
+text
+
+# System keyboard
+keyboard us
+
+# System language
+lang en_US
+
+# SELinux configuration
+selinux --enforcing
+
+# Installation logging level
+logging --level=info
+
+# System timezone
+timezone  Europe/London
+
+# Network information
+network  --bootproto=dhcp --device=eth0 --onboot=on
+
+# System bootloader configuration
+bootloader --location=mbr --append="nomodeset crashkernel=auto rhgb quiet"
+zerombr
+
+# Partition clearing information
+clearpart --all --initlabel
+# Disk partitioning information
+part / --fstype ext4 --size 6000 --grow --asprimary 
+part swap --size 1024 
+
+#Initial user
+user --name=@@VBOX_INSERT_USER_LOGIN_SH@@ --password=@@VBOX_INSERT_USER_PASSWORD_SH@@
+
+# Reboot after installation
+reboot
+
+%packages
+@standard
+@hardware-support
+%end
+
+%post --log=/root/ks-post.log
+yum -y install "kernel-devel-$(uname -r)"
+yum -y install gcc
+
+@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
+mkdir -p /mnt/cdrom
+mount -o ro /dev/sr2 /mnt/cdrom
+echo
+echo "Installing VirtualBox Guest Additions..."
+bash /mnt/cdrom/VBoxLinuxAdditions.run
+usermod -a -G vboxsf @@VBOX_INSERT_USER_LOGIN_SH@@
+@@VBOX_COND_END@@
+eject /dev/sr0
+eject /dev/sr1
+eject /dev/sr2
+init 5
+%end
Index: /trunk/src/VBox/Main/UnattendedTemplates/ol_ks.cfg
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/ol_ks.cfg	(revision 68057)
+++ /trunk/src/VBox/Main/UnattendedTemplates/ol_ks.cfg	(revision 68057)
@@ -0,0 +1,86 @@
+#platform=x86, AMD64, or Intel EM64T
+#version=DEVEL
+
+# Firewall configuration
+firewall --disabled
+
+# Install OS instead of upgrade
+install
+
+# Use CDROM installation media
+cdrom
+
+# Root password
+rootpw --plaintext @@VBOX_INSERT_ROOT_PASSWORD_SH@@
+
+# System authorization information
+auth  --useshadow  --passalgo=sha512
+
+# Use text mode install
+text
+
+# System keyboard
+keyboard us
+
+# System language
+lang en_US
+
+# Disable the unsupported hardware popup (vmmdev?).
+unsupported_hardware
+
+# SELinux configuration
+selinux --enforcing
+
+# Installation logging level
+logging --level=info
+
+# System timezone
+timezone  Europe/London
+
+# Network information
+network  --bootproto=dhcp --device=eth0 --onboot=on
+
+# System bootloader configuration
+bootloader --location=mbr --append="nomodeset crashkernel=auto rhgb quiet"
+zerombr
+
+# Partition clearing information
+clearpart --all --initlabel
+
+# Disk partitioning information
+part / --fstype ext4 --size 6000 --grow --asprimary 
+part swap --size 1024 
+
+#Initial user
+user --name=@@VBOX_INSERT_USER_LOGIN_SH@@ --password=@@VBOX_INSERT_USER_PASSWORD_SH@@
+
+# Reboot after installation
+reboot
+
+## @todo @gnome-desktop is missing in OL-6.4
+%packages
+@base
+@core
+@development
+@gnome-desktop
+@desktop-debugging
+@fonts
+@graphical-admin-tools
+@remote-desktop-clients
+@x11
+%end
+
+%post --log=/root/ks-post.log
+@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
+mkdir -p /mnt/cdrom
+mount -o ro /dev/sr2 /mnt/cdrom
+echo
+echo "Installing VirtualBox Guest Additions..."
+bash /mnt/cdrom/VBoxLinuxAdditions.run
+usermod -a -G vboxsf @@VBOX_INSERT_USER_LOGIN_SH@@
+@@VBOX_COND_END@@
+eject /dev/sr0
+eject /dev/sr1
+eject /dev/sr2
+init 5
+%end
Index: /trunk/src/VBox/Main/UnattendedTemplates/redhat67_ks.cfg
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/redhat67_ks.cfg	(revision 68057)
+++ /trunk/src/VBox/Main/UnattendedTemplates/redhat67_ks.cfg	(revision 68057)
@@ -0,0 +1,85 @@
+#platform=x86, AMD64, or Intel EM64T
+#version=DEVEL
+
+# Firewall configuration
+firewall --disabled
+
+# Install OS instead of upgrade
+install
+
+# Use CDROM installation media
+cdrom
+
+# Root password
+rootpw --plaintext @@VBOX_INSERT_ROOT_PASSWORD_SH@@
+
+# System authorization information
+auth  --useshadow  --passalgo=sha512
+
+# Use text mode install
+text
+
+# System keyboard
+keyboard us
+
+# System language
+lang en_US
+
+# SELinux configuration
+selinux --enforcing
+
+# Installation logging level
+logging --level=info
+
+# System timezone
+timezone  Europe/London
+
+# Network information
+network  --bootproto=dhcp --device=eth0 --onboot=on
+
+# System bootloader configuration
+bootloader --location=mbr --append="nomodeset crashkernel=auto rhgb quiet"
+zerombr
+
+# Partition clearing information
+clearpart --all --initlabel
+
+# Disk partitioning information
+part / --fstype ext4 --size 6000 --grow --asprimary 
+part swap --size 1024 
+
+#Initial user
+user --name=@@VBOX_INSERT_USER_LOGIN_SH@@ --password=@@VBOX_INSERT_USER_PASSWORD_SH@@
+
+# Reboot after installation
+reboot
+
+%packages
+@base
+@core
+@development
+@basic-desktop
+@desktop-debugging
+@desktop-platform
+@fonts
+@general-desktop
+@graphical-admin-tools
+@remote-desktop-clients
+@x11
+
+%end
+
+%post --log=/root/ks-post.log
+@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
+mkdir -p /mnt/cdrom
+mount -o ro /dev/sr2 /mnt/cdrom
+echo
+echo "Installing VirtualBox Guest Additions..."
+bash /mnt/cdrom/VBoxLinuxAdditions.run
+usermod -a -G vboxsf @@VBOX_INSERT_USER_LOGIN_SH@@
+@@VBOX_COND_END@@
+eject /dev/sr0
+eject /dev/sr1
+eject /dev/sr2
+init 5
+%end
Index: /trunk/src/VBox/Main/UnattendedTemplates/suse_autoinstall.xml
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/suse_autoinstall.xml	(revision 68057)
+++ /trunk/src/VBox/Main/UnattendedTemplates/suse_autoinstall.xml	(revision 68057)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE profile>
+<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
+  <general>
+    <mode>
+      <confirm config:type="boolean">false</confirm>
+    </mode>
+  </general>
+
+  <partitioning config:type="list">
+    <drive>
+      <use>all</use>
+    </drive>
+  </partitioning>
+
+  <software>
+    <!-- Those are necessray for Guest Additions -->
+    <packages config:type="list">
+      <package>gcc</package>
+      <package>automake</package>
+      <package>kernel-source</package>
+      <!-- 'smpppd' is required on openSUSE 11.4 -->
+      <package>smpppd</package>
+    </packages>
+    
+    <patterns config:type="list">
+      <pattern>apparmor</pattern>
+      <pattern>apparmor_opt</pattern>
+      <pattern>base</pattern>
+      <pattern>kde</pattern>
+      <!--pattern>Basis-Devel</pattern-->
+      <!--pattern>devel_kernel</pattern-->
+      <pattern>default</pattern>
+      <pattern>sw_management</pattern>
+      <pattern>sw_management_kde4</pattern>
+      <pattern>yast2_install_wf</pattern>
+    </patterns>
+  </software>
+
+  <configure>
+    <x11>
+      <display_manager>kdm</display_manager>
+    </x11>
+
+    <networking>
+      <interfaces config:type="list">
+        <interface>
+          <bootproto>dhcp</bootproto>
+          <device>eth0</device>
+          <startmode>auto</startmode>
+          <usercontrol>yes</usercontrol>
+        </interface>
+      </interfaces>
+    </networking>
+
+    <users config:type="list">
+      <user>
+        <fullname>root</fullname>
+        <username>root</username>
+        <encrypted config:type="boolean">false</encrypted>
+        <user_password>$password</user_password>
+      </user>
+      <user>
+        <groups>video,dialout,vboxsf</groups>
+        <fullname>$user</fullname>
+        <username>$user</username>
+        <encrypted config:type="boolean">false</encrypted>
+        <user_password>$password</user_password>
+      </user>
+    </users>
+  </configure>
+</profile>
Index: /trunk/src/VBox/Main/UnattendedTemplates/ubuntu_preseed.cfg
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/ubuntu_preseed.cfg	(revision 68057)
+++ /trunk/src/VBox/Main/UnattendedTemplates/ubuntu_preseed.cfg	(revision 68057)
@@ -0,0 +1,96 @@
+### Partitioning
+d-i partman-auto/disk string /dev/sda
+d-i partman-auto/method string regular
+d-i partman-lvm/device_remove_lvm boolean true
+d-i partman-md/device_remove_md boolean true
+d-i partman-auto/choose_recipe select atomic
+
+# This makes partman automatically partition without confirmation
+d-i partman-partitioning/confirm_write_new_label boolean true
+d-i partman/choose_partition select finish
+d-i partman/confirm boolean true
+d-i partman/confirm_nooverwrite boolean true
+
+# Locale
+d-i debian-installer/locale string en_US
+d-i console-setup/ask_detect boolean false
+d-i console-setup/layoutcode string us
+d-i keyboard-configuration/xkb-keymap select us
+
+# Network
+d-i netcfg/get_hostname string ubuntu
+d-i netcfg/get_domain string virtualMachine
+d-i netcfg/choose_interface select auto
+
+# Clock
+d-i clock-setup/utc-auto boolean true
+d-i clock-setup/utc boolean true
+d-i time/zone string US/Pacific
+d-i clock-setup/ntp boolean true
+
+# Packages, Mirrors, Image
+d-i base-installer/kernel/override-image string linux-server
+d-i base-installer/kernel/override-image string linux-image-amd64
+d-i mirror/country string US
+d-i mirror/http/proxy string
+d-i apt-setup/restricted boolean true
+d-i apt-setup/universe boolean true
+d-i pkgsel/install-language-support boolean false
+
+# Users
+d-i passwd/user-fullname string @@VBOX_INSERT_USER_FULL_NAME@@
+d-i passwd/username string @@VBOX_INSERT_USER_LOGIN@@
+d-i passwd/user-password password @@VBOX_INSERT_USER_PASSWORD@@
+d-i passwd/user-password-again password @@VBOX_INSERT_USER_PASSWORD@@
+d-i passwd/root-login boolean true
+d-i passwd/root-password password @@VBOX_INSERT_ROOT_PASSWORD@@
+d-i passwd/root-password-again password @@VBOX_INSERT_ROOT_PASSWORD@@
+d-i user-setup/allow-password-weak boolean true
+d-i passwd/user-default-groups string admin
+
+# Grub
+d-i grub-installer/grub2_instead_of_grub_legacy boolean true
+d-i grub-installer/only_debian boolean true
+
+# Due notably to potential USB sticks, the location of the MBR can not be
+# determined safely in general, so this needs to be specified:
+#d-i grub-installer/bootdev  string /dev/sda
+# To install to the first device (assuming it is not a USB stick):
+d-i grub-installer/bootdev  string default
+
+d-i finish-install/reboot_in_progress note
+
+# Custom Commands
+d-i preseed/late_command string \
+mkdir -p /target/postinstall && \
+cd /target/postinstall && \
+echo '#!/bin/bash' > post-install.sh && \
+echo 'apt-get -y install build-essential' >> post-install.sh && \
+echo 'apt-get -y install linux-headers-$(uname -r)' >> post-install.sh && \
+@@VBOX_COND_IS_INSTALLING_ADDITIONS@@echo 'echo' >> post-install.sh && \
+echo 'echo "Installing VirtualBox Guest Additions..."' >> post-install.sh && \
+echo 'bash /cdrom/VBoxAdditions/VBoxLinuxAdditions.run' >> post-install.sh && \
+echo 'usermod -a -G vboxsf "@@VBOX_INSERT_USER_LOGIN@@"' >> post-install.sh && \
+@@VBOX_COND_END@@@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@echo 'echo' >> post-install.sh && \
+echo 'echo "TODO: Installing Test Execution Service..."' >> post-install.sh && \
+@@VBOX_COND_END@@echo exit 0' >> post-install.sh && \
+chmod +x /target/postinstall/post-install.sh && \
+chroot /target /bin/bash /postinstall/post-install.sh
+
+# Same as above, but for ubiquity.
+ubiquity ubiquity/success_command string \
+mkdir -p /target/postinstall && \
+cd /target/postinstall && \
+echo '#!/bin/bash' > post-install.sh && \
+echo 'apt-get -y install build-essential' >> post-install.sh && \
+echo 'apt-get -y install linux-headers-$(uname -r)' >> post-install.sh && \
+@@VBOX_COND_IS_INSTALLING_ADDITIONS@@echo 'echo' >> post-install.sh && \
+echo 'echo "Installing VirtualBox Guest Additions..."' >> post-install.sh && \
+echo 'bash /cdrom/VBoxAdditions/VBoxLinuxAdditions.run' >> post-install.sh && \
+echo 'usermod -a -G vboxsf "@@VBOX_INSERT_USER_LOGIN@@"' >> post-install.sh && \
+@@VBOX_COND_END@@@@VBOX_COND_IS_INSTALLING_TEST_EXEC_SERVICE@@echo 'echo' >> post-install.sh && \
+echo 'echo "TODO: Installing Test Execution Service..."' >> post-install.sh && \
+@@VBOX_COND_END@@echo exit 0' >> post-install.sh && \
+chmod +x /target/postinstall/post-install.sh && \
+chroot /target /bin/bash /postinstall/post-install.sh
+
Index: /trunk/src/VBox/Main/UnattendedTemplates/win_nt5_unattended.sif
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/win_nt5_unattended.sif	(revision 68057)
+++ /trunk/src/VBox/Main/UnattendedTemplates/win_nt5_unattended.sif	(revision 68057)
@@ -0,0 +1,61 @@
+;SetupMgrTag
+[Data]
+    AutoPartition = 1
+    MsDosInitiated = "0"
+    UnattendedInstall = "Yes"
+
+[Unattended]
+    UnattendMode = FullUnattended
+    OemSkipEula = Yes
+    OemPreinstall = No
+    TargetPath = \WINDOWS
+    Repartition = Yes
+    UnattendSwitch = "Yes"
+    DriverSigningPolicy = Ignore
+    WaitForReboot = "No"
+
+[GuiUnattended]
+    AdminPassword = "@@VBOX_INSERT_USER_PASSWORD@@"
+    EncryptedAdminPassword = No
+    AutoLogon = Yes
+    OEMSkipRegional = 1
+    OemSkipWelcome = 1
+; TODO: Make timezone configurable?
+    TimeZone = 85
+    OemSkipWelcome = 1
+
+[UserData]
+; ProductKey was introduced in XP, ProductID was used in 2K and earlier.
+    ProductKey = "@@VBOX_INSERT_PRODUCT_KEY@@"
+    ProductID = "@@VBOX_INSERT_PRODUCT_KEY@@"
+    FullName = "@@VBOX_INSERT_USER_LOGIN@@"
+    OrgName = ""
+; TODO: Make computer name configurable, defaulting to a mangled (for NT) VM name.
+    ComputerName = *
+
+[RegionalSettings]
+; TODO: Make language groups configurable?
+;   LanguageGroup=1,2,3,4,5 - needed for us+russian?
+    LanguageGroup=1
+; TODO: Make system+user locale configurable.
+; 0409:00000409 is US.
+;    SystemLocale=00000419 - russian
+; TODO: Make Input locale configurable?
+;    InputLocale=0409:00000409,0419:00000419 - US,Russian
+
+[LicenseFilePrintData]
+; This section is used for server installs.
+    AutoMode = "PerServer"
+    AutoUsers = "5"
+
+[Identification]
+    JoinWorkgroup = WORKGROUP
+
+[Networking]
+    InstallDefaultComponents = Yes
+
+@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
+[GuiRunOnce]
+    Command0="E:\VBoxWindowsAdditions.exe"
+@@VBOX_COND_END@@
+
Index: /trunk/src/VBox/Main/UnattendedTemplates/win_nt6_unattended.xml
===================================================================
--- /trunk/src/VBox/Main/UnattendedTemplates/win_nt6_unattended.xml	(revision 68057)
+++ /trunk/src/VBox/Main/UnattendedTemplates/win_nt6_unattended.xml	(revision 68057)
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8"?>
+<unattend xmlns="urn:schemas-microsoft-com:unattend"
+    xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
+
+    <settings pass="windowsPE">
+        <component name="Microsoft-Windows-International-Core-WinPE"
+            processorArchitecture="@@VBOX_INSERT_OS_ARCH_ATTRIB_DQ@@"
+            publicKeyToken="31bf3856ad364e35" language="neutral"
+            versionScope="nonSxS">
+            <InputLocale>en-US</InputLocale>
+            <SystemLocale>en-US</SystemLocale>
+            <UILanguage>en-US</UILanguage>
+            <UserLocale>en-US</UserLocale>
+        </component>
+
+        <component name="Microsoft-Windows-Setup"
+            processorArchitecture="@@VBOX_INSERT_OS_ARCH_ATTRIB_DQ@@"
+            publicKeyToken="31bf3856ad364e35" language="neutral"
+            versionScope="nonSxS">
+
+            <DiskConfiguration>
+                <WillShowUI>OnError</WillShowUI>
+                <Disk>
+                    <DiskID>0</DiskID>
+                    <WillWipeDisk>true</WillWipeDisk>
+                    <CreatePartitions>
+                        <CreatePartition>
+                            <Order>1</Order>
+                            <Type>Primary</Type>
+                            <Extend>true</Extend>
+                        </CreatePartition>
+                    </CreatePartitions>
+                </Disk>
+            </DiskConfiguration>
+
+            <UserData>
+                <ProductKey>
+                    <Key>@@VBOX_INSERT_PRODUCT_KEY_ELEMENT@@</Key>
+                    <WillShowUI>OnError</WillShowUI>
+                </ProductKey>
+                <AcceptEula>true</AcceptEula>
+            </UserData>
+
+            <ImageInstall>
+                <OSImage>
+                    <InstallFrom>
+                        <MetaData wcm:action="add">
+                            <Key>/IMAGE/INDEX</Key>
+                            <Value>@@VBOX_INSERT_IMAGE_INDEX_ELEMENT@@</Value>
+                        </MetaData>
+                        <!-- <Path>d:\sources\install.wim</Path> - the w7 tests doesn't specify this -->
+                    </InstallFrom>
+                    <InstallTo>
+                        <DiskID>0</DiskID>
+                        <PartitionID>1</PartitionID>
+                    </InstallTo>
+                    <WillShowUI>OnError</WillShowUI>
+                    <InstallToAvailablePartition>false</InstallToAvailablePartition>
+                </OSImage>
+            </ImageInstall>
+
+            <ComplianceCheck>
+                <DisplayReport>OnError</DisplayReport>
+            </ComplianceCheck>
+
+        </component>
+    </settings>
+
+    <settings pass="oobeSystem">
+        <component name="Microsoft-Windows-Shell-Setup"
+            processorArchitecture="@@VBOX_INSERT_OS_ARCH_ATTRIB_DQ@@"
+            publicKeyToken="31bf3856ad364e35" language="neutral"
+            versionScope="nonSxS">
+            <AutoLogon>
+                <Password>
+                    <Value>@@VBOX_INSERT_USER_PASSWORD_ELEMENT@@</Value>
+                    <PlainText>true</PlainText>
+                </Password>
+                <Enabled>true</Enabled>
+                <Username>@@VBOX_INSERT_USER_LOGIN_ELEMENT@@</Username>
+            </AutoLogon>
+
+            <UserAccounts>
+@@VBOX_COND_IS_USER_LOGIN_NOT_ADMINISTRATOR@@
+                <AdministratorPassword>
+                    <Value>@@VBOX_INSERT_ROOT_PASSWORD_ELEMENT@@</Value>
+                    <PlainText>true</PlainText>
+                </AdministratorPassword>
+
+                <LocalAccounts>
+                    <LocalAccount wcm:action="add">
+                        <Name>@@VBOX_INSERT_USER_LOGIN_ELEMENT@@</Name>
+                        <DisplayName>@@VBOX_INSERT_USER_FULL_NAME_ELEMENT@@</DisplayName>
+                        <Group>administrators;users</Group>
+                        <Password>
+                            <Value>@@VBOX_INSERT_USER_PASSWORD_ELEMENT@@</Value>
+                            <PlainText>true</PlainText>
+                        </Password>
+                    </LocalAccount>
+                </LocalAccounts>
+@@VBOX_COND_END@@
+@@VBOX_COND_IS_USER_LOGIN_ADMINISTRATOR@@
+                <AdministratorPassword>
+                    <Value>@@VBOX_INSERT_USER_PASSWORD_ELEMENT@@</Value>
+                    <PlainText>true</PlainText>
+                </AdministratorPassword>
+@@VBOX_COND_END@@
+            </UserAccounts>
+
+            <VisualEffects>
+                <FontSmoothing>ClearType</FontSmoothing>
+            </VisualEffects>
+
+            <OOBE>
+                <ProtectYourPC>3</ProtectYourPC>
+                <HideEULAPage>true</HideEULAPage>
+                <SkipUserOOBE>true</SkipUserOOBE>
+                <SkipMachineOOBE>true</SkipMachineOOBE>
+                <NetworkLocation>Home</NetworkLocation>
+            </OOBE>
+
+            <FirstLogonCommands>
+                <SynchronousCommand wcm:action="add">
+                    <Order>1</Order>
+                    <Description>Turn Off Network Selection pop-up</Description>
+                    <CommandLine>reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Network\NewNetworkWindowOff"</CommandLine>
+                </SynchronousCommand>
+@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
+                <SynchronousCommand wcm:action="add">
+                    <Order>2</Order>
+                    <Description>Install Oracle certificate</Description>
+                    <CommandLine>e:\cert\VBoxCertUtil.exe add-trusted-publisher e:\cert\vbox*.cer --root e:\cert\vbox*.cer</CommandLine>
+                </SynchronousCommand>
+                <SynchronousCommand wcm:action="add">
+                    <Order>3</Order>
+                    <Description>Install VirtualBox Guest Additions</Description>
+                    <CommandLine>e:\VBoxWindowsAdditions.exe /S</CommandLine>
+                </SynchronousCommand>
+@@VBOX_COND_END@@
+            </FirstLogonCommands>
+
+            <TimeZone>GMT Standard Time</TimeZone>
+        </component>
+
+    </settings>
+</unattend>
