lmakarov / boot2docker-vagrant

[DEPRECATED] Boot2docker Vagrant box for optimized Docker and Docker Compose use on Mac and Windows
145 stars 41 forks source link

Vagrant and VirtualBox version incompatibility problems #83

Closed Meuk closed 8 years ago

Meuk commented 8 years ago

Hi,

We've recently updates our docker machines here, and we're running into the issue that the .ssh folder cannot be mounted, thus stopping the whole vagrant up proces. The error is

==> boot2docker: Mounting shared folders... boot2docker: /.ssh => /Users/gnoesiboe/.ssh 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 attemped was:

set -e mount -t vboxsf -o uid=id -u docker,gid=getent group docker | cut -d: -f3 .ssh /.ssh mount -t vboxsf -o uid=id -u docker,gid=id -g docker .ssh /.ssh

The error output from the command was:

mount: mounting .ssh on /.ssh failed: Protocol error

when running the commands

set -e mount -t vboxsf -o uid=id -u docker,gid=getent group docker | cut -d: -f3 .ssh /.ssh mount -t vboxsf -o uid=id -u docker,gid=id -g docker .ssh /.ssh

in the guest, we're getting the following error

docker@b2d-vagrant:~$ mount -t vboxsf -o uid=id -u docker,gid=getent group do cker | cut -d: -f3 .ssh /.ssh -sh: getent: not found mount: you must be root

gnoesiboe commented 8 years ago

Does anyone have a solution yet? Even if it's just a temporary solution/workaround?

lmakarov commented 8 years ago

@Meuk, @gnoesiboe what are your VirtualBox and Vagrant versions, also your OS (Mac or Windows)? There are issues with newer version incompatibilities between VirtualBox, Vagrant and boot2docker.iso.

The following combination should work:

Try this for downgrading on Windows via choco:

choco upgrade virtualbox --version 5.0.24.108355 -y
choco upgrade vagrant --version 1.8.4 -y

Unfortunately on Mac cask does not support version selection, so you will have to uninstall prerequisites first:

brew cask uninstall virtualbox
brew cask uninstall vagrant

After that manually install version mentioned above. DO NOT re-run the prerequisites installation script, since this will install the latest versions via brew cask again.

gnoesiboe commented 8 years ago

@lmakarov I was running the latest versions of Vagrant (1.8.5) and VirtualBox (5.1.2), combined with the 'develop'-branch state of your vagrant.yml and VagrantFile, on mac.

Last night I downgraded to:

And got it to work again for now. Hope this helps you to reproduce the problem :)

lmakarov commented 8 years ago

Vagrant 1.8.5 should be compatible with the latest VirtualBox 5.1.2 release, however VirtualBox Guest Additions version we currently have is 5.0.20 and the latest boot2docker release is at 5.0.24. Both will most likely have issues with VirtualBox 5.1.2.

So for now avoid VirtualBox 5.1.x and stick with:

We can get versions locked for Windows users in dsh install prerequisites, however not for Mac users, as cask does not (and looks like won't) support this...

martinbroos commented 8 years ago

I tested this with:

Everything works again as expected. Thanks for the help.

tdroenner commented 8 years ago

It still doesn't work with the new blinkreaction/boot2docker 1.12.1 image

lmakarov commented 8 years ago

@tdroenner what OS are you on and what's the error that you are getting?

tdroenner commented 8 years ago

Windows 10. It's the same error as the first post: ==> boot2docker: Mounting shared folders... boot2docker: /.ssh => /Users/gnoesiboe/.ssh 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 attemped was:

set -e mount -t vboxsf -o uid=id -u docker,gid=getent group docker | cut -d: -f3 .ssh /.ssh mount -t vboxsf -o uid=id -u docker,gid=id -g docker .ssh /.ssh

I'v tried VBox 5.1.4 with Vagrant 1.8.5 and the 1.12.1 Boot2docker Image used in the Vagrantfile.

lmakarov commented 8 years ago

Yeah, I just finished testing on Windows 10 and Mac - same error:

The error output from the command was:

mount: mounting .ssh on /.ssh failed: Protocol error

Even if all custom mounts are removed (.ssh and .home) it would still choke on the default one (vagrant):

The error output from the command was:

mount: mounting vagrant on /vagrant failed: Protocol error

This issue is unrelated to the Guest Additions version and I was not able to find too many mentions of this issue online (quite surprised).

So looks like sticking with the older versions or vagrant and virtualbox is still the best option (https://github.com/blinkreaction/boot2docker-vagrant/issues/83#issuecomment-237628524).

lmakarov commented 8 years ago

I have finally figured out what the problem was.

Vagrant v1.8.5 is to be blamed for this. In particular this commit and line - https://github.com/mitchellh/vagrant/commit/7e88266999e0eaf86299421e99a4fb038b4f2b1c#diff-97d643b35101562477f4b556a379415fR14

Looks like they refactored it once again in master - https://github.com/mitchellh/vagrant/commit/dd6ad2fbf3bc935dbb127bf5552dcc5990b8e3e6 The fix should be out in v1.8.6 (currently due by September 1, 2016).

I rolled out a hotfix release v1.7.1 of blinkreaction/boot2docker-vagrant that should address this issue via a temporary workaround.

For those interested in the technical details, here's what the workaround looks like - https://github.com/blinkreaction/boot2docker-vagrant/commit/a072a84df6f8dbcad239d9b992c4fc30285146a4