Community Packages

Please read this before reporting a bug:
http://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in Unsupported. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#61307 - [virtualbox-guest-utils] automounting doesn't work

Attached to Project: Community Packages
Opened by nl6720 (nl6720) - Tuesday, 08 January 2019, 14:43 GMT
Last edited by Balló György (City-busz) - Friday, 12 April 2019, 14:54 GMT
Task Type Bug Report
Category Packages
Status Assigned
Assigned To Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 15
Private No

Details

Description:
VBoxService does not automount shared folders:

automount Error: vbsvcAutomounterMountIt: Failed to mount 'VM-shared' on '/media/sf_VM-shared' because it is probably mounted elsewhere arleady! (-1,22)
automount Error: vbsvcAutomounterMountIt: Failed to mount 'VM-shared' on '/media/sf_VM-shared' because it is probably mounted elsewhere arleady! (-1,22)

It's not mounted elsewhere.

Additional info:
* package version(s)
* config and/or log files etc.
virtualbox-guest-utils 6.0.0-2
virtualbox-guest-modules-arch 6.0.0-2

Steps to reproduce:
In VM settings add a shared folder and enable "Auto-mount",
reboot the VM,
ls -l /media/SHARE_NAME
systemctl status -l vboxservice.service
This task depends upon

Comment by Evan McLean (ecognito) - Tuesday, 08 January 2019, 21:24 GMT
Confirming I am seeing the same issue, with the same log messages. Also using 6.0.0-2 on host and guest.
Comment by Luís Mendes (luisgbm) - Wednesday, 09 January 2019, 01:21 GMT
Using kernel 4.20.0-arch1-1-ARCH, virtualbox-guest-modules-arch 6.0.0-2 and virtualbox-guest-utils 6.0.0-2. The same problem occurs:

automount Error: vbsvcAutomounterMountIt: Failed to mount 'C_DRIVE' on '/media/sf_C_DRIVE' because it is probably mounted elsewhere arleady! (-1,22)
automount Error: vbsvcAutomounterMountIt: Failed to mount 'C_DRIVE' on '/media/sf_C_DRIVE' because it is probably mounted elsewhere arleady! (-1,22)
Comment by nvb (nvb) - Thursday, 10 January 2019, 08:40 GMT
I can confirm this issue too by using virtual box 6.0.0-2 on the host (arch linux) and client (antergos).
I made no changes on the virtual box configuration.
This issue started happening once the upgrade to virtual box 6.x was done from virtual box 5.x.
Comment by Lin Xiao (xiaoliniess) - Thursday, 10 January 2019, 09:41 GMT
Build vboxguest,vboxvideo and vboxsf from virtualbox original source instead of the in kernel vboxguest, vboxvideo and the modified vboxsf from github can fix both this bug and " FS#61185  - [virtualbox-guest-utils] VBoxService fails to start". The fix for #61185 is unnecessary.
Comment by nvb (nvb) - Thursday, 10 January 2019, 12:15 GMT
Thank you Lin Xiao for sharing your fix :-).

Does this indicates that it should be fixed by a new minor release (or re-release)?
Comment by Lin Xiao (xiaoliniess) - Thursday, 10 January 2019, 12:56 GMT
I attached the change I made to fix these bugs. (changes to the PKGBUILD files)
I'm not familiar with the release policy. But if the change is acceptable, a new minor release should be enough.
Comment by Mario Jaeger (j00n) - Friday, 11 January 2019, 06:51 GMT
Confirming. I've got the same issue here.
Comment by Luís Mendes (luisgbm) - Friday, 11 January 2019, 18:36 GMT
virtualbox-guest-utils was just updated to 6.0.0-3, but the problem persists. Same output log.

For now, a simple workaround is to mount your shared folder via fstab:
SHARE_NAME /media/sf_SHARE_NAME vboxsf uid=1000,gid=1000,rw,dmode=700,fmode=600,noauto,x-systemd.automount
Comment by tony (tony.f) - Friday, 11 January 2019, 19:05 GMT
Same problem here. I have just updated to 6.0.0-3, still having same problem.
Comment by nvb (nvb) - Friday, 11 January 2019, 20:24 GMT
I can confirm that this error still exists with virtual box 6.0.0-3.

I can also confirm Luis Mendes workaround. Thanks for offering this :-).

SHARE_NAME='your_share_name'

