Fix ubuntu unattended installation with guest additions#439
Fix ubuntu unattended installation with guest additions#439ogayot wants to merge 2 commits intoVirtualBox:mainfrom
Conversation
…r-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 911ce9e. Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
…up 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 <olivier.gayot@canonical.com>
|
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application. When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated. If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public. |
|
Thank you for signing the OCA. |
|
cc @baserkan who originally moved the user definition from the identity section to cloud-init's user-data. |
|
I still get an error with the suggested changes. I attach a screenshot showing the error log of the installer, user data and post install scripts the unattended installation uses. |
|
Hello Serkan, Ubuntu 25.10 does not have support for user creation before reboot. The support is coming for 26.04 (Apr 2026) and was already back-ported to 24.04.4 (that we just released) Unfortunately Ubuntu Mate 24.04.4 and other flavors did not ship the right version of the installer in 24.04.4. Instead of shipping the 25.04.4 installer, they're shipping the 25.10 installer (which as mentioned above, does not have support for early user creation).
It should work with the official Ubuntu flavor in 24.04.4. |

The installer for Ubuntu 26.04 now has the ability to create users before first boot [1]. With relevant changes to VirtualBox, it 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 still processed by cloud-init on first boot).
In addition, we need to make sure the
vboxsfgroup exists before callingusermod -aG vboxsf [...].I don't have access to bugref:10878 so I can't tell why the user information were moved from identity to cloud-init's user-data in the first place. Please let me know if it was fixing something important?
I've tested these two patches and was able to successfully install the current daily Ubuntu 26.04 ISO with Guest Additions.
https://cdimage.ubuntu.com/ubuntu-server/daily-live/20251214/
(the ISO will be removed in a few day, but the current daily is available at https://cdimage.ubuntu.com/ubuntu-server/daily-live/current/).
ticketref:22278
[1] canonical/subiquity#2263