This is 2017. Just in case someone faces the same issue.
For bento/centos-6.7, I was getting same error. That was solved by adding plugin vagrant-vbguest (0.13.0).
c:> vagrant plugin install vagrant-vbguest
Box url: http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_centos-7.0_chef-provisionerless.box
This centos-7 version was giving me same error
Error:
==> build: Mounting shared folders...
build: /vagrant => C:/projects/
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:
/sbin/mount.vboxsf: mounting failed with the error: No such device
My Configuration:
C:\projects>vagrant -v
Vagrant 1.9.1
C:\projects> vboxmanage -v
5.0.10r104061
C:\projects>vagrant plugin list
vagrant-cachier (1.2.1)
vagrant-hostmanager (1.8.5)
vagrant-hosts (2.8.0)
vagrant-omnibus (1.5.0)
vagrant-share (1.1.6, system)
vagrant-vbguest (0.13.0)
vagrant-vbox-snapshot (0.0.10)
Since I already have vagrant-vbguest plugin, it tries to update the VBoxGuestAdditions in centos-7 when it sees different version of VBGuestAdditions are installed in Host 5.0.10 and guest 4.3.20.
I even have checked that symbolic link exists.
[root@build VBoxGuestAdditions]# ls -lrt /usr/lib
lrwxrwxrwx. 1 root root 53 Jan 14 12:06 VBoxGuestAdditions -> /opt/VBoxGuestAdditions-5.0.10/lib/VBoxGuestAdditions
[root@build VBoxGuestAdditions]# mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant
/sbin/mount.vboxsf: mounting failed with the error: No such device
This did not work as suggested by user3006381
vagrant ssh
sudo yum -y install kernel-devel
sudo yum -y update
exit
vagrant reload --provision
Solution for centos-7: as given by psychok7 worked
Diabled autoupdate. config.vbguest.auto_update = false
Then vagrant destroy --force
and vagrant up
Result:
javareport: Guest Additions Version: 4.3.20
javareport: VirtualBox Version: 5.0
==> javareport: Setting hostname...
==> javareport: Configuring and enabling network interfaces...
==> javareport: Mounting shared folders...
javareport: /vagrant => C:/projects
C:\project>