Vagrant Mount Error After Installing Docker

I get a strange error in my roaming VM. So I created a new ubuntu / trusty64 virtual machine using VirtualBox (on OS X, if anyone is interested).

Everything is good there ...

Then I installed Docker according to the instructions, which basically include starting up

wget -qO- https://get.docker.com/ | sh 

This works well too.

Then I go to reboot the virtual machine, I vagrant reload ssh shell and run vagrant reload , and I get this error message.

 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 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 last command was: stdin: is not a tty /sbin/mount.vboxsf: mounting failed with the error: No such device 

Any thoughts?

+6
source share
1 answer

I ran into similar problems. It seems that Docker (and possibly other tools) will update the kernel version on the Ubuntu/Trusty64 guest system Ubuntu/Trusty64 . Since VBox GuestAdditions, which were pre-installed on Ubuntu/Trusty64 , were specially created against the original kernel version, guest add-ons will stop working in the next vagrant up or vagrant reload , as happens when starting a new kernel installed by Docker. point, Vagrant can no longer automatically mount the /vagrant folder (or any synchronized folder for this question), as guest add-ons were created against a different kernel.

To make them work again, you will have to rebuild GuestAdditions against the new kernel version installed by Docker.

Fortunately, there is a plugin in Vagrant called vagrant-vbguest that takes care of automatically rebuilding guest add-ons when the plugin detects that they need to be rebuilt (for example, when the kernel changes in the guest system or you updated the version of VirtualBox to the host)

So, in my case, an easy way to fix this:

  • Host: $ vagrant plugin install vagrant-vbguest
  • In the guest book: $ sudo apt-get install linux-headers-$(uname -r)
  • Host: $ vagrant reload

Thanks to the vagrant-vbguest new VBox GuestAdditions will be automatically rebuilt against the new version of your kernel (for which you would load the required headers in the second step above).

After GuestAdditions returns to the form, the synchronized folders should work again, and the /vagrant should succeed.

Give it a try.

+12
source

All Articles