VirtualBox

Opened 4 months ago

Last modified 4 weeks ago

#22278 assigned defect

vboxpostintall.sh failure for Subiquity based unattended installs

Reported by: ogayot Owned by: gombara
Component: other Version: VirtualBox-7.1.4
Keywords: Cc: ogayot
Guest type: Linux Host type: other

Description

Hello,

I am one of the developers of the Subiquity project (Ubuntu). Since recently, we started receiving bug reports [1] showing failed installations done using the unattended install mechanism of VirtualBox.

In the bugs reports, we see the script vboxpostinstall.sh failing with exit status 1.

I haven't had a chance to reproduce the issue yet, nor to get my hand on any vboxpostinstall.log log file - because Ubuntu does not automatically collect it.

However, after investigating, I found this:

Dec 17 09:31:33 ubuntu subiquity_log.3847[21868]: usermod: user 'vboxuser' does not exist
Dec 17 09:31:33 ubuntu subiquity_log.3847[21871]: ** exit code: 6

which I think is coming from this directive [2]

log_command_in_target usermod -a -G vboxsf "@@VBOX_INSERT_USER_LOGIN@@"

Currently subiquity-based installers defer the user creation until after first boot (we rely on cloud-init to perform the user creation). So we should somehow make sure that either:

  1. The postinstall.sh is not dependent on user-creation ; or
  2. We ensure the user user is created before (possibly using late-commands?) [3]

Thank you,

Olivier

Change History (3)

comment:1 by Klaus Espenlaub, 7 weeks ago

Hi Olivier,

is it possible to tell subiquity to add the group membership stuff to the cloud-init config it generates? That would be the cleanest solution I can think of, because it directly does 'the right thing' for user creation.

Would it work to extend the current user-data section in ubuntu_autoinstall_user_data (which is already in cloud-init form, but autoinstall/identity doesn't have any provisions for group membership) to something like

  user-data:

    users:
      - name: root
        primary_group: root
        groups: sudo
        lock-passwd: false
        passwd: '@@VBOX_INSERT_USER_PASSWORD_SHACRYPT512@@'
        uid: 0

@@VBOX_COND_IS_INSTALLING_ADDITIONS@@
      - name: '@@VBOX_INSERT_USER_LOGIN@@'
        groups: vboxsf
@@VBOX_COND_END

which essentially does what I hinted above if subiquity is smart enough to merge its stuff with the group membership.

comment:2 by gombara, 7 weeks ago

Owner: set to gombara
Status: newassigned

comment:3 by ogayot, 4 weeks ago

Hello Klaus,

Sadly, I think we currently have no way to specify "extra" group membership using the identity section. I suppose it would be a nice feature to add in the future but there is no immediate plan for it.

AFAICT The only way to specify a custom list of groups is to skip the identity section entirely - and define the user-data.users section accordingly.

Thanks, Olivier

Note: See TracTickets for help on using tickets.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette