Vagrant issues with mounting shares. Ubuntu 16.04

If you have the following when you do vagrant up :

Failed to mount folders in Linux guest. This is usually because
the “vboxsf” file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u www-data`,gid=`getent group www-data | cut -d: -f3`,dmode=775,fmode=774 vflsf_s8ktdqeoxrjd /var/www
mount -t vboxsf -o uid=`id -u www-data`,gid=`id -g www-data`,dmode=775,fmode=774 vflsf_s8ktdqeoxrjd /var/www

The error output from the last command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

You probably have a different version of the guest additions installed in your virtual machine. if it is the case do the following.

sudo vagrant plugin install vagrant-vbguest

if that fails with :

Installing the ‘vagrant-vbguest’ plugin. This can take a few minutes…
/usr/lib/ruby/2.3.0/rubygems/specification.rb:946:in `all=’: undefined method `group_by’ for nil:NilClass (NoMethodError)
from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:275:in `with_isolated_gem’
from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:231:in `internal_install’
from /usr/lib/ruby/vendor_ruby/vagrant/bundler.rb:102:in `install’
from /usr/lib/ruby/vendor_ruby/vagrant/plugin/manager.rb:62:in `block in install_plugin’
from /usr/lib/ruby/vendor_ruby/vagrant/plugin/manager.rb:72:in `install_plugin’
from /usr/share/vagrant/plugins/commands/plugin/action/install_gem.rb:37:in `call’
from /usr/lib/ruby/vendor_ruby/vagrant/action/warden.rb:34:in `call’
from /usr/lib/ruby/vendor_ruby/vagrant/action/builder.rb:116:in `call’
from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `block in run’
from /usr/lib/ruby/vendor_ruby/vagrant/util/busy.rb:19:in `busy’
from /usr/lib/ruby/vendor_ruby/vagrant/action/runner.rb:66:in `run’
from /usr/share/vagrant/plugins/commands/plugin/command/base.rb:14:in `action’
from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:32:in `block in execute’
from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:31:in `each’
from /usr/share/vagrant/plugins/commands/plugin/command/install.rb:31:in `execute’
from /usr/share/vagrant/plugins/commands/plugin/command/root.rb:56:in `execute’
from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:42:in `execute’
from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:268:in `cli’
from /usr/bin/vagrant:173:in `<main>’

Remove vagrant

sudo apt-get remove vagrant

Install it with the debian package coming directly from the vagrant website. https://www.vagrantup.com/downloads.html

Then run

sudo vagrant plugin install vagrant-vbguest

Posted

in

by

Tags: