Vagrant Docker hangs on syncing folder to host VM

2,179 views
Skip to first unread message

Paul Umbers

unread,
May 14, 2014, 10:20:35 AM5/14/14
to vagra...@googlegroups.com
Running Windows 7 Pro SP1 host, Vagrant 1.6.2 and VirtualBox 4.3.10 r93012. When I start a docker container using "vagrant up --provider=docker" with the following Vagrantfile:

Vagrant.configure("2") do |config|
config.vm.provider "docker" do |docker|
docker.image = "dockerfile/mongodb"
docker.has_ssh = true
end
end

... the first part of the startup seems normal, but then hangs indefinitely on "Syncing folders to the host VM ...":

Bringing machine 'default' up with 'docker' provider...
==> default: Docker host is required. One will be created if necessary...
    default: Vagrant will now create or start a local VM to act as the Docker
    default: host. You'll see the output of the `vagrant up` for this VM below.
    default:
    default: Importing base box 'mitchellh/boot2docker'...
    default: Matching MAC address for NAT networking...
    default: Checking if box 'mitchellh/boot2docker' is up to date...
    default: Setting the name of the VM: docker-host_default_1400076651055_74297
    default: Clearing any previously set network interfaces...
    default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Forwarding ports...
    default: 4243 => 4243 (adapter 1)
    default: 22 => 2222 (adapter 1)
    default: Running 'pre-boot' VM customizations...
    default: Booting VM...
    default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: docker
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Machine booted and ready!
==> default: Syncing folders to the host VM...

This happens whether I use a canned Docker image (as above) or point the Vagrantfile at a Dockerfile for Docker to build the image. Disabling folder sync appears to let the boot continue normally, but I need to have some additional files pulled in to the image from the host file system, so really need folder syncing to work.

I've not been able to find anything definitive using Google, or in this forum or on the Vagrant issues list. I did find this: https://github.com/mitchellh/vagrant/issues/3789 which relates to an rsync installation failure, but again: not definitive. I'm wondering if there is an authentication problem and Vagrant can't log in to the VM, would that cause it to hang at this point?

Anybody got any ideas?

Thx.

Michael Sverdlik

unread,
May 14, 2014, 3:16:55 PM5/14/14
to vagra...@googlegroups.com
try running vagrant up with --debug, this can shed some light on what's going on.

Paul Umbers

unread,
May 14, 2014, 5:05:46 PM5/14/14
to vagra...@googlegroups.com
Here's the debug output ... still not sure what the issue is though as I don't really understand the debug:

 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x43bce40>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::IsState:0x43ed968>
DEBUG is_state: Checking if machine state is 'not_created'
 INFO machine: New machine ID: nil
DEBUG is_state: -- Machine state: not_created
 INFO warden: Calling OUT action: #<Vagrant::Action::Builtin::IsState:0x43ed968>
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Warden:0x44b9218>
 INFO warden: Calling IN action: #<Proc:0x45991c8@C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/action/warden.rb
:94 (lambda)>
 INFO warden: Calling IN action: #<Proc:0x44b9170@C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.6.2/lib/vagrant/action/warden.rb
:94 (lambda)>
 INFO warden: Calling IN action: #<VagrantPlugins::DockerProvider::Action::HostMachineBuildDir:0x46d5458>
 INFO warden: Calling IN action: #<VagrantPlugins::DockerProvider::Action::HostMachineSyncFolders:0x4701060>
DEBUG environment: Attempting to acquire process-lock: af1c9f26ffaaeb3c90a19f8d872a5069
DEBUG environment: Attempting to acquire process-lock: dotlock
 INFO environment: Acquired process lock: dotlock
 INFO environment: Released process lock: dotlock
 INFO environment: Acquired process lock: af1c9f26ffaaeb3c90a19f8d872a5069
 INFO interface: output: Syncing folders to the host VM...
 INFO interface: output: ==> default: Syncing folders to the host VM...
==> default: Syncing folders to the host VM...
 INFO machine: Calling action: sync_folders on provider VirtualBox (3bfb031a-12c9-443a-9ba7-36641d6a6dfd)
