Recently I began getting errors from a VM running systemd due to fstab being mounted before vboxsf is probed (and thus mounts of shared folders will fail). Looking at the unit file I see nothing to guarantee that it runs before local mounts are performed, so only happenstance allowed this to work previously. I'm not sure what the most appropriate solution is, but virtualbox-guest-additions should run before local-fs-pre.target. Or, perhaps, systemd-fstab-generator should ensure that it runs before individual mounts that require the guest additions are processed (which could itself happen in various ways).
Maybe there is some way to get the generator to treat them as "remote" filesystems, which are processed later in the boot process.
It looks like adding _netdev to the mount options will get it to run as a network mount. Alternatively shared/util.c needs to be modified to add vboxsf as a network filesystem type. That might not actually be a bad upstream patch, though I'm not sure if virtualbox has a different plan for addressing this. Regardless the systemd.mount man page could use improvement. It mentions that the generator looks at fstab options, but doesn't mention _netdev at all. I didn't fully peruse the source but I'm sure there are other undocumented behaviors.
This blog post is interesting: http://rwmj.wordpress.com/2009/08/18/how-does-mount-load-the-right-kernel-module/ I wonder how we can get the kernel to issue that /bin/modprobe call to load the vboxsf module on-demand?
It looks like the kernel calls /sbin/modprobe fs-%fstype% when you try to mount a filesystem with a type it doesn't know about. Could you try adding a module alias in /etc/modprobe.d? alias fs-vboxsf vboxsf
(In reply to Mike Gilbert from comment #4) > It looks like the kernel calls /sbin/modprobe fs-%fstype% when you try to > mount a filesystem with a type it doesn't know about. > > Could you try adding a module alias in /etc/modprobe.d? > > alias fs-vboxsf vboxsf Indeed that works. Seems like a good rc-independent solution to have virtualbox-guest-additions to add an appropriate file to /etc/modprobe.d containing this line.
Agreed. Re-assigning to package maintainer. Also, I think there is probably a way to define that alias in the module sources; depmod seems to generate "fs-" aliases in /lib/modules/version/modules.alias for other filesystems. I'm just having trouble figuring out exactly how that works.
Has this been resolved?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e17a14193499a962d42185d7b864731e907e46f7 commit e17a14193499a962d42185d7b864731e907e46f7 Author: Viorel Munteanu <ceamac.paragon@gmail.com> AuthorDate: 2022-09-04 08:31:19 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-09-05 01:19:03 +0000 app-emulation/virtualbox-guest-additions: add a module alias Closes: https://bugs.gentoo.org/485996 Signed-off-by: Viorel Munteanu <ceamac.paragon@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/27132 Signed-off-by: Sam James <sam@gentoo.org> .../virtualbox-guest-additions/virtualbox-guest-additions-6.1.38.ebuild | 1 + 1 file changed, 1 insertion(+)