Skip to content

Instantly share code, notes, and snippets.

@anentropic
Last active August 25, 2016 16:30
Show Gist options
  • Save anentropic/5090049 to your computer and use it in GitHub Desktop.
Save anentropic/5090049 to your computer and use it in GitHub Desktop.
Solved vagrant mount -t vboxsf problem ...nothing to do with guest additions
[redis] Mounting shared folders...
[redis] -- v-root: /vagrant
[redis] -- v-csr-3: /tmp/vagrant-chef-1/chef-solo-3/roles
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` v-csr-3 /tmp/vagrant-chef-1/chef-solo-3/roles
$
and if you ssh in to the vm:
vagrant@redis:~$ sudo mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` v-csr-3 /tmp/vagrant-chef-1/chef-solo-3/roles
/sbin/mount.vboxsf: mounting failed with the error: Protocol error
I had the warning about version mismatch of Guest Additions:
[default] The guest additions on this VM do not match the install version of
VirtualBox! This may cause things such as forwarded ports, shared
folders, and more to not work properly. If any of those things fail on
this machine, please update the guest additions and repackage the
box.
Guest Additions Version: 4.2.0
VirtualBox Version: 4.2.8
Much of the advice online related to this error message (eg in the
Vagrant docs http://docs.vagrantup.com/v1/docs/troubleshooting.html)
centres around installing/re-installing a compatible version of the
Guest Additons.
This was not the problem.
Some other advice suggests it's maybe something to do with hostname
(https://forums.virtualbox.org/viewtopic.php?p=40918) and I was using
https://github.com/BerlinVagrant/vagrant-dns so I thought I could have
a problem there.
This was not the problem.
In the end I tracked it down: I had wrong path to my Chef roles (and
cookbooks etc) in the Vagrantfile eg here:
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["kitchen/cookbooks","kitchen/site-cookbooks"]
chef.roles_path = "kitchen/roles"
chef.data_bags_path = "kitchen/data_bags"
Let's have a look at that error message again:
vagrant@redis:~$ sudo mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` v-csr-3 /tmp/vagrant-chef-1/chef-solo-3/roles
/sbin/mount.vboxsf: mounting failed with the error: Protocol error
Yes, it's entirely my fault, but also... thanks for nothing!!!
@BrianHoltz
Copy link

Thanks!

@toomuchpete
Copy link

This also solved my problem. Thanks for this!

@ehernandez-xk
Copy link

I did not understand

When I run the command I get:

-sh: getent: not found
gid= requires an argument (i.e. gid==<arg>)
mount: mounting vagrant on /vagrant failed: Protocol error

I'm using a custom boot2docker and I trying to use it on Windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment