From 79d1d9844d91ae76083b13b7e16cbb2ecbf10b94 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 6 Nov 2025 11:15:22 +0100 Subject: [PATCH 1/2] Revert "Removing identity section and moving all related stuff to user-data section in auto-install file of Subiquity. Needed to set user group correctly" The installer for Ubuntu 26.04 now has the ability to create users before first boot. This will fix the inability to install unattended when Guest Additions are also installed (see ticketref:22278). But for that to work, we need the user parameters to be specified in the identity section, not in the user-data section (which is processed by cloud-init on first boot). ticketref:22278 This reverts commit 911ce9ed60645a532aa8b6bb1557dbeac1dd2138. Signed-off-by: Olivier Gayot --- .../ubuntu_autoinstall_user_data | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/VBox/Main/UnattendedTemplates/ubuntu_autoinstall_user_data b/src/VBox/Main/UnattendedTemplates/ubuntu_autoinstall_user_data index 73953528978e..5b096edc5baa 100644 --- a/src/VBox/Main/UnattendedTemplates/ubuntu_autoinstall_user_data +++ b/src/VBox/Main/UnattendedTemplates/ubuntu_autoinstall_user_data @@ -10,6 +10,12 @@ autoinstall: keyboard: layout: us + identity: + realname: '@@VBOX_INSERT_USER_FULL_NAME@@' + username: '@@VBOX_INSERT_USER_LOGIN@@' + password: '@@VBOX_INSERT_USER_PASSWORD_SHACRYPT512@@' + hostname: '@@VBOX_INSERT_HOSTNAME_WITHOUT_DOMAIN@@' + shutdown: reboot storage: @@ -40,7 +46,7 @@ autoinstall: # Additional cloud-init configuration affecting the target system can be supplied # underneath a user-data section inside of autoinstall. user-data: - hostname: '@@VBOX_INSERT_HOSTNAME_WITHOUT_DOMAIN@@' + users: - name: root primary_group: root @@ -49,19 +55,6 @@ autoinstall: passwd: '@@VBOX_INSERT_USER_PASSWORD_SHACRYPT512@@' uid: 0 - - name: '@@VBOX_INSERT_USER_LOGIN@@' - gecos: '@@VBOX_INSERT_USER_LOGIN@@' - primary_group: '@@VBOX_INSERT_USER_LOGIN@@' -@@VBOX_COND_IS_INSTALLING_ADDITIONS@@ - groups: sudo, vboxsf -@@VBOX_COND_END@@ -@@VBOX_COND_IS_NOT_INSTALLING_ADDITIONS@@ - groups: sudo -@@VBOX_COND_END@@ - lock-passwd: false - shell: /bin/bash - passwd: '@@VBOX_INSERT_USER_PASSWORD_SHACRYPT512@@' - @@VBOX_COND_IS_RTC_USING_UTC@@ timezone: Etc/UTC @@VBOX_COND_END@@ From e7af507e99ac330fc9e1b7d0e2a148ac7d74cc04 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Mon, 15 Dec 2025 13:45:13 +0100 Subject: [PATCH 2/2] Main/UnattendedTemplates/debian_postinstall.sh: ensure the vboxsf group exists before adding users to it When installing Ubuntu, the vboxsf group does not exist when the postinstall script executes. Ensure it does so that the usermod command can succeed. ticketref:22278 Signed-off-by: Olivier Gayot --- src/VBox/Main/UnattendedTemplates/debian_postinstall.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/VBox/Main/UnattendedTemplates/debian_postinstall.sh b/src/VBox/Main/UnattendedTemplates/debian_postinstall.sh index b50938e77207..78d9cfa942a9 100755 --- a/src/VBox/Main/UnattendedTemplates/debian_postinstall.sh +++ b/src/VBox/Main/UnattendedTemplates/debian_postinstall.sh @@ -229,6 +229,10 @@ log_command_in_target /bin/bash "${MY_CHROOT_CDROM}/vboxadditions/@@VBOX_INSERT_ log_command_in_target /bin/bash -c "udevadm control --reload-rules" # GAs doesn't yet do this. log_command_in_target /bin/bash -c "udevadm trigger" # (ditto) MY_IGNORE_EXITCODE= +# Currently in Ubuntu, the vboxsf group does not exist when this script executes. +# But if it does in the future, the --force option will ensure the command +# still succeeds. +log_command_in_target groupadd --force --system vboxsf log_command_in_target usermod -a -G vboxsf "@@VBOX_INSERT_USER_LOGIN@@" @@VBOX_COND_END@@