#for fstab
${SHARE_NAME} /media/sf_${SHARE_NAME} vboxsf uid=1000,gid=100,rw,noauto,x-systemd.automount
#for the shell
mount -t vboxsf ${SHARE_NAME} /media/sf_${SHARE_NAME}
Comment by Luís Mendes (luisgbm) - Wednesday, 16 January 2019, 16:23 GMT
Updated to 6.0.2-1, same problem
Comment by Lin Xiao (xiaoliniess) - Thursday, 17 January 2019, 06:08 GMT
Update previous patch to install modules into the "updates" directory to make sure the dkms built modules have higher priority than the in kernel ones.
Comment by Mario Jaeger (j00n) - Thursday, 17 January 2019, 10:21 GMT
I can also confirm that with the latest version 6.0.2 the problem still exists. The copy&paste function is also broken, which is related to VBoxService as well I think. The provided patch by Lin Xiao works. Thank you.
Comment by Luís Mendes (luisgbm) - Friday, 25 January 2019, 14:39 GMT
How is this still unconfirmed?
Comment by steadfasterX (steadfasterX) - Friday, 25 January 2019, 14:43 GMT
Thanks for the patch Lin Xiao!
Works again with that mod.. hope to see a fix in the pkg soon
Comment by Luís Mendes (luisgbm) - Monday, 28 January 2019, 18:31 GMT
Updated to virtualbox-guest-utils 6.0.4-1, problem still exists
Comment by Patrick Goetz (pgoetz) - Wednesday, 13 March 2019, 13:11 GMT
As reported here: https://www.virtualbox.org/ticket/17728#no1

the in-kernel vbox modules (vboxdrv, vboxguest,vboxvideo, vboxsf) are currently not being maintained and are consequently no longer in sync with upstream. Seems like this problem is only going to get worse over time. As suggested by Lin Xiao, the most obvious solution is to modify the VirtualBox PKGBUILD to compile and replace the in kernel modules as well as the user space stuff. This also is more in accordance with the Arch Linux principle of following upstream as closely as possible.
Comment by Jorge Silva (jncs12) - Monday, 25 March 2019, 11:47 GMT
Problem still occurs on virtualbox-guest-utils 6.0.4-4.
Comment by loqs (loqs) - Saturday, 30 March 2019, 09:39 GMT Comment by Luís Mendes (luisgbm) - Wednesday, 17 April 2019, 11:18 GMT
I couldn't test it yet, but it seems as of kernel 5.1-rc3 the issue is fixed, according to the link @loqs mentioned. I've also found this comment from Torvalds:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=6f51092301a42105c5cfcb96033e8734aa1bf160

"The vboxguest patches are a bit larger. They resolve the fact that virtual box decided to change their api in their latest release in a way that broke the existing kernel code, despite saying that they were never going to do that. So this is a bit of a "new feature", but is good to get merged so that 5.1 will work with the latest release. The changes are not large and of course virtual box "swears" they will not break this again, but no one is holding their breath here."

VirtualBox was updated to 6.0.6 to support kernels 5.0 and 5.1, so it seems a fix is just around the corner.
Comment by loqs (loqs) - Wednesday, 17 April 2019, 16:39 GMT
https://wiki.archlinux.org/index.php/Unofficial_user_repositories#miffe contains linux-mainline if the issue is no one wants to build a kernel from source and are prepared to trust a user repo.
If someone confirms the commit resolves the issue then arch could consider cherry-picking the commit.
Edit:
archive from makepkg --source of patched linux-5.0.8.arch1-1 to extract and build
test.patch git diff from linux-5.0.8.arch1-1
Comment by nl6720 (nl6720) - Thursday, 18 April 2019, 11:14 GMT
Tested on guest with:
linux 5.0.8.arch1-1 & linux-headers 5.0.8.arch1-1 (with cherry-picked 0532a1b0d045115521a93acf28f1270df89ad806)
virtualbox-guest-utils-nox 6.0.6-1
virtualbox-guest-dkms 6.0.6-1

Still the same issue:
VBoxService[694]: 11:06:40.575256 automount Error: vbsvcAutomounterMountIt: Failed to mount 'VM-shared' on '/media/sf_VM-shared' because it is probably mounted elsewhere arleady! (-1,22)
VBoxService[694]: 11:06:41.584245 automount Error: vbsvcAutomounterMountIt: Failed to mount 'VM-shared' on '/media/sf_VM-shared' because it is probably mounted elsewhere arleady! (-1,22)

Do I also need to install the patched kernel on the host?
Comment by Lin Xiao (xiaoliniess) - Thursday, 18 April 2019, 11:39 GMT
See https://bugzilla.redhat.com/show_bug.cgi?id=1689750, comment 4 and 5 from Hans de Goede.
There are two bugs here.
The kernel change is to fix  bug 61185  (which is fixed by archlinux virtualbox maintainer with a different way).
To fix this bug, you need code change from the vboxsf in github provided by Hans de Goede.
Comment by loqs (loqs) - Thursday, 18 April 2019, 11:44 GMT
Looking at the patch it only makes changes to the guest so I would not expect adding it to the host would make a difference but you could try it.
I would suggest contacting upstream either linux-kernel@vger.kernel.org which is unfortunately the main kernel list as there is not a separate list mentioned [1]
with a cc to hdegoede@redhat.com or email hdegoede@redhat.com asking if virtualbox guest automounting is supposed to work with that commit using the kernel modules plus vboxsf [2]