DEBUG environment: Attempting to acquire process-lock: machine-action-c15b20aa3632620243c1390f395d84f7
DEBUG environment: Attempting to acquire process-lock: dotlock
 INFO environment: Acquired process lock: dotlock
 INFO environment: Released process lock: dotlock
 INFO environment: Acquired process lock: machine-action-c15b20aa3632620243c1390f395d84f7
 INFO environment: Released process lock: machine-action-c15b20aa3632620243c1390f395d84f7
 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 1 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x472d7d8>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::SyncedFolders:0x4737978>
 INFO subprocess: Starting process: ["C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\/powershell.EXE", "-NoProfile", "-ExecutionPolicy", "Bypass", "$PSVersionTable.PSVersion.Major"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: 2

Michael Sverdlik

unread,
May 14, 2014, 5:23:03 PM5/14/14
to vagra...@googlegroups.com
Try to manually specify rsync sync folder as a workaround, see if that helps. You need to use rsync since boot2docker image doesn't support VirtualBox Guest Additions.

Adam Stallard

unread,
Jun 2, 2014, 11:01:00 AM6/2/14
to vagra...@googlegroups.com
Sorry to chime in, but I am having the same problem, also windows 7, using vagrant 1.6.3, also using the docker provider.  I added this line to the Vagrantfile:

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

and it first tried complained that it couldn't find rsync in the path, so I installed rsync (for cygwin 64 bit), and then it went back to hanging again in the same place, same debug output.

I changed the line in the Vagrantfile to say

config.vm.synced_folder ".", "/vagrant", disabled: "true"

and now it doesn't care whether or not rsync exists, but either way it will hang in the same place, same debug output.

I really don't care about file syncing yet, so maybe Paul could tell me how he disabled file syncing for docker under windows.
Message has been deleted

Gary Gutman

unread,
Sep 11, 2014, 8:02:27 PM9/11/14
to vagra...@googlegroups.com
Hi everyone,

I am also having the same problem. I was wondering if anyone managed to figure out the problem

I am on Windows 7 SP1, using vagrant 1.6.3 and VBox 4.3.16.

My vagrant file is as follows

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
    config.vm.provider "docker" do |d|
 d.image = "jenkins"
 d.has_ssh = true
    end
end

 I ran with debug enabled and these are the last few lines of the output.


==> default: Syncing folders to the host VM...
 INFO machine: Calling action: sync_folders on provider VirtualBox (aefc7378-de3a-4c7b-b62f-c743ee5b8f1f)
DEBUG environment: Attempting to acquire process-lock: machine-action-db2295e977cb9d103fb248d0808988f4

DEBUG environment: Attempting to acquire process-lock: dotlock
 INFO environment: Acquired process lock: dotlock
 INFO environment: Released process lock: dotlock
 INFO environment: Acquired process lock: machine-action-db2295e977cb9d103fb248d0808988f4
 INFO environment: Released process lock: machine-action-db2295e977cb9d103fb248d0808988f4

 INFO runner: Preparing hooks for middleware sequence...
 INFO runner: 2 hooks defined.
 INFO runner: Running action: #<Vagrant::Action::Builder:0x361d148>
 INFO warden: Calling IN action: #<Vagrant::Action::Builtin::SyncedFolders:0x36a27c8>
 INFO subprocess: Starting process: ["C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\/powershell.EXE", "-NoProfile", "-ExecutionPolicy", "Bypass", "$PSVersionTable.PSVersion.Major"]

DEBUG subprocess: Selecting on IO
DEBUG subprocess: stdout: 2

Fernando Hernández Mena

unread,
Oct 23, 2015, 4:36:42 PM10/23/15
to Vagrant
I am experiencing same issue, same debug output, have you found some work-around?

Alvaro Miranda Aguilera

unread,
Oct 23, 2015, 7:28:45 PM10/23/15
to vagra...@googlegroups.com
Hello Fernando

You are replying to a very old thread.

Can you describe what's the issue you are having?

What's the host OS and VM os?

Thanks
Alvaro
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues: https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/6eb32e5c-c77a-4431-bc32-9af0aca81021%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages