New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error getting IP address: Something went wrong running an SSH command #317

Closed
ghost opened this Issue Nov 22, 2015 · 66 comments

Comments

Projects
None yet
@ghost

ghost commented Nov 22, 2015

Hi all
I downloaded docker-machine from https://www.docker.com/docker-toolbox and installed on my mac os x el captain version 10.11. I followed the tutorials on the site and it worked fine.
Then today I start my computer and want to download mysql from docker hub.
I start Docker Quickstart Terminal and on the console, then it shows to me:

Machine default already exists in VirtualBox. 
Setting environment variables for machine default...
                    ##         .
              ## ## ##        ==
           ## ## ## ## ##    ===
       /"""""""""""""""""\___/ ===
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
       \______ o           __/
         \    \         __/
          \____\_______/
Error getting IP address: Something went wrong running an SSH command!
command : ip addr show dev eth1
err : exit status 255
output : 
docker is configured to use the default machine with IP For help getting started, check out the docs at https://docs.docker.com 

Error running connection boilerplate: Error getting driver URL: Something went wrong running an SSH command!
command : ip addr show dev eth1
err : exit status 255
output :

What do am I doing wrong?
Thanks

@liftoff-rating-scheme

This comment has been minimized.

Show comment
Hide comment
@liftoff-rating-scheme

liftoff-rating-scheme Nov 23, 2015

I get the same problem on OSX 10.10.5.

liftoff-rating-scheme commented Nov 23, 2015

I get the same problem on OSX 10.10.5.

@baoming

This comment has been minimized.

Show comment
Hide comment
@baoming

baoming Nov 27, 2015

windows 10 failed too.

windows 10 64bit
toolbox 1.9.1a

Creating Machine default...
Running pre-create checks...
Creating machine...
(default) OUT | Creating VirtualBox VM...
(default) OUT | Creating SSH key...
(default) OUT | Starting VirtualBox VM...
(default) OUT | Starting VM...
Error creating machine: Error in driver during machine creation: Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded
Looks like something went wrong... Press any key to continue...

baoming commented Nov 27, 2015

windows 10 failed too.

windows 10 64bit
toolbox 1.9.1a

Creating Machine default...
Running pre-create checks...
Creating machine...
(default) OUT | Creating VirtualBox VM...
(default) OUT | Creating SSH key...
(default) OUT | Starting VirtualBox VM...
(default) OUT | Starting VM...
Error creating machine: Error in driver during machine creation: Too many retries waiting for SSH to be available. Last error: Maximum number of retries (60) exceeded
Looks like something went wrong... Press any key to continue...

@owlas

This comment has been minimized.

Show comment
Hide comment
@owlas

owlas Nov 27, 2015

I have the same set up as kostonstyle and have also had the same problem. I loaded the quickstart terminal once and all was working, I then reloaded the terminal and it has thrown this error ever since.

owlas commented Nov 27, 2015

I have the same set up as kostonstyle and have also had the same problem. I loaded the quickstart terminal once and all was working, I then reloaded the terminal and it has thrown this error ever since.

@liftoff-rating-scheme

This comment has been minimized.

Show comment
Hide comment
@liftoff-rating-scheme

liftoff-rating-scheme Nov 27, 2015

I don't know why this worked (I'm new to docker), but removing the default vm and then reloading the quickstart terminal (creates a new default vm) worked for me.

liftoff-rating-scheme commented Nov 27, 2015

I don't know why this worked (I'm new to docker), but removing the default vm and then reloading the quickstart terminal (creates a new default vm) worked for me.

@bojanstef

This comment has been minimized.

Show comment
Hide comment
@bojanstef

bojanstef Nov 29, 2015

@reviling would there be a way to automate this?

$ docker-machine rm default
$ docker-machine create --driver virtualbox default

bojanstef commented Nov 29, 2015

@reviling would there be a way to automate this?

$ docker-machine rm default
$ docker-machine create --driver virtualbox default
@bojanstef

This comment has been minimized.

Show comment
Hide comment
@bojanstef

bojanstef Nov 30, 2015

I was able to recreate the issue by running

# hack/make.sh

Then ctrl-c'ing out before it completed
From: http://docs.docker.com/opensource/project/set-up-dev-env/
Specifically without "binary" at the end.

Machine default already exists in VirtualBox.
Setting environment variables for machine default...

                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/


docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com

Error running connection boilerplate: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.100:2376": tls: DialWithDialer timed out
You can attempt to regenerate them using 'docker-machine regenerate-certs name'.
Be advised that this will trigger a Docker daemon restart which will stop running containers.

bojanstef commented Nov 30, 2015

I was able to recreate the issue by running

# hack/make.sh

Then ctrl-c'ing out before it completed
From: http://docs.docker.com/opensource/project/set-up-dev-env/
Specifically without "binary" at the end.

Machine default already exists in VirtualBox.
Setting environment variables for machine default...

                        ##         .
                  ## ## ##        ==
               ## ## ## ## ##    ===
           /"""""""""""""""""\___/ ===
      ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
           \______ o           __/
             \    \         __/
              \____\_______/


docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com

Error running connection boilerplate: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.100:2376": tls: DialWithDialer timed out
You can attempt to regenerate them using 'docker-machine regenerate-certs name'.
Be advised that this will trigger a Docker daemon restart which will stop running containers.
@marklocker

This comment has been minimized.

Show comment
Hide comment
@marklocker

marklocker Dec 4, 2015

I'm also experiencing this error and have the same results as @reviling, running docker-machine rm default and then firing up the quickstart terminal worked for me - but I also don't know why…

I'm having to do this quite regularly, so if anyone has any ideas then please share them!

marklocker commented Dec 4, 2015

I'm also experiencing this error and have the same results as @reviling, running docker-machine rm default and then firing up the quickstart terminal worked for me - but I also don't know why…

I'm having to do this quite regularly, so if anyone has any ideas then please share them!

@ewilliam

This comment has been minimized.

Show comment
Hide comment
@ewilliam

ewilliam Dec 4, 2015

running into the same issue here. docker-machine rm default works, though annoying.

ewilliam commented Dec 4, 2015

running into the same issue here. docker-machine rm default works, though annoying.

@bobbypriambodo

This comment has been minimized.

Show comment
Hide comment
@bobbypriambodo

bobbypriambodo Dec 5, 2015

Encountered this issue after I ran docker pull training/sinatra, I don't know if it's relevant, but here are the full output of my terminal:

~  docker pull training/sinatra
Using default tag: latest
latest: Pulling from training/sinatra
d634beec75db: Pull complete
27fb5491e391: Pull complete
8e3415728a3f: Pull complete
630b03963440: Pull complete
962115fdbb58: Pull complete
9ea38b02c228: Pull complete
e20166048ece: Extracting [========================================>          ] 51.25 MB/62.67 MB
8b16a891bd1a: Download complete
Pulling repository docker.io/training/sinatra
f0f4ab557f95: Error pulling image (latest) from docker.io/training/sinatra, mkdir /mnt/sda1/var/lib/docker/graph/_tmp/acc5caf9b5f0080306956f9b43ae9106345e0ec675ae6e144e7ae869fa24811b: read-only file system 6e144e7ae869fa24811b: read-only file system
Error pulling image (latest) from docker.io/training/sinatra, mkdir /mnt/sda1/var/lib/docker/graph/_tmp/acc5caf9b5f0080306956f9b43ae9106345e0ec675ae6e144e7ae869fa24811b: read-only file system

You see, the e20166048ece: Extracting... part got stuck for a while and then the error pops out. I also tried one more time, but it gives me just the error.

~  docker pull training/sinatra
Using default tag: latest
latest: Pulling from training/sinatra
d634beec75db: Pulling fs layer
Pulling repository docker.io/training/sinatra
f0f4ab557f95: Error pulling image (latest) from docker.io/training/sinatra, mkdir /mnt/sda1/var/lib/docker/graph/_tmp/5d52c3b63b2a7c79b27a4d0d79ad4b544a6aacec467e6e35bb1847cb31e92097: read-only file system 6e35bb1847cb31e92097: read-only file system
Error pulling image (latest) from docker.io/training/sinatra, mkdir /mnt/sda1/var/lib/docker/graph/_tmp/5d52c3b63b2a7c79b27a4d0d79ad4b544a6aacec467e6e35bb1847cb31e92097: read-only file system

Thought the machine has stopped, so I checked, and here's where I encounter the error:

~  docker-machine start default
Machine "default" is already running.

➜  ~  docker-machine status default
Running

➜  ~  docker-machine ip default
Error getting IP address: Something went wrong running an SSH command!
command : ip addr show dev eth1
err     : exit status 255
output  :

docker-machine rm default and docker-machine create --driver virtualbox default fixed it, though... but my local images are lost! I'm still new to Docker so I find this confusing.

bobbypriambodo commented Dec 5, 2015

Encountered this issue after I ran docker pull training/sinatra, I don't know if it's relevant, but here are the full output of my terminal:

~  docker pull training/sinatra
Using default tag: latest
latest: Pulling from training/sinatra
d634beec75db: Pull complete
27fb5491e391: Pull complete
8e3415728a3f: Pull complete
630b03963440: Pull complete
962115fdbb58: Pull complete
9ea38b02c228: Pull complete
e20166048ece: Extracting [========================================>          ] 51.25 MB/62.67 MB
8b16a891bd1a: Download complete
Pulling repository docker.io/training/sinatra
f0f4ab557f95: Error pulling image (latest) from docker.io/training/sinatra, mkdir /mnt/sda1/var/lib/docker/graph/_tmp/acc5caf9b5f0080306956f9b43ae9106345e0ec675ae6e144e7ae869fa24811b: read-only file system 6e144e7ae869fa24811b: read-only file system
Error pulling image (latest) from docker.io/training/sinatra, mkdir /mnt/sda1/var/lib/docker/graph/_tmp/acc5caf9b5f0080306956f9b43ae9106345e0ec675ae6e144e7ae869fa24811b: read-only file system

You see, the e20166048ece: Extracting... part got stuck for a while and then the error pops out. I also tried one more time, but it gives me just the error.

~  docker pull training/sinatra
Using default tag: latest
latest: Pulling from training/sinatra
d634beec75db: Pulling fs layer
Pulling repository docker.io/training/sinatra
f0f4ab557f95: Error pulling image (latest) from docker.io/training/sinatra, mkdir /mnt/sda1/var/lib/docker/graph/_tmp/5d52c3b63b2a7c79b27a4d0d79ad4b544a6aacec467e6e35bb1847cb31e92097: read-only file system 6e35bb1847cb31e92097: read-only file system
Error pulling image (latest) from docker.io/training/sinatra, mkdir /mnt/sda1/var/lib/docker/graph/_tmp/5d52c3b63b2a7c79b27a4d0d79ad4b544a6aacec467e6e35bb1847cb31e92097: read-only file system

