Vagrant is one of the preferred tools of my developer colleagues. Previously I wrote about exporting & importing Vagrant boxes.
Today one of my colleagues pinged me regarding a broken Vagrant box where it was not possible to share folders between guest & host machine. We’re using Vagrant with VirtualBox and the VirtualBox Guest Additions makes it easy to share folders.
The error that Vagrant displayed was pretty obvious about the issue with Guest Additions.
set -e mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
The error output from the command was:
No such file or directory
It happened that the version of Guest Additions and that of VirtualBox were different. An upgrade would surely solve the issue. A much quicker solution is to have the “vagrant-vbguest” plugin take care of keeping VirtualBox Guest Additions updated.
$ vagrant plugin install vagrant-vbguest
That’s it! Next time you vagrant up
it does a check on the VirtualBox Guest Additions and updates accordingly.