Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vagrant with Docker Provider requires RSync Password

Starting vagrant (up) with a docker provider creates an rsync issue because rsync tries syncing with a docker user and asks me for its password, which of course I do not have. If I exchange the docker provider with a vm.box everything is fine. The messages I get are:

WDFM32388067A:vagranttest d022051$ vagrant up
Bringing machine 'default' up with 'docker' provider...
==> default: Docker host is required. One will be created if necessary...
    default: Docker host VM is already ready.
==> default: Syncing folders to the host VM...
    default: The machine you're rsyncing folders to is configured to use
    default: password-based authentication. Vagrant can't script rsync to automatically
    default: enter this password, so you'll likely be prompted for a password
    default: shortly.
    default: 
    default: If you don't want to have to do this, please enable automatic
    default: key insertion using `config.ssh.insert_key`.
    default: Rsyncing folder: /Users/d022051/tmp/vagranttest/ => /var/lib/docker/docker_1437748320_29948
[email protected]'s password: 
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /Users/d022051/tmp/vagranttest/
Guest path: /var/lib/docker/docker_1437748320_29948
Command: rsync --verbose --archive --delete -z --copy-links --no-owner --no-group --rsync-path sudo rsync -e ssh -p 2222 -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile=/dev/null --exclude .vagrant/ /Users/d022051/tmp/vagranttest/ [email protected]:/var/lib/docker/docker_1437748320_29948
Error: Warning: Permanently added '[127.0.0.1]:2222' (RSA) to the list of known hosts.
Connection closed by 127.0.0.1
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.1]

And this is the relevant part from the Vagrant configuration:

  config.vm.provider "docker" do |d|
    d.image = "bowline/orientdb:dev"
  end

  config.vm.synced_folder ".", "/vagrant", type: "rsync"

Is there a default password for the docker user? Do I have to create the docker user in my docker image?

UPDATE: After a reboot of my Mac the problem is transformed. Now the problem is that vagrant try to install rsync on the VM and fails. So consider this question closed, as I currently cannot reproduce the original issue.

like image 895
Gregor Avatar asked Jul 24 '15 14:07

Gregor


1 Answers

With Vagrant 1.7. tcuser works with the username docker

The box being used hashicorp/boot2docker is built and configured with this password

https://github.com/mitchellh/boot2docker-vagrant-box/blob/master/template.json#L18

like image 67
4m1nh4j1 Avatar answered Sep 25 '22 22:09

4m1nh4j1