Thought the machine has stopped, so I checked, and here's where I encounter the error:

~  docker-machine start default
Machine "default" is already running.

➜  ~  docker-machine status default
Running

➜  ~  docker-machine ip default
Error getting IP address: Something went wrong running an SSH command!
command : ip addr show dev eth1
err     : exit status 255
output  :

docker-machine rm default and docker-machine create --driver virtualbox default fixed it, though... but my local images are lost! I'm still new to Docker so I find this confusing.

@illagrenan

This comment has been minimized.

Show comment
Hide comment
@illagrenan

illagrenan Dec 7, 2015

I have same issue on Windows 8.1.

docker --version
Docker version 1.9.1, build a34a1d5
docker-machine --version
C:\Program Files\Docker Toolbox\docker-machine.exe version 0.5.2 ( 0456b9f )
docker-compose --version
docker-compose version 1.5.2, build e5cf49d

// EDIT

Output of docker-machine ls is:

NAME      ACTIVE   DRIVER       STATE     URL   SWARM   ERRORS
default   -        virtualbox   Running                 Something went wrong running an SSH command!
command : ip addr show dev eth1
err     : exit status 255

In debug (docker-machine -D ls) mode I see:

...
(default) DBG | GuestAdditionsVersion="5.0.10 r104061"
(default) DBG | GuestAdditionsFacility_VirtualBox Base Driver=50,1449512600037
(default) DBG | GuestAdditionsFacility_VirtualBox System Service=50,1449512617542
(default) DBG | GuestAdditionsFacility_Seamless Mode=0,1449512600037
(default) DBG | GuestAdditionsFacility_Graphics Mode=0,1449512600037
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | }
(default) DBG | Using SSH client type: external
(default) DBG | About to run SSH command:
(default) DBG | ip addr show dev eth1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(default) DBG | SSH cmd err, output: exit status 255: cygwin warning:
...

If I run command manually I see:

ssh ip addr show dev eth1
Bad owner or permissions on /cygdrive/c/Users/<USERNAME>/.ssh/config

Here is solution to bad owner problem: https://superuser.com/questions/348694/bad-owner-or-permissions-error-using-cygwins-ssh-exe. docker-machine is working for me right now.

illagrenan commented Dec 7, 2015

I have same issue on Windows 8.1.

docker --version
Docker version 1.9.1, build a34a1d5
docker-machine --version
C:\Program Files\Docker Toolbox\docker-machine.exe version 0.5.2 ( 0456b9f )
docker-compose --version
docker-compose version 1.5.2, build e5cf49d

// EDIT

Output of docker-machine ls is:

NAME      ACTIVE   DRIVER       STATE     URL   SWARM   ERRORS
default   -        virtualbox   Running                 Something went wrong running an SSH command!
command : ip addr show dev eth1
err     : exit status 255

In debug (docker-machine -D ls) mode I see:

...
(default) DBG | GuestAdditionsVersion="5.0.10 r104061"
(default) DBG | GuestAdditionsFacility_VirtualBox Base Driver=50,1449512600037
(default) DBG | GuestAdditionsFacility_VirtualBox System Service=50,1449512617542
(default) DBG | GuestAdditionsFacility_Seamless Mode=0,1449512600037
(default) DBG | GuestAdditionsFacility_Graphics Mode=0,1449512600037
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | }
(default) DBG | Using SSH client type: external
(default) DBG | About to run SSH command:
(default) DBG | ip addr show dev eth1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(default) DBG | SSH cmd err, output: exit status 255: cygwin warning:
...

If I run command manually I see:

ssh ip addr show dev eth1
Bad owner or permissions on /cygdrive/c/Users/<USERNAME>/.ssh/config

Here is solution to bad owner problem: https://superuser.com/questions/348694/bad-owner-or-permissions-error-using-cygwins-ssh-exe. docker-machine is working for me right now.

@fergvick

This comment has been minimized.

Show comment
Hide comment
@fergvick

fergvick Dec 8, 2015

I have the same error though when trying

docker-machine rm default

it just got stuck and never gave any output, so I went ahead and removed the default folder manually. Though when trying to run

docker-machine create -d virtualbox default

It got stuck on creating shh again, this was the output;

Running pre-create checks...
Creating machine...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
Error creating machine: Error in driver during machine creation: /usr/local/bin/VBoxManage modifyvm default --firmware bios --bioslogofadein off --bioslogofadeout off --bioslogodisplaytime 0 --biosbootmenu disabled --ostype Linux26_64 --cpus 1 --memory 1024 --acpi on --ioapic on --rtcuseutc on --natdnshostresolver1 off --natdnsproxy1 off --cpuhotplug off --pae on --hpet on --hwvirtex on --nestedpaging on --largepages on --vtxvpid on --accelerate3d off --boot1 dvd failed:
VBoxManage: error: The machine 'default' is already locked for a session (or being unlocked)
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 493 of file VBoxManageModifyVM.cpp

The default folder is created though it still has the same SSH error. I've tried uninstalling and reinstalling the docker toolbox multiple times and nothing is changing, any suggestions???

fergvick commented Dec 8, 2015

I have the same error though when trying

docker-machine rm default

it just got stuck and never gave any output, so I went ahead and removed the default folder manually. Though when trying to run

docker-machine create -d virtualbox default

It got stuck on creating shh again, this was the output;

Running pre-create checks...
Creating machine...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
Error creating machine: Error in driver during machine creation: /usr/local/bin/VBoxManage modifyvm default --firmware bios --bioslogofadein off --bioslogofadeout off --bioslogodisplaytime 0 --biosbootmenu disabled --ostype Linux26_64 --cpus 1 --memory 1024 --acpi on --ioapic on --rtcuseutc on --natdnshostresolver1 off --natdnsproxy1 off --cpuhotplug off --pae on --hpet on --hwvirtex on --nestedpaging on --largepages on --vtxvpid on --accelerate3d off --boot1 dvd failed:
VBoxManage: error: The machine 'default' is already locked for a session (or being unlocked)
VBoxManage: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MachineWrap, interface IMachine, callee nsISupports
VBoxManage: error: Context: "LockMachine(a->session, LockType_Write)" at line 493 of file VBoxManageModifyVM.cpp

The default folder is created though it still has the same SSH error. I've tried uninstalling and reinstalling the docker toolbox multiple times and nothing is changing, any suggestions???

@tomphp

This comment has been minimized.

Show comment
Hide comment
@tomphp

tomphp Dec 9, 2015

Also getting the same issue here (El Capitan)

tomphp commented Dec 9, 2015

Also getting the same issue here (El Capitan)

@nasserahmed

This comment has been minimized.

Show comment
Hide comment
@nasserahmed

nasserahmed Dec 9, 2015

OSX: v10.11.2 (El Capitan)
Virtualbox: 5.0.10r104061
Docker version 1.9.1, build a34a1d5

The following worked for me:
docker/machine#1801 (comment)

nasserahmed commented Dec 9, 2015

OSX: v10.11.2 (El Capitan)
Virtualbox: 5.0.10r104061
Docker version 1.9.1, build a34a1d5

The following worked for me:
docker/machine#1801 (comment)

@udoless

This comment has been minimized.

Show comment
Hide comment
@udoless

udoless Dec 10, 2015

Also getting the same issue here

udoless commented Dec 10, 2015

Also getting the same issue here

@tomphp

This comment has been minimized.

Show comment
Hide comment
@tomphp

tomphp Dec 11, 2015

+1 for @nasserahmed's link - deleting all the Host-only networks from virtual box fixed it.

tomphp commented Dec 11, 2015

+1 for @nasserahmed's link - deleting all the Host-only networks from virtual box fixed it.

@skyer9

This comment has been minimized.

Show comment
Hide comment
@skyer9

skyer9 Dec 14, 2015

+1 deleting all image from virtual box fixed it.

skyer9 commented Dec 14, 2015

+1 deleting all image from virtual box fixed it.

@stevelr

This comment has been minimized.

Show comment
Hide comment
@stevelr

stevelr Dec 15, 2015

I have a work-around that I've been using for a few weeks - all the regular "docker" commands work from my terminal, and I never use docker-machine anymore. To ssh into the vm, I use the docker-ssh alias defined below.

[updated, added DOCKER_HOST to file below]

Put the following lines into a script in ~/bin/docker-setup. In my ~/.bashrc I source it with the command ". $HOME/bin/docker-setup" . You need to get the host ip address [ with the NAT networking, this may be 192.168.99.100. If you use Bridged networking on network interface 0, this is an IP address on your LAN on eth0 interface]. In the vm console window type "ifconfig | less" to see the network interfaces. (press Show on the Virtualbox UI if the console window is not visible). This is the only thing I ever need to do in that window. After this setup, you can just type "docker-ssh" to ssh into the boot2docker vm from your regular Terminal or iTerm window.

#
# source this
#

# Set this IP addr to the location of the docker host
# (For bridged networking, this is the LAN address on eth0)
export DOCKER_IP=10.100.1.114
export DOCKER_HOST=tcp://${DOCKER_IP}:2376
export DOCKER_DEF="$HOME/.docker/machine/machines/default"
export DOCKER_ARGS="--tls=true --tlscacert=$DOCKER_DEF/ca.pem --tlscert=$DOCKER_DEF/cert.pem --tlskey=$DOCKER_DEF/key.pem"
alias docker-ssh="ssh -i ~/.docker/machine/machines/default/id_rsa docker@$DOCKER_IP"
alias docker-scp="scp -i ~/.docker/machine/machines/default/id_rsa docker@$DOCKER_IP"
alias docker="docker $DOCKER_ARGS"

With this setup, you can use any docker command "docker ps", "docker build" ,etc. If you use shell scripts (build.sh, or Makefile, etc.) to construct docker images, don't forget to include ${DOCKER_ARGS} on the command line in the script file. For example,

    #!/bin/sh
    docker ${DOCKER_ARGS} build -t myimage .

Bonus tip:
If you want to set up port forwarding between the VM and your desktop, you can use standard ssh port forwarding. To do this you need to know the docker machine's host ip address, which you can get with
"ifconfig docker0". I run an http server on my mac on port 7770 that I want to make available to all docker containers, so I use the -R reverse port forwarding flag as follows (add these lines to ~/bin/docker-setup).

export DOCKER_BRIDGE_HOST_IP=172.17.0.1
alias docker-ports="ssh -f -N -g -R $DOCKER_BRIDGE_HOST_IP:7770:localhost:7770 -i ~/.docker/machine/machines/default/id_rsa docker@$DOCKER_IP"

To start port forwarding, type "docker-ports" in a terminal window. After executing this command, docker containers can access the server at http://$DOCKER_BRIDGE_HOST_IP:7770.When setting up remote port forwarding that binds to a specific IP address, you have to enable GatewayPorts in sshd_config. In /etc/ssh/ssh_config (or /usr/local/etc/ssh/sshd_config), add the line

    GatewayPorts yes

stevelr commented Dec 15, 2015

I have a work-around that I've been using for a few weeks - all the regular "docker" commands work from my terminal, and I never use docker-machine anymore. To ssh into the vm, I use the docker-ssh alias defined below.

[updated, added DOCKER_HOST to file below]

Put the following lines into a script in ~/bin/docker-setup. In my ~/.bashrc I source it with the command ". $HOME/bin/docker-setup" . You need to get the host ip address [ with the NAT networking, this may be 192.168.99.100. If you use Bridged networking on network interface 0, this is an IP address on your LAN on eth0 interface]. In the vm console window type "ifconfig | less" to see the network interfaces. (press Show on the Virtualbox UI if the console window is not visible). This is the only thing I ever need to do in that window. After this setup, you can just type "docker-ssh" to ssh into the boot2docker vm from your regular Terminal or iTerm window.

#
# source this
#

# Set this IP addr to the location of the docker host
# (For bridged networking, this is the LAN address on eth0)
export DOCKER_IP=10.100.1.114
export DOCKER_HOST=tcp://${DOCKER_IP}:2376
export DOCKER_DEF="$HOME/.docker/machine/machines/default"
export DOCKER_ARGS="--tls=true --tlscacert=$DOCKER_DEF/ca.pem --tlscert=$DOCKER_DEF/cert.pem --tlskey=$DOCKER_DEF/key.pem"
alias docker-ssh="ssh -i ~/.docker/machine/machines/default/id_rsa docker@$DOCKER_IP"
alias docker-scp="scp -i ~/.docker/machine/machines/default/id_rsa docker@$DOCKER_IP"
alias docker="docker $DOCKER_ARGS"

With this setup, you can use any docker command "docker ps", "docker build" ,etc. If you use shell scripts (build.sh, or Makefile, etc.) to construct docker images, don't forget to include ${DOCKER_ARGS} on the command line in the script file. For example,

    #!/bin/sh
    docker ${DOCKER_ARGS} build -t myimage .

Bonus tip:
If you want to set up port forwarding between the VM and your desktop, you can use standard ssh port forwarding. To do this you need to know the docker machine's host ip address, which you can get with
"ifconfig docker0". I run an http server on my mac on port 7770 that I want to make available to all docker containers, so I use the -R reverse port forwarding flag as follows (add these lines to ~/bin/docker-setup).

export DOCKER_BRIDGE_HOST_IP=172.17.0.1
alias docker-ports="ssh -f -N -g -R $DOCKER_BRIDGE_HOST_IP:7770:localhost:7770 -i ~/.docker/machine/machines/default/id_rsa docker@$DOCKER_IP"

To start port forwarding, type "docker-ports" in a terminal window. After executing this command, docker containers can access the server at http://$DOCKER_BRIDGE_HOST_IP:7770.When setting up remote port forwarding that binds to a specific IP address, you have to enable GatewayPorts in sshd_config. In /etc/ssh/ssh_config (or /usr/local/etc/ssh/sshd_config), add the line

    GatewayPorts yes
@iongion

This comment has been minimized.

Show comment
Hide comment
@iongion

iongion Dec 16, 2015

On windows 10 - using windows command prompt shell
Virtualbox: 5.0.10-r104061

docker-machine -v
docker-machine version 0.5.3, build 4d39a66
docker-machine rm default
Do you really want to remove "default"? (y/n): y
(default) Stopping VM...
Successfully removed default

Re-creating the machine

docker-machine create --driver virtualbox default
Running pre-create checks...
Creating machine...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting VM...
Error creating machine: Error in driver during machine creation: Maximum number of retries (5) exceeded

Although I see the machine running in Virtualbox Preview UI rectangle in the upper-right corner of the window.

Then the logs:

(default) DBG | Using SSH client type: external
(default) DBG | About to run SSH command:
(default) DBG | ip addr show dev eth1
(default) DBG | SSH cmd err, output: <nil>: 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
(default) DBG |     link/ether 08:00:27:1b:17:3b brd ff:ff:ff:ff:ff:ff
(default) DBG |     inet6 fe80::a00:27ff:fe1b:173b/64 scope link
(default) DBG |        valid_lft forever preferred_lft forever
(default) DBG |
(default) DBG | SSH returned: 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
(default) DBG |     link/ether 08:00:27:1b:17:3b brd ff:ff:ff:ff:ff:ff
(default) DBG |     inet6 fe80::a00:27ff:fe1b:173b/64 scope link
(default) DBG |        valid_lft forever preferred_lft forever
(default) DBG |
(default) DBG | END SSH
(default) DBG |
(default) DBG | ERROR getting IP: No IP address found 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
(default) DBG |     link/ether 08:00:27:1b:17:3b brd ff:ff:ff:ff:ff:ff
(default) DBG |     inet6 fe80::a00:27ff:fe1b:173b/64 scope link
(default) DBG |        valid_lft forever preferred_lft forever

What should I investigate more ?

iongion commented Dec 16, 2015

On windows 10 - using windows command prompt shell
Virtualbox: 5.0.10-r104061

docker-machine -v
docker-machine version 0.5.3, build 4d39a66
docker-machine rm default
Do you really want to remove "default"? (y/n): y
(default) Stopping VM...
Successfully removed default

Re-creating the machine

docker-machine create --driver virtualbox default
Running pre-create checks...
Creating machine...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting VM...
Error creating machine: Error in driver during machine creation: Maximum number of retries (5) exceeded

Although I see the machine running in Virtualbox Preview UI rectangle in the upper-right corner of the window.

Then the logs:

(default) DBG | Using SSH client type: external
(default) DBG | About to run SSH command:
(default) DBG | ip addr show dev eth1
(default) DBG | SSH cmd err, output: <nil>: 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
(default) DBG |     link/ether 08:00:27:1b:17:3b brd ff:ff:ff:ff:ff:ff
(default) DBG |     inet6 fe80::a00:27ff:fe1b:173b/64 scope link
(default) DBG |        valid_lft forever preferred_lft forever
(default) DBG |
(default) DBG | SSH returned: 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
(default) DBG |     link/ether 08:00:27:1b:17:3b brd ff:ff:ff:ff:ff:ff
(default) DBG |     inet6 fe80::a00:27ff:fe1b:173b/64 scope link
(default) DBG |        valid_lft forever preferred_lft forever
(default) DBG |
(default) DBG | END SSH
(default) DBG |
(default) DBG | ERROR getting IP: No IP address found 4: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
(default) DBG |     link/ether 08:00:27:1b:17:3b brd ff:ff:ff:ff:ff:ff
(default) DBG |     inet6 fe80::a00:27ff:fe1b:173b/64 scope link
(default) DBG |        valid_lft forever preferred_lft forever

What should I investigate more ?

@danpospisil

This comment has been minimized.

Show comment
Hide comment
@danpospisil

danpospisil Dec 16, 2015

I have exactly the same issue with the same behavior as iongion has

danpospisil commented Dec 16, 2015

I have exactly the same issue with the same behavior as iongion has

@iongion

This comment has been minimized.

Show comment
Hide comment
@iongion

iongion Dec 16, 2015

A bit more info here:
http://superuser.com/questions/1002160/failed-to-start-virtual-device-in-oracle-virtual-box/1002243#1002243

I've tried it with:

docker-machine --debug create --driver virtualbox --virtualbox-hostonly-cidr "192.168.100.100/24" --virtualbox-memory 1024 default

And the last debug log entries:

...
...
(default) DBG | using 192.168.100.12 for dhcp address
(default) DBG | COMMAND: C:\Applications\VirtualBox\VBoxManage.exe list hostonlyifs
(default) DBG | STDOUT:
(default) DBG | {
(default) DBG | Name:            VirtualBox Host-Only Ethernet Adapter #2
(default) DBG | GUID:            ad93f87f-9523-45e3-8537-ee83d7c685df
(default) DBG | DHCP:            Disabled
(default) DBG | IPAddress:       192.168.56.1
(default) DBG | NetworkMask:     255.255.255.0
(default) DBG | IPV6Address:     fe80:0000:0000:0000:b162:757f:086a:3ae6
(default) DBG | IPV6NetworkMaskPrefixLength: 64
(default) DBG | HardwareAddress: 0a:00:27:00:00:00
(default) DBG | MediumType:      Ethernet
(default) DBG | Status:          Up
(default) DBG | VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #2
(default) DBG |
(default) DBG | Name:            VirtualBox Host-Only Ethernet Adapter #3
(default) DBG | GUID:            15b8f07a-cdf9-4677-8b95-f33d046fcd08
(default) DBG | DHCP:            Disabled
(default) DBG | IPAddress:       192.168.100.100
(default) DBG | NetworkMask:     15.0.0.0
(default) DBG | IPV6Address:     fe80:0000:0000:0000:5597:16f4:4294:95f4
(default) DBG | IPV6NetworkMaskPrefixLength: 64
(default) DBG | HardwareAddress: 0a:00:27:00:00:00
(default) DBG | MediumType:      Ethernet
(default) DBG | Status:          Up
(default) DBG | VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #3
(default) DBG |
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | }
(default) DBG | COMMAND: C:\Applications\VirtualBox\VBoxManage.exe modifyvm default --nic2 hostonly --nictype2 82540EM --nicpromisc2 deny --hostonlyadapter2 VirtualBox Host-Only Ethernet Adapter #3 --cableconnected2 on
(default) DBG | STDOUT:
(default) DBG | {
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | }
(default) DBG | COMMAND: C:\Applications\VirtualBox\VBoxManage.exe modifyvm default --natpf1 delete ssh
(default) DBG | STDOUT:
(default) DBG | {
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | VBoxManage.exe: error: Code E_INVALIDARG (0x80070057) - One or more arguments are invalid (extended info not available)
(default) DBG | VBoxManage.exe: error: Context: "RemoveRedirect(Bstr(ValueUnion.psz).raw())" at line 1767 of file VBoxManageModifyVM.cpp
(default) DBG | }
(default) DBG | COMMAND: C:\Applications\VirtualBox\VBoxManage.exe modifyvm default --natpf1 ssh,tcp,127.0.0.1,51126,,22
(default) DBG | STDOUT:
(default) DBG | {
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | }
(default) DBG | COMMAND: C:\Applications\VirtualBox\VBoxManage.exe startvm default --type headless
(default) DBG | STDOUT:
(default) DBG | {
Opting out of crash reporting.
Error creating machine: Error in driver during machine creation: exit status 1

So from it, a few errors:

(default) DBG | VBoxManage.exe: error: Code E_INVALIDARG (0x80070057) - One or more arguments are invalid (extended info not available)
(default) DBG | VBoxManage.exe: error: Context: "RemoveRedirect(Bstr(ValueUnion.psz).raw())" at line 1767 of file VBoxManageModifyVM.cpp

Did not find any crash report.
Even with this error, I have forced:

docker-machine restart default
exit status 1

And it does restart the machine, although command finishes with an error again.
I then manually went to Virtualbox to start it by hand:

Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #3' (VERR_INTNET_FLT_IF_NOT_FOUND).
Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND).

