I am having a strange issue using a synced folder using Vagrant with a Windows host and a Linux guest running in VirtualBox.
On the first boot (or after a vagrant destroy
), the project folder mounts to /vagrant with no issues, but after halting and starting the VM, the folder will not mount.
This is the error message that appears at the end of Vagrant's output:
...
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attempted was:
mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant
The error output from the command was:
: Protocol error
There are no synced folder related config options in the Vagrantfile, I'm just trying to use the default synced folder behavior.
Some similar looking questions suggest that running installing the Vagrant plugin vagrant-vbguest
might solve some similar looking problems, but I have this plugin. Also, both Virtual Box and the installed guest additions are version 5.1.10.
Once the machine has rebooted, running sudo mount -t vboxsf vagrant /vagrant
just gives this error:
/sbin/mount.vboxsf: mounting failed with the error: Protocol error
For some reason, sudo mount -t vboxsf Vagrant /vagrant
(capital V) will mount the synced folder. On the first boot mount | grep vagrant
shows that the synced folder is named vagrant
with a lowercase 'v', and VirtualBox shows the shared folder's name with a lowercase 'v', even after restarting the box.
I really need vagrant's default behavior to work correctly without giving an error. What is causing this to happen?