Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 485996

Summary: app-emulation/virtualbox-guest-additions should define a "fs-vboxsf" alias for the vboxsf module
Product: Gentoo Linux Reporter: Richard Freeman <rich0>
Component: [OLD] Core systemAssignee: Viorel Munteanu <ceamac>
Status: RESOLVED FIXED    
Severity: normal CC: polynomial-c, proxy-maint, systemd
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/27132
Whiteboard:
Package list:
Runtime testing required: ---

Description Richard Freeman gentoo-dev 2013-09-25 17:09:29 UTC
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).
Comment 1 Mike Gilbert gentoo-dev 2013-09-25 17:34:00 UTC
Maybe there is some way to get the generator to treat them as "remote" filesystems, which are processed later in the boot process.
Comment 2 Richard Freeman gentoo-dev 2013-09-25 18:58:10 UTC
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.
Comment 3 Mike Gilbert gentoo-dev 2013-09-25 19:09:41 UTC
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?
Comment 4 Mike Gilbert gentoo-dev 2013-09-25 19:37:07 UTC
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
Comment 5 Richard Freeman gentoo-dev 2013-09-25 20:03:43 UTC
(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.
Comment 6 Mike Gilbert gentoo-dev 2013-09-25 20:10:08 UTC
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.
Comment 7 aabarkley3 2014-12-16 16:18:34 UTC
Has this been resolved?
Comment 8 Larry the Git Cow gentoo-dev 2022-09-05 01:22:39 UTC
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(+)