This is solved by changing your adapter properties and enabling "VirtualBox NDIS6 Bridged Networking Driver" (if not enabled) in your virtualbox network adapters.

Now, I am able to restart (no more exit status 1)

 docker-machine restart default
(default) Starting VM...
Restarted machines may have new IP addresses. You may need to re-run the `docker-machine env` command.

Now docker-compose build is still not able to work as no connection can be established :(.
The docker-build still has no environment in windows batch files so it cannot know where to connect.
For this, I run docker-machine env and what do you know, another error:

Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.100.100:2376": open C:\Users\worker\.docker\machine\machines\default\server.pem: The system cannot find the file specified.
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which will stop running containers.

Ok, I try what it says:

$ docker-machine regenerate-certs default
Regenerate TLS machine certs?  Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Detecting the provisioner...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...

This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.

SSH for the machine should still work, but connecting to exposed ports, such as
the Docker daemon port (usually <ip>:2376), may not work properly.

You may need to add the route manually, or use another related workaround.

This could be due to a VPN, proxy, or host file configuration issue.

You also might want to clear any VirtualBox host only interfaces you are not using.

Ok, so now it is a port issue, let's check the IP address of the default machine, I go to virtualbox and click show, then ifconfig, shows two interfaces, which is expected:

One is 10.0.2.15 (this is NAT network)
The other is 192.168.100.100 - this is part of the host only network that we defined when creating the network.

Let's now see if the host machine running virtualbox (a windows box) can see the last address:

ping 192.168.100.100
Pinging 192.168.100.100 with 32 bytes of data:
Reply from 192.168.100.100: bytes=32 time<1ms TTL=128
Reply from 192.168.100.100: bytes=32 time<1ms TTL=128

It does, let's telnet to know if the docker daemon find the port open for 2376:

$ telnet 192.168.100.100 2376
Connecting To 192.168.100.100...Could not open connection to the host, on port 2376: Connect failed

22 does not work either, so it is not opened or not running, let's eliminate one of them, back to virtualbox gui and into the default machine screen, on bash:

netstat -atn
::22
::2376

I see both ports are opened, telnet on the machine itself(in the default vm):

  • telnet localhost 22 responds
  • telnet localhost 2376 does not respond

Telnet from the host machine:

telnet 192.168.100.100 22
Connecting To 192.168.100.100...Could not open connection to the host, on port 22: Connect failed
telnet 192.168.100.100 2376
Connecting To 192.168.100.100...Could not open connection to the host, on port 2376: Connect failed

Ok, then there might be something in between, virtualbox network settings, let's see how port mapping works in this case.
I investigate the network settings, nothing seems bad, I see one port mapping for the NAT network not for the host only, and that mapping maps 22 to a local port(local to the windows machine - host)

Restart for the sake of restarting:

$ docker-machine stop default
$ docker-machine start default
$ docker-machine env default
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.100.100:2376": dial tcp 192.168.100.100:2376: connectex: No connection could be made because the target machine actively refused it.
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which will stop running containers.

Again regenerate ?

I stop here cause I have no clue what to do next, it seems that either the services are not running on this boot2docker default image or that there is a firewall or something in between that does blocks/prevents access to those ports.

iongion commented Dec 16, 2015

A bit more info here:
http://superuser.com/questions/1002160/failed-to-start-virtual-device-in-oracle-virtual-box/1002243#1002243

I've tried it with:

docker-machine --debug create --driver virtualbox --virtualbox-hostonly-cidr "192.168.100.100/24" --virtualbox-memory 1024 default

And the last debug log entries:

...
...
(default) DBG | using 192.168.100.12 for dhcp address
(default) DBG | COMMAND: C:\Applications\VirtualBox\VBoxManage.exe list hostonlyifs
(default) DBG | STDOUT:
(default) DBG | {
(default) DBG | Name:            VirtualBox Host-Only Ethernet Adapter #2
(default) DBG | GUID:            ad93f87f-9523-45e3-8537-ee83d7c685df
(default) DBG | DHCP:            Disabled
(default) DBG | IPAddress:       192.168.56.1
(default) DBG | NetworkMask:     255.255.255.0
(default) DBG | IPV6Address:     fe80:0000:0000:0000:b162:757f:086a:3ae6
(default) DBG | IPV6NetworkMaskPrefixLength: 64
(default) DBG | HardwareAddress: 0a:00:27:00:00:00
(default) DBG | MediumType:      Ethernet
(default) DBG | Status:          Up
(default) DBG | VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #2
(default) DBG |
(default) DBG | Name:            VirtualBox Host-Only Ethernet Adapter #3
(default) DBG | GUID:            15b8f07a-cdf9-4677-8b95-f33d046fcd08
(default) DBG | DHCP:            Disabled
(default) DBG | IPAddress:       192.168.100.100
(default) DBG | NetworkMask:     15.0.0.0
(default) DBG | IPV6Address:     fe80:0000:0000:0000:5597:16f4:4294:95f4
(default) DBG | IPV6NetworkMaskPrefixLength: 64
(default) DBG | HardwareAddress: 0a:00:27:00:00:00
(default) DBG | MediumType:      Ethernet
(default) DBG | Status:          Up
(default) DBG | VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #3
(default) DBG |
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | }
(default) DBG | COMMAND: C:\Applications\VirtualBox\VBoxManage.exe modifyvm default --nic2 hostonly --nictype2 82540EM --nicpromisc2 deny --hostonlyadapter2 VirtualBox Host-Only Ethernet Adapter #3 --cableconnected2 on
(default) DBG | STDOUT:
(default) DBG | {
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | }
(default) DBG | COMMAND: C:\Applications\VirtualBox\VBoxManage.exe modifyvm default --natpf1 delete ssh
(default) DBG | STDOUT:
(default) DBG | {
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | VBoxManage.exe: error: Code E_INVALIDARG (0x80070057) - One or more arguments are invalid (extended info not available)
(default) DBG | VBoxManage.exe: error: Context: "RemoveRedirect(Bstr(ValueUnion.psz).raw())" at line 1767 of file VBoxManageModifyVM.cpp
(default) DBG | }
(default) DBG | COMMAND: C:\Applications\VirtualBox\VBoxManage.exe modifyvm default --natpf1 ssh,tcp,127.0.0.1,51126,,22
(default) DBG | STDOUT:
(default) DBG | {
(default) DBG | }
(default) DBG | STDERR:
(default) DBG | {
(default) DBG | }
(default) DBG | COMMAND: C:\Applications\VirtualBox\VBoxManage.exe startvm default --type headless
(default) DBG | STDOUT:
(default) DBG | {
Opting out of crash reporting.
Error creating machine: Error in driver during machine creation: exit status 1

So from it, a few errors:

(default) DBG | VBoxManage.exe: error: Code E_INVALIDARG (0x80070057) - One or more arguments are invalid (extended info not available)
(default) DBG | VBoxManage.exe: error: Context: "RemoveRedirect(Bstr(ValueUnion.psz).raw())" at line 1767 of file VBoxManageModifyVM.cpp

Did not find any crash report.
Even with this error, I have forced:

docker-machine restart default
exit status 1

And it does restart the machine, although command finishes with an error again.
I then manually went to Virtualbox to start it by hand:

Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #3' (VERR_INTNET_FLT_IF_NOT_FOUND).
Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND).

This is solved by changing your adapter properties and enabling "VirtualBox NDIS6 Bridged Networking Driver" (if not enabled) in your virtualbox network adapters.

Now, I am able to restart (no more exit status 1)

 docker-machine restart default
(default) Starting VM...
Restarted machines may have new IP addresses. You may need to re-run the `docker-machine env` command.

Now docker-compose build is still not able to work as no connection can be established :(.
The docker-build still has no environment in windows batch files so it cannot know where to connect.
For this, I run docker-machine env and what do you know, another error:

Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.100.100:2376": open C:\Users\worker\.docker\machine\machines\default\server.pem: The system cannot find the file specified.
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which will stop running containers.

Ok, I try what it says:

$ docker-machine regenerate-certs default
Regenerate TLS machine certs?  Warning: this is irreversible. (y/n): y
Regenerating TLS certificates
Detecting the provisioner...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...

This machine has been allocated an IP address, but Docker Machine could not
reach it successfully.

SSH for the machine should still work, but connecting to exposed ports, such as
the Docker daemon port (usually <ip>:2376), may not work properly.

You may need to add the route manually, or use another related workaround.

This could be due to a VPN, proxy, or host file configuration issue.

You also might want to clear any VirtualBox host only interfaces you are not using.

Ok, so now it is a port issue, let's check the IP address of the default machine, I go to virtualbox and click show, then ifconfig, shows two interfaces, which is expected:

One is 10.0.2.15 (this is NAT network)
The other is 192.168.100.100 - this is part of the host only network that we defined when creating the network.

Let's now see if the host machine running virtualbox (a windows box) can see the last address:

ping 192.168.100.100
Pinging 192.168.100.100 with 32 bytes of data:
Reply from 192.168.100.100: bytes=32 time<1ms TTL=128
Reply from 192.168.100.100: bytes=32 time<1ms TTL=128

It does, let's telnet to know if the docker daemon find the port open for 2376:

$ telnet 192.168.100.100 2376
Connecting To 192.168.100.100...Could not open connection to the host, on port 2376: Connect failed

22 does not work either, so it is not opened or not running, let's eliminate one of them, back to virtualbox gui and into the default machine screen, on bash:

netstat -atn
::22
::2376

I see both ports are opened, telnet on the machine itself(in the default vm):

  • telnet localhost 22 responds
  • telnet localhost 2376 does not respond

Telnet from the host machine:

telnet 192.168.100.100 22
Connecting To 192.168.100.100...Could not open connection to the host, on port 22: Connect failed
telnet 192.168.100.100 2376
Connecting To 192.168.100.100...Could not open connection to the host, on port 2376: Connect failed

Ok, then there might be something in between, virtualbox network settings, let's see how port mapping works in this case.
I investigate the network settings, nothing seems bad, I see one port mapping for the NAT network not for the host only, and that mapping maps 22 to a local port(local to the windows machine - host)

Restart for the sake of restarting:

$ docker-machine stop default
$ docker-machine start default
$ docker-machine env default
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.100.100:2376": dial tcp 192.168.100.100:2376: connectex: No connection could be made because the target machine actively refused it.
You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.
Be advised that this will trigger a Docker daemon restart which will stop running containers.

Again regenerate ?

I stop here cause I have no clue what to do next, it seems that either the services are not running on this boot2docker default image or that there is a firewall or something in between that does blocks/prevents access to those ports.

@iongion

This comment has been minimized.

Show comment
Hide comment
@iongion

iongion Dec 16, 2015

Managed to make it be able to execute docker-machine env default, which in turn throws up this:

export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.100.100:2376"
export DOCKER_CERT_PATH="C:\Users\worker\.docker\machine\machines\default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell:
# eval "$(w:\SDKs\DockerToolbox\docker-machine.exe env default)"

image

Apparently adding that port mapping additional rule made it work.
The one for ssh is reset by docker-machine whenever you restart the default vm.
I do not know why docker-machine transfers all incomming localhost trafic to port 22 to the docker vm. Should'nt it transfer only the traffic to that specific machine only, so, instead of mapping my local ssh port, I map only that of 192.168.100.100, which coresponds to the address of the default vm ?

Now docker-compose is not running.

$ docker-compose --verbose build
compose.config.config.find: Using configuration files: .\docker-compose.yml
docker.auth.auth.load_config: Trying c:/Users/worker\.docker\config.json
docker.auth.auth.load_config: File doesn't exist
docker.auth.auth.load_config: Trying c:/Users/worker\.dockercfg
docker.auth.auth.load_config: File doesn't exist - returning empty config
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "C:\projects\compose\compose\cli\main.py", line 54, in main
  File "C:\projects\compose\compose\cli\docopt_command.py", line 23, in sys_dispatch
  File "C:\projects\compose\compose\cli\docopt_command.py", line 26, in dispatch
  File "C:\projects\compose\compose\cli\main.py", line 169, in perform_command
  File "C:\projects\compose\compose\cli\command.py", line 53, in project_from_options
  File "C:\projects\compose\compose\cli\command.py", line 89, in get_project
  File "C:\projects\compose\compose\cli\command.py", line 72, in get_client
  File "c:\projects\compose\venv\lib\site-packages\docker\api\daemon.py", line 78, in version
  File "c:\projects\compose\venv\lib\site-packages\docker\client.py", line 110, in _get
  File "c:\projects\compose\venv\lib\site-packages\requests\sessions.py", line 477, in get
  File "c:\projects\compose\venv\lib\site-packages\requests\sessions.py", line 465, in request
  File "c:\projects\compose\venv\lib\site-packages\requests\sessions.py", line 573, in send
  File "c:\projects\compose\venv\lib\site-packages\requests\adapters.py", line 415, in send
requests.exceptions.ConnectionError: ('Connection aborted.', error(10061, 'No connection could be made because the target machine actively refused it'))
docker-compose returned -1

This because on windows, and on windows I cannot:
eval "$(w:\SDKs\DockerToolbox\docker-machine.exe env default)"

Yes, I could take the env vars and export them myself in a windows compatible way, but I am too lazy. As there is no eval, I trick this by firing a POSIX shell using msys and loading the env.

$ docker-compose --verbose build
compose.config.config.find: Using configuration files: .\docker-compose.yml
docker.auth.auth.load_config: Trying c:/Users/worker\.docker\config.json
docker.auth.auth.load_config: File doesn't exist
docker.auth.auth.load_config: Trying c:/Users/worker\.dockercfg
docker.auth.auth.load_config: File doesn't exist - returning empty config
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "C:\projects\compose\compose\cli\main.py", line 54, in main
  File "C:\projects\compose\compose\cli\docopt_command.py", line 23, in sys_dispatch
  File "C:\projects\compose\compose\cli\docopt_command.py", line 26, in dispatch
  File "C:\projects\compose\compose\cli\main.py", line 169, in perform_command
  File "C:\projects\compose\compose\cli\command.py", line 53, in project_from_options
  File "C:\projects\compose\compose\cli\command.py", line 89, in get_project
  File "C:\projects\compose\compose\cli\command.py", line 72, in get_client
  File "c:\projects\compose\venv\lib\site-packages\docker\api\daemon.py", line 78, in version
  File "c:\projects\compose\venv\lib\site-packages\docker\client.py", line 110, in _get
  File "c:\projects\compose\venv\lib\site-packages\requests\sessions.py", line 477, in get
  File "c:\projects\compose\venv\lib\site-packages\requests\sessions.py", line 465, in request
  File "c:\projects\compose\venv\lib\site-packages\requests\sessions.py", line 573, in send
  File "c:\projects\compose\venv\lib\site-packages\requests\adapters.py", line 431, in send
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
docker-compose returned -1

And back to square 0 - the infamous SSL error

Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.2d 9 Jul 2015'

But this is SSL of python and from what I remember docker-compose is not python anymore.

iongion commented Dec 16, 2015

Managed to make it be able to execute docker-machine env default, which in turn throws up this:

export DOCKER_TLS_VERIFY="1"
export DOCKER_HOST="tcp://192.168.100.100:2376"
export DOCKER_CERT_PATH="C:\Users\worker\.docker\machine\machines\default"
export DOCKER_MACHINE_NAME="default"
# Run this command to configure your shell:
# eval "$(w:\SDKs\DockerToolbox\docker-machine.exe env default)"

image

Apparently adding that port mapping additional rule made it work.
The one for ssh is reset by docker-machine whenever you restart the default vm.
I do not know why docker-machine transfers all incomming localhost trafic to port 22 to the docker vm. Should'nt it transfer only the traffic to that specific machine only, so, instead of mapping my local ssh port, I map only that of 192.168.100.100, which coresponds to the address of the default vm ?

Now docker-compose is not running.

$ docker-compose --verbose build
compose.config.config.find: Using configuration files: .\docker-compose.yml
docker.auth.auth.load_config: Trying c:/Users/worker\.docker\config.json
docker.auth.auth.load_config: File doesn't exist
docker.auth.auth.load_config: Trying c:/Users/worker\.dockercfg
docker.auth.auth.load_config: File doesn't exist - returning empty config
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "C:\projects\compose\compose\cli\main.py", line 54, in main
  File "C:\projects\compose\compose\cli\docopt_command.py", line 23, in sys_dispatch
  File "C:\projects\compose\compose\cli\docopt_command.py", line 26, in dispatch
  File "C:\projects\compose\compose\cli\main.py", line 169, in perform_command
  File "C:\projects\compose\compose\cli\command.py", line 53, in project_from_options
  File "C:\projects\compose\compose\cli\command.py", line 89, in get_project
  File "C:\projects\compose\compose\cli\command.py", line 72, in get_client
  File "c:\projects\compose\venv\lib\site-packages\docker\api\daemon.py", line 78, in version
  File "c:\projects\compose\venv\lib\site-packages\docker\client.py", line 110, in _get
  File "c:\projects\compose\venv\lib\site-packages\requests\sessions.py", line 477, in get
  File "c:\projects\compose\venv\lib\site-packages\requests\sessions.py", line 465, in request
  File "c:\projects\compose\venv\lib\site-packages\requests\sessions.py", line 573, in send
  File "c:\projects\compose\venv\lib\site-packages\requests\adapters.py", line 415, in send
requests.exceptions.ConnectionError: ('Connection aborted.', error(10061, 'No connection could be made because the target machine actively refused it'))
docker-compose returned -1

This because on windows, and on windows I cannot:
eval "$(w:\SDKs\DockerToolbox\docker-machine.exe env default)"

Yes, I could take the env vars and export them myself in a windows compatible way, but I am too lazy. As there is no eval, I trick this by firing a POSIX shell using msys and loading the env.

$ docker-compose --verbose build
compose.config.config.find: Using configuration files: .\docker-compose.yml
docker.auth.auth.load_config: Trying c:/Users/worker\.docker\config.json
docker.auth.auth.load_config: File doesn't exist
docker.auth.auth.load_config: Trying c:/Users/worker\.dockercfg
docker.auth.auth.load_config: File doesn't exist - returning empty config
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "C:\projects\compose\compose\cli\main.py", line 54, in main
  File "C:\projects\compose\compose\cli\docopt_command.py", line 23, in sys_dispatch
  File "C:\projects\compose\compose\cli\docopt_command.py", line 26, in dispatch
  File "C:\projects\compose\compose\cli\main.py", line 169, in perform_command
  File "C:\projects\compose\compose\cli\command.py", line 53, in project_from_options
  File "C:\projects\compose\compose\cli\command.py", line 89, in get_project
  File "C:\projects\compose\compose\cli\command.py", line 72, in get_client
  File "c:\projects\compose\venv\lib\site-packages\docker\api\daemon.py", line 78, in version
  File "c:\projects\compose\venv\lib\site-packages\docker\client.py", line 110, in _get
  File "c:\projects\compose\venv\lib\site-packages\requests\sessions.py", line 477, in get
  File "c:\projects\compose\venv\lib\site-packages\requests\sessions.py", line 465, in request
  File "c:\projects\compose\venv\lib\site-packages\requests\sessions.py", line 573, in send
  File "c:\projects\compose\venv\lib\site-packages\requests\adapters.py", line 431, in send
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
docker-compose returned -1

And back to square 0 - the infamous SSL error

Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 20:40:30) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 1.0.2d 9 Jul 2015'

But this is SSL of python and from what I remember docker-compose is not python anymore.

@danpospisil

This comment has been minimized.

Show comment
Hide comment
@danpospisil

danpospisil Dec 18, 2015

Today I got some update from Microsoft installed and Docker started working ... so try to install latest updates for Windows 10 - might work for you as well :)

