boot2docker / boot2docker

DEPRECATED; see https://github.com/boot2docker/boot2docker/pull/1408
https://github.com/boot2docker/boot2docker/pull/1408
Apache License 2.0
8.33k stars 1.29k forks source link

VirtualBox Guest Additions does not match VirtualBox version 5.1 #1190

Open jpresley23 opened 8 years ago

jpresley23 commented 8 years ago

I have a vagrant project that uses shared folders. The build breaks because I upgraded to VirtualBox 5.1 and the Guest Additions on boot2docker is still on 5.0. Below is the output of a vagrant up.

Bringing machine 'data' up with 'docker' provider...
Bringing machine 'percona' up with 'docker' provider...
Bringing machine 'memcached' up with 'docker' provider...
Bringing machine 'app' up with 'docker' provider...
Bringing machine 'phpfpm' up with 'docker' provider...
Bringing machine 'nginx' up with 'docker' provider...
==> data: Docker host is required. One will be created if necessary...
    data: Vagrant will now create or start a local VM to act as the Docker
    data: host. You'll see the output of the `vagrant up` for this VM below.
    data:  
    cms: Box 'dduportal/boot2docker' could not be found. Attempting to find and install...
    cms: Box Provider: virtualbox
    cms: Box Version: >= 0
    cms: Loading metadata for box 'dduportal/boot2docker'
    cms: URL: https://atlas.hashicorp.com/dduportal/boot2docker
    cms: Adding box 'dduportal/boot2docker' (v1.11.1) for provider: virtualbox
    cms: Downloading: https://atlas.hashicorp.com/dduportal/boxes/boot2docker/versions/1.11.1/providers/virtualbox.box
    cms: Successfully added box 'dduportal/boot2docker' (v1.11.1) for 'virtualbox'!
    cms: Importing base box 'dduportal/boot2docker'...
    cms: Matching MAC address for NAT networking...
    cms: Checking if box 'dduportal/boot2docker' is up to date...
    cms: Setting the name of the VM: bbl-cms_cms_1470245153891_69312
    cms: Clearing any previously set network interfaces...
    cms: Preparing network interfaces based on configuration...
    cms: Adapter 1: nat
    cms: Adapter 2: hostonly
    cms: Forwarding ports...
    cms: 2375 (guest) => 2375 (host) (adapter 1)
    cms: 2376 (guest) => 2376 (host) (adapter 1)
    cms: 22 (guest) => 2222 (host) (adapter 1)
    cms: Running 'pre-boot' VM customizations...
    cms: Booting VM...
    cms: Waiting for machine to boot. This may take a few minutes...
    cms: SSH address: 127.0.0.1:2222
    cms: SSH username: docker
    cms: SSH auth method: private key
    cms: Warning: Remote connection disconnect. Retrying...
    cms: Machine booted and ready!
    cms: Checking for guest additions in VM...
    cms: The guest additions on this VM do not match the installed version of
    cms: VirtualBox! In most cases this is fine, but in rare cases it can
    cms: prevent things such as shared folders from working properly. If you see
    cms: shared folder errors, please make sure the guest additions within the
    cms: virtual machine match the version of VirtualBox you have installed on
    cms: your host and reload your VM.
    cms: 
    cms: Guest Additions Version: 5.0.18
    cms: VirtualBox Version: 5.1
    cms: Setting hostname...
    cms: Configuring and enabling network interfaces...
    cms: Mounting shared folders...
    cms: /var/www => /Users/jpresley/projects/bbl-cms
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` var_www /var/www
mount -t vboxsf -o uid=`id -u docker`,gid=`id -g docker` var_www /var/www

The error output from the command was:

mount: mounting var_www on /var/www failed: Protocol error
ehernandez-xk commented 8 years ago

I have a similar error

I have my custom boot2docker from the latest release (v1.12.1) That release includes VirtualBox Guest Additions v5.1.2

vagrant: 1.8.4 VirtualBox: 5.1.4 Windows 7 Using Docker as provider Vagrant plugin vagrant-winnfsd

When I start the docker-host everything mounts well, but when I start a service vagrant up myservice I have this error:

Bringing machine 'author' up with 'docker' provider...
==> author: Docker host is required. One will be created if necessary...
    author: Docker host VM is already ready.
==> author: Syncing folders to the host VM...
    dockerhost: Mounting shared folders...
    dockerhost: /var/lib/docker/docker_1472059381_57325 => C:/Users/ehernandez/D
esktop/mycompany/mycompany
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` 98
4f505632 /var/lib/docker/docker_1472059381_57325
mount -t vboxsf -o uid=`id -u docker`,gid=`id -g docker` 984f505632 /var/lib/doc
ker/docker_1472059381_57325

The error output from the command was:

mount: mounting 984f505632 on /var/lib/docker/docker_1472059381_57325 failed: Pr
otocol error

Any idea?

Thank you

chirkin commented 8 years ago

The reason is missing getent command. Don't have ideas yet.

ehernandez-xk commented 8 years ago

Temporally I moved to Vagrant 1.8.4 and VB 5.0.x

lmakarov commented 8 years ago

See this comment for an explanation and a temporary fix (until vagrant 1.8.6 is released): https://github.com/blinkreaction/boot2docker-vagrant/issues/83#issuecomment-243599131

AlbanMontaigu commented 8 years ago

Another way is to install getent on tinycore boot2docker iso by building your own. The missing tiny core package is glibc-apps. Installing it shloud provide getent command and let virtualbox work with vagrant even if version is 1.8.5.

Regards.