[1]
perl scripts/get_maintainer.pl drivers/virt/vboxguest/vboxguest_core.c
Hans de Goede <hdegoede@redhat.com> (maintainer:VIRTUAL BOX GUEST DEVICE DRIVER)
Arnd Bergmann <arnd@arndb.de> (maintainer:VIRTUAL BOX GUEST DEVICE DRIVER)
Greg Kroah-Hartman <gregkh@linuxfoundation.org> (maintainer:VIRTUAL BOX GUEST DEVICE DRIVER)
linux-kernel@vger.kernel.org (open list)

[2] https://github.com/jwrdegoede/vboxsf
Comment by Alexandre ZANNI (noraj) - Wednesday, 01 May 2019, 13:52 GMT
Tried linux 5.0.10.arch1-1 and linux-lts 4.19.37-1. Host having virtualbox 6.0.6-2 and guest with community/virtualbox-guest-dkms 6.0.6-2 (also tried community/virtualbox-guest-modules-arch 6.0.6-4 community/virtualbox-guest-utils 6.0.6-2 earlier for vanilla kernel).

Kernel modules are failing for vanilla kernel but not for LTS kernel so vboxservice for vanilla but not for LTS.

But even in LTS auto-mounting keep failing:

sudo systemctl status vboxservice
[sudo] password for noraj:
● vboxservice.service - VirtualBox Guest Service
Loaded: loaded (/usr/lib/systemd/system/vboxservice.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2019-05-01 15:49:17 CEST; 1min 15s ago
Process: 336 ExecStartPre=/usr/bin/modprobe vboxguest (code=exited, status=0/SUCCESS)
Process: 342 ExecStartPre=/usr/bin/modprobe vboxvideo (code=exited, status=0/SUCCESS)
Process: 356 ExecStartPre=/usr/bin/modprobe vboxsf (code=exited, status=0/SUCCESS)
Main PID: 357 (VBoxService)
Tasks: 8 (limit: 4670)
Memory: 3.0M
CGroup: /system.slice/vboxservice.service
└─357 /usr/bin/VBoxService -f

mai 01 15:49:17 penarch VBoxService[357]: 13:49:17.364369 main OS Release: 4.19.37-1-lts
mai 01 15:49:17 penarch VBoxService[357]: 13:49:17.364371 main OS Version: #1 SMP Sat Apr 27 10:16:32 CEST 2019
mai 01 15:49:17 penarch VBoxService[357]: 13:49:17.364373 main Executable: /usr/bin/VBoxService
mai 01 15:49:17 penarch VBoxService[357]: 13:49:17.364373 main Process ID: 357
mai 01 15:49:17 penarch VBoxService[357]: 13:49:17.364374 main Package type: LINUX_64BITS_GENERIC (OSE)
mai 01 15:49:17 penarch VBoxService[357]: 13:49:17.365148 main 6.0.6 r129722 started. Verbose level = 0
mai 01 15:49:17 penarch VBoxService[357]: 13:49:17.413802 automount Error: vbsvcAutomounterMountIt: Failed to mount 'Share' on '/home/noraj/Share' because it is probably mounted elsewhere arleady! (-1,22)
mai 01 15:49:17 penarch VBoxService[357]: 13:49:17.459553 automount Error: vbsvcAutomounterMountIt: Failed to mount 'Share' on '/home/noraj/Share' because it is probably mounted elsewhere arleady! (-1,22)
mai 01 15:49:18 penarch VBoxService[357]: 13:49:18.505087 automount Error: vbsvcAutomounterMountIt: Failed to mount 'Share' on '/home/noraj/Share' because it is probably mounted elsewhere arleady! (-1,22)
mai 01 15:49:18 penarch VBoxService[357]: 13:49:18.552677 automount Error: vbsvcAutomounterMountIt: Failed to mount 'Share' on '/home/noraj/Share' because it is probably mounted elsewhere arleady! (-1,22)

In LTS manual mount with options fails too:

sudo mount -o umask=0022,gid=1000,uid=1000 -t vboxsf Share /home/noraj/Share
mount: /home/noraj/Share: wrong fs type, bad option, bad superblock on Share, missing codepage or helper program, or other error.


But in LTS manual mount without options works:

sudo mount -t vboxsf Share /home/noraj/Share
Comment by Lin Xiao (xiaoliniess) - Wednesday, 15 May 2019, 23:10 GMT
Replacing the "101-vboxsf-automount.patch" in archlinux with "0001-VBoxServiceAutoMount-Change-Linux-mount-code-to-use-.patch" from fedora's virtualbox-guest-additions package can fix the automount problem.
As the upstream introduced another bug(https://www.virtualbox.org/ticket/18569) in vboxsf since 6.0.6 and still not fixed in 6.0.8, using vboxsf from github is a better option now.

Loading...