(PS: I had to recreate the default VM)

danpospisil commented Dec 18, 2015

Today I got some update from Microsoft installed and Docker started working ... so try to install latest updates for Windows 10 - might work for you as well :)

(PS: I had to recreate the default VM)

@itayB

This comment has been minimized.

Show comment
Hide comment
@itayB

itayB Dec 21, 2015

Same issue append to me.
Windows7, VirtualBix 5.0.10

I changed the name of the default VM to default1 (in Oracle VM VirtualBox Manager GUI), and start Docker Quickstart Terminal again (with Run as administrator), Worked!

itayB commented Dec 21, 2015

Same issue append to me.
Windows7, VirtualBix 5.0.10

I changed the name of the default VM to default1 (in Oracle VM VirtualBox Manager GUI), and start Docker Quickstart Terminal again (with Run as administrator), Worked!

@baoming

This comment has been minimized.

Show comment
Hide comment
@baoming

baoming Dec 24, 2015

update 1.9.1f.exe ALL runs well.

baoming commented Dec 24, 2015

update 1.9.1f.exe ALL runs well.

@itayB

This comment has been minimized.

Show comment
Hide comment
@itayB

itayB Dec 27, 2015

Update: running 'Docker Quickstart Terminal' with 'Run as administrator' solved the problem for me (Windows7)

