vboxsf "error -2" on linux guest

Discussions about using Linux guests in VirtualBox.
Post Reply
brainchild
Posts: 44
Joined: 31. May 2021, 02:09

vboxsf "error -2" on linux guest

Post by brainchild »

I have three shared folders for a Linux guest on a Linux host.

All three shares are configured to mount automatically through fstab on the guest, but only two do so. The third mounts manually only. I only need to give the mount path when mounting manually, demonstrating that the mount point is successfully mapped to the target by fstab.

From kern.log, the following messages appears from boot:

Code: Select all

vboxsf: Host rejected mount of '/my/mount/path' with error -2.
I have found no documentation for "error -2".

Does anyone know what it means?

I am running VirtualBox 6.1.30 (r148432).
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: vboxsf "error -2" on linux guest

Post by scottgus1 »

Please see this: viewtopic.php?f=6&t=104721, see if it helps.
brainchild
Posts: 44
Joined: 31. May 2021, 02:09

Re: vboxsf "error -2" on linux guest

Post by brainchild »

scottgus1 wrote:Please see this: viewtopic.php?f=6&t=104721, see if it helps.
My situation is different. I was only successful mounting through fstab. I did not observe any benefit from specifying a mount point in the VM configuration through VirtualBox. I have three shared folders with analogous configuration, but only two mount successfully at boot. Presently, I have checked "automount" and also have given a mount point matching the one in fstab. As I have indicated, as far as I observe, these values are ignored.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: vboxsf "error -2" on linux guest

Post by fth0 »

FWIW, the error message is not created by VirtualBox. Please provide a (zipped) VBox.log file from a VM run, so that we can see what VirtualBox has to say about the issue.
brainchild
Posts: 44
Joined: 31. May 2021, 02:09

Re: vboxsf "error -2" on linux guest

Post by brainchild »

fth0 wrote:FWIW, the error message is not created by VirtualBox. Please provide a (zipped) VBox.log file from a VM run, so that we can see what VirtualBox has to say about the issue.
The message appears to be coming from the driver for the file system.

I have attached the logs.

Thanks for your help.
Attachments
VBox.log.zip
(24.96 KiB) Downloaded 4 times
Last edited by brainchild on 30. Dec 2021, 09:06, edited 1 time in total.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: vboxsf "error -2" on linux guest

Post by fth0 »

You haven't successfully installed the VirtualBox Guest Additions (GA) 6.1.30 inside the guest OS. In consequence, an ancient VirtualBox GA 6.0.0 kernel module (which probably is part of some Debian kernel module package) is being used. Please install the GA 6.1.30, and watch for potential error messages during the installation.

PS: You also didn't succeed with obfuscating your username. ;) Please provide a consistent VBox.log file the next time.
brainchild
Posts: 44
Joined: 31. May 2021, 02:09

Re: vboxsf "error -2" on linux guest

Post by brainchild »

fth0 wrote:You haven't successfully installed the VirtualBox Guest Additions (GA) 6.1.30 inside the guest OS. In consequence, an ancient VirtualBox GA 6.0.0 kernel module (which probably is part of some Debian kernel module package) is being used. Please install the GA 6.1.30, and watch for potential error messages during the installation.
I tried installing the tools from the repository.

Code: Select all

apt install libvirt-daemon-driver-vbox
270 Mb of disk space later, the problem remains.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: vboxsf "error -2" on linux guest

Post by mpack »

The user manual has a section (4.2.2) on how to install Guest Additions in Linux. Perhaps it could be worth a read since I'm not seeing your "apt install" command in there: though I may have missed it, in which case perhaps you could give me the section number.
brainchild
Posts: 44
Joined: 31. May 2021, 02:09

Re: vboxsf "error -2" on linux guest

Post by brainchild »

mpack wrote:The user manual has a section (4.2.2) on how to install Guest Additions in Linux. Perhaps it could be worth a read since I'm not seeing your "apt install" command in there: though I may have missed it, in which case perhaps you could give me the section number.
I tried installing the additions from the official media, as suggested, rather than the distribution dependent packages.

The installation succeeded, but had no effect on my problem.

I reviewed the logs for the systemctl unit associated with the fstab entry, and discovered the following message:

Code: Select all

/sbin/mount.vboxsf: shared folder 'home' was not found (check VM settings / spelling)
I can mount the share using the mount command, even without the share name, which proves that the fstab entry is valid, but some problem occurs in the systemctl unit responsible for mounting the share.

It is quite frustrating, because I attempted changing this name, deleting the entry in the VM and re-adding it, rearranging the order of entries in fstab, and similar variations. The effect is always the same. The other shares mount, but this one does not. I can think of nothing exceptional about it.

I tried looking in the VM definition file (.vbox) but saw no entries for the shared folders. I was hoping to find some strange serialization for the options, which might affect the operation of the VM, but now I am simply wondering where these entries are saved. Somehow they are persisted, but not in the natural location.
brainchild
Posts: 44
Joined: 31. May 2021, 02:09

Re: vboxsf "error -2" on linux guest

Post by brainchild »

An update...

I again tried one of the experiments I though I had conducted properly earlier, except this time my results were successful.

Changing the name of the share from "home" to anything else, e.g. "myhome", make it work correctly.

Either the name has been tainted by some residual configuration artifact from the past, or it creates a conflict with some other component (possibly in the way systemd names units, for example, a conflict with the unit responsible for mounting /home form the guest virtual hard drive).
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: vboxsf "error -2" on linux guest

Post by scottgus1 »

brainchild wrote:I tried looking in the VM definition file (.vbox) but saw no entries for the shared folders.
If you looked in the VM's .vbox file before the Virtualbox service wrote out it's memory contents, then you might see what you saw.

The service stores all contents of the .vbox files at the start of Virtualbox usage, and it may or may not write out changes at any time. The only time you're guaranteed to see the VM settings in the .vbox file is at least when the VM is shut down, at most after all VMs and the Virtualbox service have shut down.
brainchild
Posts: 44
Joined: 31. May 2021, 02:09

Re: vboxsf "error -2" on linux guest

Post by brainchild »

Yes, I found the items, finally. It seems they are just some simple XML elements with a few attributes, and not suspect in any way.

I suppose the issue is guest-side, probably related to quirks in systemd, which perhaps in principle could me be handled more effectively by the guest tools, or perhaps not.

For now the workaround is using the "myhome" label instead of "home".
Post Reply