itayB commented Dec 27, 2015

Update: running 'Docker Quickstart Terminal' with 'Run as administrator' solved the problem for me (Windows7)

@amasson88

This comment has been minimized.

Show comment
Hide comment
@amasson88

amasson88 Dec 27, 2015

I cannot start "Docker Quickstart Terminal" or Kitematic (toolbox 1.9.1f), I have this error on Windows 8.1:
00:00:45.613089 VMMDev: Guest Log: 00:00:10.011751 vminfo Error: Unable to connect to system D-Bus (3/3): D-Bus not installed
(is it related to #214 ?)

Update: I deleted "host-only" network interfaces in global VirtualBox config (see docker/machine#1801 (comment)) and that fixed the problem.

amasson88 commented Dec 27, 2015

I cannot start "Docker Quickstart Terminal" or Kitematic (toolbox 1.9.1f), I have this error on Windows 8.1:
00:00:45.613089 VMMDev: Guest Log: 00:00:10.011751 vminfo Error: Unable to connect to system D-Bus (3/3): D-Bus not installed
(is it related to #214 ?)

Update: I deleted "host-only" network interfaces in global VirtualBox config (see docker/machine#1801 (comment)) and that fixed the problem.

@zhentaoo

This comment has been minimized.

Show comment
Hide comment
@zhentaoo

zhentaoo Jan 8, 2016

@bojanstef
thank you!
$ docker-machine rm default
$ docker-machine create --driver virtualbox default

zhentaoo commented Jan 8, 2016

@bojanstef
thank you!
$ docker-machine rm default
$ docker-machine create --driver virtualbox default

@sahas-

This comment has been minimized.

Show comment
Hide comment
@sahas-

sahas- Jan 11, 2016

Its OS X EI Capitan.
Remove and recreate default didn't work.
Getting "Error creating machine: Error in driver during machine creation: Maximum number of retries (5) exceeded"
screen shot 2016-01-10 at 8 53 50 pm

Sticking with boot2docker for now, its working well on the same box..

sahas- commented Jan 11, 2016

Its OS X EI Capitan.
Remove and recreate default didn't work.
Getting "Error creating machine: Error in driver during machine creation: Maximum number of retries (5) exceeded"
screen shot 2016-01-10 at 8 53 50 pm

Sticking with boot2docker for now, its working well on the same box..

@eh1160

This comment has been minimized.

Show comment
Hide comment
@eh1160

eh1160 Jan 12, 2016

I tried almost all the solutions and none of them worked. But it works now and I'm pretty sure chmod on the ssh config ultimately fixed it.

chmod 600 /Users/<me>/.ssh/config

OS X El Capitan v10.11.2
Docker version 1.9.1h

eh1160 commented Jan 12, 2016

I tried almost all the solutions and none of them worked. But it works now and I'm pretty sure chmod on the ssh config ultimately fixed it.

chmod 600 /Users/<me>/.ssh/config

OS X El Capitan v10.11.2
Docker version 1.9.1h

@timqian

This comment has been minimized.

Show comment
Hide comment
@timqian

timqian Jan 12, 2016

OS X Yosemite v10.10.5
Docker version 1.9.1, build a34a1d5

docker-machine rm default works for me

don't konw why...

timqian commented Jan 12, 2016

OS X Yosemite v10.10.5
Docker version 1.9.1, build a34a1d5

docker-machine rm default works for me

don't konw why...

@jp-gorman

This comment has been minimized.

Show comment
Hide comment
@jp-gorman

jp-gorman Jan 12, 2016

I had the issue and the solution to remove the default is not of much use if you have spent a lot of time downloading images to it. I did note that I was getting the issue and I had a machine crash and upon reboot, I did not start the VM, but let Docker Quickstart Terminal start it, and it came up fine. I thought it might have deleted the default host, but no it was there with the images.

I believe for those wanting to know why the docker-machine rm default works, it's because it's building a new box and setting up new ssh etc to it, so like wiping completely and starting fresh. No idea why it gets the ssh tangled though after some time.

I need to get my NAS back online to let TimeMachine backup the .docker folder ASAP before it wipes the host again! The coupling of disk images between docker and VirtualBox (in my case) could be a lot cleaner to prevent restore issues between disk UIDs if your host does get blown away (I spent an afternoon matching these in xml files).

jp-gorman commented Jan 12, 2016

I had the issue and the solution to remove the default is not of much use if you have spent a lot of time downloading images to it. I did note that I was getting the issue and I had a machine crash and upon reboot, I did not start the VM, but let Docker Quickstart Terminal start it, and it came up fine. I thought it might have deleted the default host, but no it was there with the images.

I believe for those wanting to know why the docker-machine rm default works, it's because it's building a new box and setting up new ssh etc to it, so like wiping completely and starting fresh. No idea why it gets the ssh tangled though after some time.

I need to get my NAS back online to let TimeMachine backup the .docker folder ASAP before it wipes the host again! The coupling of disk images between docker and VirtualBox (in my case) could be a lot cleaner to prevent restore issues between disk UIDs if your host does get blown away (I spent an afternoon matching these in xml files).

@hkaushalya

This comment has been minimized.

Show comment
Hide comment
@hkaushalya

hkaushalya Jan 12, 2016

I had the same issue, but removing the default as @reviling mentioned did work for me. Thanks to @reviling and @bojanstef for the commands.

Docker version 1.9.1, build a34a1d5
Windows 7 Enterprise, service pack 1
VirtualBox version 5.0.12r104815

hkaushalya commented Jan 12, 2016

I had the same issue, but removing the default as @reviling mentioned did work for me. Thanks to @reviling and @bojanstef for the commands.

Docker version 1.9.1, build a34a1d5
Windows 7 Enterprise, service pack 1
VirtualBox version 5.0.12r104815

@adg-eric

This comment has been minimized.

Show comment
Hide comment
@adg-eric

adg-eric Jan 14, 2016

OS X Yosemite v10.10.5
Docker version 1.9.1, build a34a1d5
docker-machine version 0.5.5, build 02c4254

It's unusable. I cannot run a command which takes time.

adg-eric commented Jan 14, 2016

OS X Yosemite v10.10.5
Docker version 1.9.1, build a34a1d5
docker-machine version 0.5.5, build 02c4254

It's unusable. I cannot run a command which takes time.

@bshlgrs

This comment has been minimized.

Show comment
Hide comment
@bshlgrs

bshlgrs Jan 18, 2016

Mac OS X 10.11
Docker version 1.9.1, build a34a1d5
docker-machine version 0.5.6, build 61388e9

Same problem; and it had the same fix. But the fix is kind of annoying: I don't want to have to recreate my default machine from scratch.

bshlgrs commented Jan 18, 2016

Mac OS X 10.11
Docker version 1.9.1, build a34a1d5
docker-machine version 0.5.6, build 61388e9

Same problem; and it had the same fix. But the fix is kind of annoying: I don't want to have to recreate my default machine from scratch.

@Malu44

This comment has been minimized.

Show comment
Hide comment
@Malu44

Malu44 Jan 19, 2016

Same for me:
Mac OS X 10.10.5 Yosemite
Docker version 1.9.1, build a34a1d5

I want to start my docker again. Can't create all the time an new instance.

Malu44 commented Jan 19, 2016

Same for me:
Mac OS X 10.10.5 Yosemite
Docker version 1.9.1, build a34a1d5

I want to start my docker again. Can't create all the time an new instance.

@Malu44

This comment has been minimized.

Show comment
Hide comment
@Malu44

Malu44 Jan 19, 2016

docker-machine start default
Error checking TLS connection: Error getting driver URL: Something went wrong running an SSH command!
command : ip addr show dev eth1
err : exit status 255
output : Warning: Identity file machines/default/id_rsa not accessible: No such file or directory.

But the file is there and readable for my user
-rw------- 1 devel staff 1679 28 Okt 09:10 /Users/devel/.docker/machine/machines/default/id_rsa

Maybe docker-machine sets the wrong path?

Malu44 commented Jan 19, 2016

docker-machine start default
Error checking TLS connection: Error getting driver URL: Something went wrong running an SSH command!
command : ip addr show dev eth1
err : exit status 255
output : Warning: Identity file machines/default/id_rsa not accessible: No such file or directory.

But the file is there and readable for my user
-rw------- 1 devel staff 1679 28 Okt 09:10 /Users/devel/.docker/machine/machines/default/id_rsa

Maybe docker-machine sets the wrong path?

@Malu44

This comment has been minimized.

Show comment
Hide comment
@Malu44

Malu44 Jan 19, 2016

This is an issue connection the docker-client to the docker-daemon. The daemon is running.
I've checked this by ssh to the virtual box.
There are all my images and containers.

                    ##         .
              ## ## ##        ==
           ## ## ## ## ##    ===
       /"""""""""""""""""\___/ ===
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
       \______ o           __/
         \    \         __/
          \____\_______/

...
Boot2Docker version 1.9.1, build master : cef800b - Fri Nov 20 19:33:59 UTC 2015
Docker version 1.9.1, build a34a1d5
docker@default:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

Malu44 commented Jan 19, 2016

This is an issue connection the docker-client to the docker-daemon. The daemon is running.
I've checked this by ssh to the virtual box.
There are all my images and containers.

                    ##         .
              ## ## ##        ==
           ## ## ## ## ##    ===
       /"""""""""""""""""\___/ ===
  ~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ /  ===- ~~~
       \______ o           __/
         \    \         __/
          \____\_______/

...
Boot2Docker version 1.9.1, build master : cef800b - Fri Nov 20 19:33:59 UTC 2015
Docker version 1.9.1, build a34a1d5
docker@default:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

@kevincolyar

This comment has been minimized.

Show comment
Hide comment
@kevincolyar

kevincolyar Jan 19, 2016

Are any of you guys using multiplexed ssh connections in your ~/.ssh/config?

Something similar to this:

ControlMaster auto
ControlPath /tmp/%r@%h:%p
ControlPersist yes

I disabled mine and appears to have solved my issue (for now).

kevincolyar commented Jan 19, 2016

Are any of you guys using multiplexed ssh connections in your ~/.ssh/config?

Something similar to this:

ControlMaster auto
ControlPath /tmp/%r@%h:%p
ControlPersist yes

I disabled mine and appears to have solved my issue (for now).

@sandhujasmine

This comment has been minimized.

Show comment
Hide comment
@sandhujasmine

sandhujasmine Jan 22, 2016

Was running into the same problem and I removed my .ssh/config - then slowly added the lines back as I recreated default docker-machine. I had to remove the following lines in my config file and now everything seems to work fine.

Host *
    UseRoaming No

I believe I added this due to this ssh-vulnerability

sandhujasmine commented Jan 22, 2016

Was running into the same problem and I removed my .ssh/config - then slowly added the lines back as I recreated default docker-machine. I had to remove the following lines in my config file and now everything seems to work fine.

Host *
    UseRoaming No

I believe I added this due to this ssh-vulnerability

@timaschew

This comment has been minimized.

Show comment
Hide comment
@timaschew

timaschew Jan 22, 2016

I had this issue too. It hink the issue has something to do with the ssh keys, because when I started the quickstart terminal the first time, it tooks really long time at this step (default) Creating SSH key....
Then I just started a new docker quickstart terminal, and there I saw the same message, so maybe two pairs of ssh keys were gerenerated and it become broken, because it were executed 2 times in parallel.

The error I get only after a trying to restart the machine.

timaschew commented Jan 22, 2016

I had this issue too. It hink the issue has something to do with the ssh keys, because when I started the quickstart terminal the first time, it tooks really long time at this step (default) Creating SSH key....
Then I just started a new docker quickstart terminal, and there I saw the same message, so maybe two pairs of ssh keys were gerenerated and it become broken, because it were executed 2 times in parallel.

The error I get only after a trying to restart the machine.

@jeremysmitherman

This comment has been minimized.

Show comment
Hide comment
@jeremysmitherman

jeremysmitherman Jan 27, 2016

Same issue here, rming the default box and recreating it works, but this is an unacceptable workflow and I'll have to use an alternative in the meantime.

jeremysmitherman commented Jan 27, 2016

Same issue here, rming the default box and recreating it works, but this is an unacceptable workflow and I'll have to use an alternative in the meantime.

@leestack

This comment has been minimized.

Show comment
Hide comment
@leestack

leestack Feb 11, 2016

Thank you bojanstef, this worked. Lee

bojanstef commented on Nov 29, 2015
@reviling would there be a way to automate this?

$ docker-machine rm default
$ docker-machine create --driver virtualbox default

leestack commented Feb 11, 2016

Thank you bojanstef, this worked. Lee

bojanstef commented on Nov 29, 2015
@reviling would there be a way to automate this?

$ docker-machine rm default
$ docker-machine create --driver virtualbox default

@leestack

This comment has been minimized.

Show comment
Hide comment
@leestack

leestack Feb 11, 2016

By the way, virtualbox seems to be the common thread here. Lee

leestack commented Feb 11, 2016

By the way, virtualbox seems to be the common thread here. Lee

@burzum

This comment has been minimized.

Show comment
Hide comment
@burzum

burzum Feb 15, 2016

I have the same issue, deleting and creating the machine as suggested two posts before mine doesn't work either for me.

λ docker-machine create --driver virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying C:\Users\Florian\.docker\machine\cache\boot2docker.iso to C:\Users\Florian\.docker\machine\machines\default\boot2docker.iso... (default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Error creating machine: Error in driver during machine creation: Too many retries waiting for SSH to be available.  Last error: Maximum number of retries (60) exceeded

burzum commented Feb 15, 2016

I have the same issue, deleting and creating the machine as suggested two posts before mine doesn't work either for me.

λ docker-machine create --driver virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying C:\Users\Florian\.docker\machine\cache\boot2docker.iso to C:\Users\Florian\.docker\machine\machines\default\boot2docker.iso... (default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Waiting for an IP...
Error creating machine: Error in driver during machine creation: Too many retries waiting for SSH to be available.  Last error: Maximum number of retries (60) exceeded
@drewlamur

This comment has been minimized.

Show comment
Hide comment
@drewlamur

drewlamur Feb 22, 2016

+1 @illagrenan

Thank you - I was able resolve this issue yesterday using the link in your post. I am using OSX, not windows but I saw similar error output running and debugging docker-machine tool commands. Note: I was hung up at '(default) Starting VM...'

Here were the errors that I saw:

  • Error getting IP address: Something went wrong running an SSH command!
  • Error checking TLS connection: Error getting driver URL: Something went wrong running an SSH command!

Here were the steps that resolved the issue for me:

1 - Upgraded version of VirtualBox to Version 5.0.14 r105127 ( i do want to mention that this change likely did nothing for me, so you can skip this step ).
2 - In the terminal, run - sudo chmod -R 600 ~/.ssh/

When I completed step 2, I no longer saw the errors running docker-machine tool commands. If you are hung up at '(default) Starting VM...' and seeing similar error output debugging, I would recommend researching the owner permissions before deleting and re-creating your default machine. You will blow away your local images when you delete.

drewlamur commented Feb 22, 2016

+1 @illagrenan

Thank you - I was able resolve this issue yesterday using the link in your post. I am using OSX, not windows but I saw similar error output running and debugging docker-machine tool commands. Note: I was hung up at '(default) Starting VM...'

Here were the errors that I saw:

  • Error getting IP address: Something went wrong running an SSH command!
  • Error checking TLS connection: Error getting driver URL: Something went wrong running an SSH command!

Here were the steps that resolved the issue for me:

1 - Upgraded version of VirtualBox to Version 5.0.14 r105127 ( i do want to mention that this change likely did nothing for me, so you can skip this step ).
2 - In the terminal, run - sudo chmod -R 600 ~/.ssh/

When I completed step 2, I no longer saw the errors running docker-machine tool commands. If you are hung up at '(default) Starting VM...' and seeing similar error output debugging, I would recommend researching the owner permissions before deleting and re-creating your default machine. You will blow away your local images when you delete.

@jpierson

This comment has been minimized.

Show comment
Hide comment
@jpierson

jpierson Feb 22, 2016

Running the following seems to have fix my issue.

$ docker-machine rm default
$ docker-machine create --driver virtualbox default

I'm not sure if it's related but I first saw the error after opening up Kitematic which was installed along with the Docker Toolbox.

Win 10
MacBook Pro
Docker version 1.10.1, build 9e83765

jpierson commented Feb 22, 2016

Running the following seems to have fix my issue.

$ docker-machine rm default
$ docker-machine create --driver virtualbox default

I'm not sure if it's related but I first saw the error after opening up Kitematic which was installed along with the Docker Toolbox.

Win 10
MacBook Pro
Docker version 1.10.1, build 9e83765

@jmorganca

This comment has been minimized.

Show comment
Hide comment
@jmorganca

jmorganca Feb 26, 2016

Member

Merging this thread with #153 - feel free to continue the discussion there!

Just wanted to say a huge thanks to everyone who has provided input to this thread, and thanks for creating an issue!

Member

jmorganca commented Feb 26, 2016

Merging this thread with #153 - feel free to continue the discussion there!

Just wanted to say a huge thanks to everyone who has provided input to this thread, and thanks for creating an issue!

@will-parsons

This comment has been minimized.

Show comment
Hide comment
@will-parsons

will-parsons Mar 30, 2016

OSX El Capitan. If it helps anyone, I had two obstacles:

  1. I was connected to a VPN - my employer (rightly) restricts SSH and other connectivity around the network.
  2. By default I proxy all SSH connections (another security measure), and these scripts are using SSH to connect to the 'default' VM.

After disconnecting VPN, and setting my ~/.ssh/config back to "normal", everything worked as intended. Figuring out how to run this all seamlessly is my problem :) - might just use an independent VM or Cloud Server for development instead.

will-parsons commented Mar 30, 2016

OSX El Capitan. If it helps anyone, I had two obstacles:

  1. I was connected to a VPN - my employer (rightly) restricts SSH and other connectivity around the network.
  2. By default I proxy all SSH connections (another security measure), and these scripts are using SSH to connect to the 'default' VM.

After disconnecting VPN, and setting my ~/.ssh/config back to "normal", everything worked as intended. Figuring out how to run this all seamlessly is my problem :) - might just use an independent VM or Cloud Server for development instead.

@TimoSolo

This comment has been minimized.

Show comment
Hide comment
@TimoSolo

TimoSolo Apr 5, 2016

Did the docker-machine rm default thing a couple times, but takes ages to download image.

Found a simpler solution though! Open VirtualBox, turn off the "default" machine. Run Docker Quickstart and it starts up the VM and connects fine!

TimoSolo commented Apr 5, 2016

Did the docker-machine rm default thing a couple times, but takes ages to download image.

Found a simpler solution though! Open VirtualBox, turn off the "default" machine. Run Docker Quickstart and it starts up the VM and connects fine!

@syzer

This comment has been minimized.

Show comment
Hide comment
@syzer

syzer commented Apr 14, 2016

+1

@chineshboy

This comment has been minimized.

Show comment
Hide comment
@chineshboy

chineshboy Apr 28, 2016

I have met the same problem, on OSX EI Capitan. I just restarted my Mac and then it became fine.
So I think it is something wrong with VirtualBox, @TimoSolo 's answer might be a very good way.

chineshboy commented Apr 28, 2016

I have met the same problem, on OSX EI Capitan. I just restarted my Mac and then it became fine.
So I think it is something wrong with VirtualBox, @TimoSolo 's answer might be a very good way.

@Fernando9

This comment has been minimized.

Show comment
Hide comment
@Fernando9

Fernando9 May 12, 2016

I was having the same problem. Thank you @drewlamur changing the permissions on my ssh folder helped me with the issue for know. I hope that can give a better work around for this issue.

Fernando9 commented May 12, 2016

I was having the same problem. Thank you @drewlamur changing the permissions on my ssh folder helped me with the issue for know. I hope that can give a better work around for this issue.

@iver3on

This comment has been minimized.

Show comment
Hide comment
@iver3on

iver3on Jun 20, 2016

$ docker-machine rm default
$ docker-machine create --driver virtualbox default

I just do like that. but it appear another fault:

``$ docker-machine create --driver virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying C:\Users\31639.docker\machine\cache\boot2docker.iso to C:\Users\31639.docker\machine\machines\defaul
t\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Waiting for an IP...

who can help me ?
windows 10 and docker 1.11

iver3on commented Jun 20, 2016

$ docker-machine rm default
$ docker-machine create --driver virtualbox default

I just do like that. but it appear another fault:

``$ docker-machine create --driver virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying C:\Users\31639.docker\machine\cache\boot2docker.iso to C:\Users\31639.docker\machine\machines\defaul
t\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Waiting for an IP...

who can help me ?
windows 10 and docker 1.11

@Somebi

This comment has been minimized.

Show comment
Hide comment
@Somebi

Somebi Jun 22, 2016

In my case, problem was in low virtual memory. 256mb is not enough. Increasing it to 512mb have helped. There should be some error handling about out of memory or something like that at boot/loading time.

Somebi commented Jun 22, 2016

In my case, problem was in low virtual memory. 256mb is not enough. Increasing it to 512mb have helped. There should be some error handling about out of memory or something like that at boot/loading time.

@Somebi

This comment has been minimized.

Show comment
Hide comment
@Somebi

Somebi Jun 22, 2016

See logs in virtualbox directly. If it stuck, it will show at which point it does.

Somebi commented Jun 22, 2016

See logs in virtualbox directly. If it stuck, it will show at which point it does.

@harzbecher

This comment has been minimized.

Show comment
Hide comment
@harzbecher

harzbecher Jul 27, 2016

Same issue for me (Windows OS), in my case I solved it by opening virtualBox and resetting (Ctrl+T) "default" machine, then I opened 'Docker Quickstart Terminal Again' (It thrown the same error the first time) and ran docker-machine ls
image

harzbecher commented Jul 27, 2016

Same issue for me (Windows OS), in my case I solved it by opening virtualBox and resetting (Ctrl+T) "default" machine, then I opened 'Docker Quickstart Terminal Again' (It thrown the same error the first time) and ran docker-machine ls
image

@iver3on

This comment has been minimized.

Show comment
Hide comment
@iver3on

iver3on commented Aug 3, 2016

i see.

@dgoutam

This comment has been minimized.

Show comment
Hide comment
@dgoutam

dgoutam Sep 30, 2016

OS X El Capitan
Docker version 1.12.0

docker-machine rm default works for me

dgoutam commented Sep 30, 2016

OS X El Capitan
Docker version 1.12.0

docker-machine rm default works for me

@Avec112

This comment has been minimized.

Show comment
Hide comment
@Avec112

Avec112 Oct 1, 2016

OS X El Capitan
Docker version 1.12.1

I also had to run this after the ssh failed.

docker-machine rm default
docker-machine create --driver virtualbox default

However.

  1. I had Docker Toolbox earlier and installed Docker for Mac later. It worked like a charm.
  2. Today I cleaned my mac for all docker and boot2docker related stuff and started over
  3. As it seems to me, this problem occurs when installing Docker for mac without having boot2docker (or other needed files) in place from earlier.

Avec112 commented Oct 1, 2016

OS X El Capitan
Docker version 1.12.1

I also had to run this after the ssh failed.

docker-machine rm default
docker-machine create --driver virtualbox default

However.

  1. I had Docker Toolbox earlier and installed Docker for Mac later. It worked like a charm.
  2. Today I cleaned my mac for all docker and boot2docker related stuff and started over
  3. As it seems to me, this problem occurs when installing Docker for mac without having boot2docker (or other needed files) in place from earlier.
@Giriraj24

This comment has been minimized.

Show comment
Hide comment
@Giriraj24

Giriraj24 Nov 20, 2016

@iver3on , Were you able to find solution to your problem?

I am also facing the same issue?

See below:

$ docker-machine rm default
About to remove default
Are you sure? (y/n): y
Error removing host "default": Host does not exist: "default"

$ docker-machine create --virtualbox-no-vtx-check --driver virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying C:\Users\girirajgujar.docker\machine\cache\boot2docker.iso to C:\Users\girirajgujar.docker\machine\machines\default\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Waiting for an IP.......

It just get stuck there and nothing happens? Any idea?

Any idea?

I am using Win10 and Docker version 1.12

Giriraj24 commented Nov 20, 2016

@iver3on , Were you able to find solution to your problem?

I am also facing the same issue?

See below:

$ docker-machine rm default
About to remove default
Are you sure? (y/n): y
Error removing host "default": Host does not exist: "default"

$ docker-machine create --virtualbox-no-vtx-check --driver virtualbox default
Running pre-create checks...
Creating machine...
(default) Copying C:\Users\girirajgujar.docker\machine\cache\boot2docker.iso to C:\Users\girirajgujar.docker\machine\machines\default\boot2docker.iso...
(default) Creating VirtualBox VM...
(default) Creating SSH key...
(default) Starting the VM...
(default) Check network to re-create if needed...
(default) Waiting for an IP.......

It just get stuck there and nothing happens? Any idea?

Any idea?

I am using Win10 and Docker version 1.12

@RaazTripathi

This comment has been minimized.

Show comment
Hide comment
@RaazTripathi

RaazTripathi Jan 20, 2017

create a port forwarding for 57760 to 22 and it will solve problem

RaazTripathi commented Jan 20, 2017

create a port forwarding for 57760 to 22 and it will solve problem

@webguywalker

This comment has been minimized.

Show comment
Hide comment
@webguywalker

webguywalker Jan 26, 2017

Recreating the virtual machines seem to be pretty extreme, lol
I've noticed from time to time docker-machine will lose the state of the virtual box vm.
Suspecting this is networking specifically with OSX/VirtualBox

What I usually run:

// disconnect Lan & get on wifi
virtualbox // Power-Off Machines
docker-machine stop {{name}}
docker-machine start {{name}}
eval $(docker-machine env {{name}})

Specs:

El Capitan 10.11.6
Docker version 1.13.0
docker-machine version 0.9.0
VirtualBox Version 5.0.28

Maybe Related:

webguywalker commented Jan 26, 2017

Recreating the virtual machines seem to be pretty extreme, lol
I've noticed from time to time docker-machine will lose the state of the virtual box vm.
Suspecting this is networking specifically with OSX/VirtualBox

What I usually run:

// disconnect Lan & get on wifi
virtualbox // Power-Off Machines
docker-machine stop {{name}}
docker-machine start {{name}}
eval $(docker-machine env {{name}})

Specs:

El Capitan 10.11.6
Docker version 1.13.0
docker-machine version 0.9.0
VirtualBox Version 5.0.28

Maybe Related:

@doArcanjo

This comment has been minimized.

Show comment
Hide comment
@doArcanjo

doArcanjo Mar 22, 2017

Just one more possible solution:

Check "VBoxHardening.log" if it mentions "LavasoftTcpService.exe":

  • Unistall Ad-Aware (lavasoft);

Source:
docker/kitematic#2076 (comment)

doArcanjo commented Mar 22, 2017

Just one more possible solution:

Check "VBoxHardening.log" if it mentions "LavasoftTcpService.exe":

  • Unistall Ad-Aware (lavasoft);

Source:
docker/kitematic#2076 (comment)

@konkeong

This comment has been minimized.

Show comment
Hide comment
@konkeong

konkeong Apr 29, 2017

Encountered same problem.
Cannot find the IP address.
Follow the steps here and fix the problem.

Windows 7 Enterprise 64-bit
Oracle VM VirtualBox 5.1.20.r114628 (64bit) (VirtualBox-5.1.20-114628-Win.exe)
Docker Toolbox (DockerToolbox-17.05.0-ce-rc1.exe)

https://forum.adaware.com/index.php?/topic/34376-solution-for-lavasofttcpservice-problem-after-uninstallation/

  1. Please, start Command Prompt as an administrator by right-clicking it and select Run as administrator.

  2. Enter this command to reset the network adapter (end with the Enter key):
    netsh winsock reset

  3. Restart the computer.

  4. Please, delete these two files:
    C:\WINDOWS\system32\LavasoftTcpService64.dll
    C:\WINDOWS\system32\LavasoftTcpServiceOff.ini
    C:\WINDOWS\SysWOW64\LavasoftTcpService.dll (only for 64-bit Windows)
    C:\WINDOWS\SysWOW64\LavasoftTcpServiceOff.ini

konkeong commented Apr 29, 2017

Encountered same problem.
Cannot find the IP address.
Follow the steps here and fix the problem.

Windows 7 Enterprise 64-bit
Oracle VM VirtualBox 5.1.20.r114628 (64bit) (VirtualBox-5.1.20-114628-Win.exe)
Docker Toolbox (DockerToolbox-17.05.0-ce-rc1.exe)

https://forum.adaware.com/index.php?/topic/34376-solution-for-lavasofttcpservice-problem-after-uninstallation/

  1. Please, start Command Prompt as an administrator by right-clicking it and select Run as administrator.

  2. Enter this command to reset the network adapter (end with the Enter key):
    netsh winsock reset

  3. Restart the computer.

  4. Please, delete these two files:
    C:\WINDOWS\system32\LavasoftTcpService64.dll
    C:\WINDOWS\system32\LavasoftTcpServiceOff.ini
    C:\WINDOWS\SysWOW64\LavasoftTcpService.dll (only for 64-bit Windows)
    C:\WINDOWS\SysWOW64\LavasoftTcpServiceOff.ini

@kapalesachin

This comment has been minimized.

Show comment
Hide comment
@kapalesachin

kapalesachin Jul 26, 2017

This is most of the time issue because of firewall or VPN connectivity. I would suggest to create VM after you disconnect from VPN.

kapalesachin commented Jul 26, 2017

This is most of the time issue because of firewall or VPN connectivity. I would suggest to create VM after you disconnect from VPN.

@reubano reubano referenced this issue Aug 21, 2017

Merged

Document how to update documentation #55

1 of 1 task complete
@ssg1205

This comment has been minimized.

Show comment
Hide comment
@ssg1205

ssg1205 Oct 3, 2017

Before you try the below steps -

docker-machine rm default
docker-machine create --driver virtualbox default

Removing the "default" machine removes all the images which are associated with it. It may be a quick fix but definitely not worth it for people who are working on images already part of their "default" machine.

Please try resetting the "default" machine in VirtualBox by going to Machine-->Reset.

image

ssg1205 commented Oct 3, 2017

Before you try the below steps -

docker-machine rm default
docker-machine create --driver virtualbox default

Removing the "default" machine removes all the images which are associated with it. It may be a quick fix but definitely not worth it for people who are working on images already part of their "default" machine.

Please try resetting the "default" machine in VirtualBox by going to Machine-->Reset.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment