Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

docker-machine create is hanging with driver virtualbox : SSH cmd err, output: exit status 255: #1591

Closed
opskumu opened this issue Jul 27, 2015 · 68 comments

Comments

@opskumu
Copy link

opskumu commented Jul 27, 2015

# docker -v && docker-machine -v && docker-compose -v
Docker version 1.6.2, build ba1f6c3/1.6.2
docker-machine version 0.3.1 (40ee236)
docker-compose version: 1.3.3
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1e 11 Feb 2013
# rpm -qa | grep virtual -i
VirtualBox-4.3-4.3.30_101610_el7-1.x86_64

docker-machine create is hanging,the debug logs:

Getting to WaitForSSH function...
Testing TCP connection to: localhost:45105
Using SSH client type: external
About to run SSH command:
exit 0
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /root/.docker/machine/machines/dev2/id_rsa -p 45105 docker@localhost exit 0] []  <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>}
SSH cmd err, output: exit status 255: 
Error getting ssh command 'exit 0' : exit status 255
Getting to WaitForSSH function...
Testing TCP connection to: localhost:45105
Using SSH client type: external
About to run SSH command:
exit 0
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /root/.docker/machine/machines/dev2/id_rsa -p 45105 docker@localhost exit 0] []  <nil> <nil> <nil> [] <nil> <nil> <nil> <nil> false [] [] [] [] <nil>}
SSH cmd err, output: exit status 255: 
Error getting ssh command 'exit 0' : exit status 255
... ...
@opskumu opskumu changed the title docker-machine create is hanging: SSH cmd err, output: exit status 255: docker-machine create is hanging with driver virtualbox : SSH cmd err, output: exit status 255: Jul 27, 2015
@tehmaspc
Copy link

I believe this is the same issue I'm having on MacOSX. Have tried a few times to create a new VirtualBox Dev VM from scratch. Have cleaned out .docker/ and even downgraded from VBOX 5.

% docker-machine --version
docker-machine version 0.3.0 (0a251fe)
% VirtualBox --help | head -n 1
Oracle VM VirtualBox Manager 4.3.30
% docker-machine ls
error getting URL for host dev: exit status 255
NAME   ACTIVE   DRIVER       STATE     URL   SWARM
dev    *        virtualbox   Running

Let me know what specific logs / info you might need; the following is my debug log info:

STDERR:
executing: /usr/bin/VBoxManage modifyvm docker-vm --nic2 hostonly --nictype2 82540EM --hostonlyadapter2 vboxnet2 --cableconnected2 on
STDOUT:
STDERR:
executing: /usr/bin/VBoxManage modifyvm docker-vm --natpf1 delete ssh
STDOUT:
STDERR: VBoxManage: error: Code NS_ERROR_INVALID_ARG (0x80070057) - Invalid argument value (extended info not available)
VBoxManage: error: Context: "RemoveRedirect(Bstr(ValueUnion.psz).raw())" at line 1717 of file VBoxManageModifyVM.cpp
executing: /usr/bin/VBoxManage modifyvm docker-vm --natpf1 ssh,tcp,127.0.0.1,50083,,22
STDOUT:
STDERR:
executing: /usr/bin/VBoxManage startvm docker-vm --type headless
STDOUT: Waiting for VM "docker-vm" to power on...
VM "docker-vm" has been successfully started.
STDERR:
Starting VM...
Getting to WaitForSSH function...
Testing TCP connection to: localhost:50083
Using SSH client type: external
About to run SSH command:
exit 0
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /Users/tehmasp/.docker/machine/machines/docker-vm/id_rsa -p 50083 docker@localhost exit 0] []     []    ?reflect.Value? false [] [] [] [] }
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : exit status 255
Getting to WaitForSSH function...
Testing TCP connection to: localhost:50083
Using SSH client type: external
About to run SSH command:
exit 0
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /Users/tehmasp/.docker/machine/machines/docker-vm/id_rsa -p 50083 docker@localhost exit 0] []     []    ?reflect.Value? false [] [] [] [] }
 SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : exit status 255
Getting to WaitForSSH function...
Testing TCP connection to: localhost:50083
Using SSH client type: external
About to run SSH command:
exit 0
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /Users/tehmasp/.docker/machine/machines/docker-vm/id_rsa -p 50083 docker@localhost exit 0] []     []    ?reflect.Value? false [] [] [] [] }
SSH cmd err, output: exit status 255:
Error getting ssh command 'exit 0' : exit status 255
Getting to WaitForSSH function...
Testing TCP connection to: localhost:50083
Using SSH client type: external
About to run SSH command:
exit 0
&{/usr/bin/ssh [/usr/bin/ssh -o PasswordAuthentication=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -i /Users/tehmasp/.docker/machine/machines/docker-vm/id_rsa -p 50083 docker@localhost exit 0] []     []    ?reflect.Value? false [] [] [] [] }

I'm able to log into the VM manually, and it seems to be OK - so I think the issue is with docker-machine not being able to get the status correctly.

@tehmaspc
Copy link

I got a docker-machine environment working with:

% docker-machine --version
docker-machine version 0.4.0-rc1 (f6ea2c1)

(FYI - Manually installed it since homebrew-cask doesn't have anything newer than v0.3.0 as of yet)

However, on 'create', docker-machine still hung and I had to 'regenerate-certs' for my 'docker-vm' in order to fully get a 'docker-machine env docker-vm' to work.

Putting it out there for anyone else that's having similar issues. At least I have a working docker-machine environment now - without having to revert to boot2docker. Only wasted the whole day on this however :(

@opskumu
Copy link
Author

opskumu commented Jul 28, 2015

@tehmaspc the same issue with you, And I didn't find a solution

@ehazlett
Copy link
Contributor

@tehmaspc thanks for the feedback and sorry for the trouble :( unfortunately this is usually due to the virtualbox networking. Thanks for the feedback that v0.4.0-rc1 fixed.

@opskumu would you mind trying the 0.4.0-rc1?

@wmiller848
Copy link

I'm seeing the same thing on MacOS X Yosemite 0.4.0-rc1

docker-machine create --driver=virtualbox --virtualbox-disk-size "40000" local
No default boot2docker iso found locally, downloading the latest release...
Downloading https://s3.amazonaws.com/docker-mcn/public/b2d-next/boot2docker-virtualbox.iso to /Users/wmillerx/.docker/machine/cache/boot2docker-virtualbox.iso...
Creating VirtualBox VM...
Creating SSH key...
Starting VirtualBox VM...
Starting VM...

Just hangs forever...

Env Info:

sw_vers
ProductName:    Mac OS X
ProductVersion: 10.10.4
BuildVersion:   14E46
docker --version
Docker version 1.7.1, build 786b29d
docker-machine --version
docker-machine version 0.4.0-rc1 (f6ea2c1)
vboxmanage --version
5.0.0r101573

@tehmaspc
Copy link

FWIW, I downgraded to 4.3.x VBOX and I did a regenerate cert command to get past this. Make sure to try that with a fresh VM. Good luck.

@tehmaspc
Copy link

@opskumu @wmiller848 - so I just came across this issue: #1572

I use SSH multiplexing in my ~/.ssh/config file; I just disabled these settings and I'm getting docker-machine to work properly. Even my workaround above wasn't really working consistently but with SSH multiplexing disabled it seems to have been the fix.

Wondering if you guys have SSH multiplexing enabled???

My ~/.ssh/config file is now:

% cat ~/.ssh/config
Host *
  TCPKeepAlive yes
  ServerAliveInterval 10
  ServerAliveCountMax 10
  ForwardAgent yes
#  ControlMaster auto
#  ControlPath ~/.ssh/sockets/%r@%h-%p
#  ControlPersist 300

Cheers,
Tehmasp

@powdahound
Copy link

Disabling SSH multiplexing worked for me too (on OS X 10.10.4). Thank you @tehmaspc!

@opskumu
Copy link
Author

opskumu commented Aug 13, 2015

@ehazlett I have already test the 0.4.0,It's also not work.

# docker-machine -v
docker-machine version 0.4.0 (9d0dc7a)
# cat /etc/centos-release 
CentOS Linux release 7.1.1503 (Core)

@tehmaspc Diablling ssh multiplexing doesn't work for me too.

There are also have a problem on Win10 with docker-machine 0.4.0:

{ ~ }  » docker-machine.0.4.0 ls                                                                                                ~ 1
NAME      ACTIVE   DRIVER       STATE     URL   SWARM
default            virtualbox   Timeout
dev                virtualbox   Timeout
{ ~ }  » docker-machine.0.3.1 ls                                                                                              ~ 127
NAME      ACTIVE   DRIVER       STATE     URL                         SWARM
default            virtualbox   Stopped
dev                virtualbox   Running   tcp://192.168.99.102:2376

@stejohnson
Copy link

Not sure if this helps, but following similar problems I noticed the ssh port was not set in my machine's config file (~/.docker/machine/machines/<machine_name>/config.json). Consequently, docker-machine was always trying to ssh on port 22. After setting this manually everything worked for me.

@chrisfosterelli
Copy link

For what it's worth, removing the multiplex settings in my SSH config fixed this for me. Nothing else I tried in any of the other open issues was working, but now everything appears to work great.

Perhaps the VM setup script should consider using the SSH -o option to disable multiplexing when it's making connections?

@tehmaspc
Copy link

@chrisfosterelli yup +1 ;

cc @ehazlett - loads of people are continuing to have this issue; should we bump this?

thanks,
@tehmaspc

@garystafford
Copy link

The problem has been so hit and miss. It would be great to crowd source the potential fix with everyone that's part of this discussion to ensue it mitigates the issue.

@stgarf
Copy link

stgarf commented Aug 17, 2015

Removing ssh mutliplexing fixed this for me as well.

@garystafford
Copy link

Has anyone found disabling ssh multiplexing fixed the issue on Linux, as opposed to Mac. I am still seeing issue on Ubuntu with it disabled. People say it fixed it for them, but don't note Linux, Windows, or Mac.

@rhim
Copy link

rhim commented Aug 18, 2015

I don't have ssh multiplexing turned on, but I am still seeing this issue.
@wmiller848 : did you find a solution to this problem?
Here is my environment:
~$docker --version; docker-machine --version; VBoxManage --version
Docker version 1.9.0-dev, build 0e3674d, experimental
docker-machine version 0.4.1 (e2c88d6)
5.0.0r101573

~$sw_vers
ProductName: Mac OS X
ProductVersion: 10.10.4
BuildVersion: 14E46

@MatthewVance
Copy link

I'm also seeing the following error:

SSH cmd err, output: exit status 255: 
Error getting ssh command 'exit 0' : exit status 255

I used the default Docker Machine install and let it install VirtualBox since I didn't already have it on this particular computer. The only thing potentially odd I have is a homebrew version of OpenSSH with strict crypto requirements. Here's the details of my environment:

sw_vers
ProductName:    Mac OS X
ProductVersion: 10.10.5
BuildVersion:   14F27
docker --version
Docker version 1.8.1, build d12ea79
docker-machine --version
docker-machine version 0.4.1 (e2c88d6)
vboxmanage --version
5.0.2r102096
ssh -V
OpenSSH_7.0p1, OpenSSL 1.0.2d 9 Jul 2015
cat ~/.ssh/config 
#Defaults for all my hosts
Host *
    AddressFamily inet
    Ciphers [email protected],[email protected]
    ForwardX11 no
    ForwardX11Trusted no
    KexAlgorithms [email protected]
    MACs [email protected],[email protected],[email protected]
    Protocol 2
    VisualHostKey yes  
    HashKnownHosts yes
#host specific stuff..

@mglaman
Copy link

mglaman commented Aug 24, 2015

Having same issue.

$ vboxmanage --version
5.0.2r102096
$ docker-machine --version
docker-machine version 0.4.1 (e2c88d6)

Not sure why, but my issue is a bad config.json for the machine. It's missing the machine's IP and port.

@mshean
Copy link

mshean commented Aug 24, 2015

Also having the same problem... I'm using boot2docker until this is fixed.

vboxmanage --version
4.3.14r95030

docker-machine -version
docker-machine version 0.4.1 (e2c88d6)

docker version
Client:
 Version:      1.8.1
 API version:  1.20
 Go version:   go1.4.2
 Git commit:   d12ea79
 Built:        Thu Aug 13 19:47:52 UTC 2015
 OS/Arch:      darwin/amd64

@ncuesta
Copy link

ncuesta commented Aug 31, 2015

I'm having the same issue here:

$ docker --version; docker-machine --version; VBoxManage --version; sw_vers                                                                                              2.2.2 16:52
Docker version 1.8.1, build d12ea79
docker-machine version 0.4.1 (e2c88d6)
5.0.3r102322
ProductName:    Mac OS X
ProductVersion: 10.10.5
BuildVersion:   14F27

Thanks

@tdoherty
Copy link

tdoherty commented Sep 2, 2015

Same issue here:

$ docker --version; docker-machine --version; VBoxManage --version; sw_vers
Docker version 1.8.1, build d12ea79
docker-machine version 0.4.1 (e2c88d6)
4.3.22r98236
ProductName:    Mac OS X
ProductVersion: 10.10.5
BuildVersion:   14F27

I downgraded VBox from 5.x to 4.3.x and it worked for a few hours, then gave the same SSH error.

@ecylmz
Copy link

ecylmz commented Sep 2, 2015

I have same issue. I have found workaround for this bug:

$ docker-machine --native-ssh create -d virtualbox test

@stayclassychicago
Copy link

Thanks @ecylmz. +1 for your workaround. I still saw this error, but it successfully created the machine.

STDERR: executing: /usr/local/bin/VBoxManage modifyvm imc --natpf1 delete ssh

STDERR: VBoxManage: error: Code NS_ERROR_INVALID_ARG (0x80070057) - Invalid argument value (extended info not available)
VBoxManage: error: Context: "RemoveRedirect(Bstr(ValueUnion.psz).raw())" at line 1766 of file VBoxManageModifyVM.cpp

@ncuesta
Copy link

ncuesta commented Sep 2, 2015

Kudos to @ecylmz for the workaround, it also worked for me. Only caveat is that I need to run docker-machine --native-ssh for every docker-machine command (like docker-machine env vm_name).

It's also worth noting that upgrading to Docker Toolbox 1.8.1c didn't fix this issue.

@francoiskha
Copy link

--native-ssh workaround worked for me too

@frankwmoyer
Copy link

--native-ssh worked for me. 👍 @ecylmz

@ragavendra
Copy link

I had corrupt ~/.ssh/config . Once I corrected it, I was able to create machine like before. One way to check this is trying to ssh to some other server and see if it works to make sure the docker-machine isn't failing due to ssh.

@MilindAtGithub
Copy link

Same issue and nothing worked .
For me only the work around solution is to add --native-ssh for each machine.

My Env Details:
OS: OS X El Capitan Version 10.11
docker-machine version 0.5.0 (04cfa58)
VBoxManage --version
5.0.8r103449

@timhtheos
Copy link

@tehmaspc #1591 (comment) works for me, with some workarounds suggested by @trentm.

@jocull
Copy link

jocull commented Dec 20, 2015

I ran into this on Windows 10 today after a small upgrade in my Docker install. I tried everything - removing .docker, rebuilding the VBox VMs, fiddling with my environment vars, hacking on config.json... In the end I uninstalled everything (including virtualbox) and let it all reinstall. That worked!

I seemed like there must be an issue with the VBox networks that happens during the upgrade process or something. Like the expected IP address was taken and it all blew up after that.

@nadworny
Copy link

I had the same issue. Apparently I had an OpenSSH installed before and it was taking it while creating the docker image which led to the ControlMaster error. I uninstalled it, added Git\bin to the path and it worked like a charm.

@chrisbenson
Copy link

I'm having this same problem, and the proposed workarounds on this page have not had any effect. Any ideas?

Here is my environment:

Docker version 1.10.3, build 20f81dd
docker-machine version 0.6.0, build e27fb87
5.0.16r105871
ProductName: Mac OS X
ProductVersion: 10.11.4
BuildVersion: 15E65

When I issue this command:

docker-machine --debug create -d virtualbox default

...it always eventually hangs on this error, which is printed to the terminal repeatedly until I manually interrupt it:

(default) DBG | Getting to WaitForSSH function...
(default) DBG | Using SSH client type: external
(default) DBG | {[-o BatchMode=yes -o PasswordAuthentication=no -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=quiet -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none [email protected] -o IdentitiesOnly=yes -i /Users/cbenson/.docker/machine/machines/default/id_rsa -p 53332] /usr/local/bin/ssh}
(default) DBG | About to run SSH command:
(default) DBG | exit 0
(default) DBG | SSH cmd err, output: exit status 255:
(default) DBG | Error getting ssh command 'exit 0' : Something went wrong running an SSH command!
(default) DBG | command : exit 0
(default) DBG | err : exit status 255
(default) DBG | output :

@chrisbenson
Copy link

@nathanleclaire can you take a look at my comment above? I'm on Mac El Cap, and everything I'm using - Docker, Docker Machine, VirtualBox, OS updates - is the very latest version. Nothing I've seen as potential fixes in this or related issue pages has worked. I think it's something about my configuration, because it affects two similarly-configured Macs I have. I use Homebrew for latest Docker, Docker Machine, OpenSSH, and OpenSSL. I have VirtualBox installed from its own binary, but I've previously tried installing it via Homebrew as well (but not currently). Any ideas? Thanks!

@tehmaspc
Copy link

tehmaspc commented Apr 5, 2016

I don't have EL Cap yet so I cannot share my experience w/r/t that OS.

An alternative is to get into the Docker for Mac beta which eliminates Virtualbox requirements altogether. Of course it might have other issues :)

https://blog.docker.com/2016/03/docker-for-mac-windows-beta/

@nathanleclaire
Copy link
Contributor

@chrisbenson What's your ~/.ssh/config file like?

What's the output of docker-machine ssh default -vvv?

@chrisbenson
Copy link

@nathanleclaire Sorry for the delay getting back to you. I temporarily gave up and didn't check back quickly. I'll be more vigilant waiting for your replies going forward.

It's not the ~/.ssh/config, because I actually deleted mine to just make sure it wasn't that. It had no effect.

After I run docker-machine --debug create -d virtualbox default, which generates the afformentioned error over and over again, and then I Ctrl + C out of it.

Then I enter docker-machine ssh default -vvv, and get this:

OpenSSH_7.2p2, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /usr/local/etc/ssh/ssh_config
debug2: resolving "127.0.0.1" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 22.
debug2: fd 3 setting O_NONBLOCK
debug1: connect to address 127.0.0.1 port 22: Connection refused
debug1: Trying again...
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 22.
debug2: fd 3 setting O_NONBLOCK
debug1: connect to address 127.0.0.1 port 22: Connection refused
debug1: Trying again...
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 22.
debug2: fd 3 setting O_NONBLOCK
debug1: connect to address 127.0.0.1 port 22: Connection refused
ssh: connect to host 127.0.0.1 port 22: Connection refused
exit status 255

@nathanleclaire
Copy link
Contributor

@chrisbenson Just to make sure, what's the contents of /usr/local/etc/ssh/ssh_config?

@chrisbenson
Copy link

@nathanleclaire Here's the result of 'cat /usr/local/etc/ssh/ssh_config':

# This is the ssh client system-wide configuration file.  See
# ssh_config(5) for more information.  This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
#  1. command line options
#  2. user-specific file
#  3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options.  For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

# Host *
#   ForwardAgent no
#   ForwardX11 no
#   RhostsRSAAuthentication no
#   RSAAuthentication yes
#   PasswordAuthentication yes
#   HostbasedAuthentication no
#   GSSAPIAuthentication no
#   GSSAPIDelegateCredentials no
#   BatchMode no
#   CheckHostIP yes
#   AddressFamily any
#   ConnectTimeout 0
#   StrictHostKeyChecking ask
#   IdentityFile ~/.ssh/identity
#   IdentityFile ~/.ssh/id_rsa
#   IdentityFile ~/.ssh/id_dsa
#   Port 22
#   Protocol 2,1
#   Cipher 3des
#   Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
#   MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160
#   EscapeChar ~
#   Tunnel no
#   TunnelDevice any:any
#   PermitLocalCommand no
#   VisualHostKey no
#   ProxyCommand ssh -q -W %h:%p gateway.example.com
#   RekeyLimit 1G 1h

@nathanleclaire
Copy link
Contributor

Hm, OK, so nothing's set. Can you try the 0.7.0 release to see if you fare any better (it's brand new, so you'll have to download the binaries as Toolbox hasn't been baked yet)

@chrisbenson
Copy link

@nathanleclaire I tried 0.7.0, but it made no difference. Getting exactly the same error. Any other ideas? Thanks!

@nathanleclaire
Copy link
Contributor

@chrisbenson Does --native-ssh work for you, or does it exhibit the same issue?

@chrisbenson
Copy link

@nathanleclaire It exhibits the same issue, Nathan.

@nathanleclaire
Copy link
Contributor

@chrisbenson You have any kind of firewall / VPN / proxy on?

@chrisbenson
Copy link

@nathanleclaire No sir, not a thing. I'm working on a modern, completely updated MacBook Pro running El Capitan. I keep everything (Docker, Docker Machine, OpenSSL, OpenSSH) updated with Homebrew, except I installed VirtualBox using their download binary. There is nothing remarkable about my setup, which is why I'm stumped.

@nathanleclaire
Copy link
Contributor

nathanleclaire commented Apr 15, 2016

@chrisbenson Couple things to please try:

  • If you use the provided Machine binary from the releases page, does it make any difference? There is a very small chance there could potentially be a cgo vs. native Go issue due to use of Homebrew.
  • If you look at the exposed VirtualBox port in the GUI (forwarded port 22 in Network Settings for the VM), can you SSH into it manually? (e.g. ssh [email protected] -p 34567 -- password is tcuser)
    • If not, does stuff like ping 127.0.0.1 work?
  • Is your Mac system firewall enabled? (in Settings IIRC)
  • Please take a look at the VirtualBox logs (nested inside of ~/.docker/machine/machines/default/default) to see if there is anything interesting, e.g. errors.
  • 127.0.0.1 is your default loopback, right? what does your /etc/hosts file look like?

@komocode
Copy link

komocode commented Jun 11, 2016

--native-ssh works for me, but this problem occurs everytime I start a new terminal session in OS X. I've had nothing but problems with docker-machine in production, I hope the upcoming Docker for Mac solves these issues.

@ccamp46
Copy link

ccamp46 commented Aug 3, 2016

This is happening on windows 7, latest docker toolbox, when i put the pc to sleep at night. When I wake the PC all docker-machine commands time out, but i can docker-machine ssh $node just fine. Inside the nodes, docker is running fine and containers i launched the previous day are still running.

$ docker -v && docker-machine -v
Docker version 1.12.0, build 8eab29e
docker-machine.exe version 0.8.0, build b85aac1

@angotv
Copy link

angotv commented May 27, 2017

$ docker-machine env

$ docker-machine regenerate-certs [machine name]

$ docker-machine ls
ok!

@CollinChaffin
Copy link

Wow three YEARS later on WIN7x64 here and this is STILL HAPPENING!!! Isn't it time to fix it or just call the product broken when it's IMPOSSIBLE to issue a simple 1st default create command due to this?

(default) DBG | About to run SSH command:
(default) DBG | exit 0
(default) DBG | SSH cmd err, output: exit status 255:
(default) DBG | Error getting ssh command 'exit 0' : ssh command error:
(default) DBG | command : exit 0
(default) DBG | err     : exit status 255

@tenorok
Copy link

tenorok commented Nov 3, 2018

Unfortunately I have the same issue. It seems I read all links in google and nothing can fix the problem. Please help!

Is it correct to create machines inside VPS like DigitalOcean droplet? I have the problem on the such server:

# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:    18.04
Codename:   bionic
# docker -v
Docker version 18.06.1-ce, build e68fc7a
# docker-machine -v
docker-machine version 0.15.0, build b48dc28d
# VBoxManage --version
5.2.10_Ubuntur121806
# docker-machine --debug create --driver virtualbox mymachine

...

(mymachine) Waiting for an IP...
(mymachine) DBG | STDOUT:
(mymachine) DBG | {
(mymachine) DBG | Waiting for VM "mymachine" to power on...
(mymachine) DBG | VM "mymachine" has been successfully started.
(mymachine) DBG | }
(mymachine) DBG | STDERR:
(mymachine) DBG | {
(mymachine) DBG | }
(mymachine) DBG | Checking vm logs: /root/.docker/machine/machines/mymachine/mymachine/Logs/VBox.log
(mymachine) DBG | Getting to WaitForSSH function...
(mymachine) DBG | Using SSH client type: external
(mymachine) DBG | Using SSH private key: /root/.docker/machine/machines/mymachine/id_rsa (-rw-------)
(mymachine) DBG | &{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null [email protected] -o IdentitiesOnly=yes -i /root/.docker/machine/machines/mymachine/id_rsa -p 44643] /usr/bin/ssh <nil>}
(mymachine) DBG | About to run SSH command:
(mymachine) DBG | exit 0

# And then many times:

(mymachine) DBG | SSH cmd err, output: exit status 255:
(mymachine) DBG | Error getting ssh command 'exit 0' : ssh command error:
(mymachine) DBG | command : exit 0
(mymachine) DBG | err     : exit status 255
(mymachine) DBG | output  :
(mymachine) DBG | Getting to WaitForSSH function...
(mymachine) DBG | Using SSH client type: external
(mymachine) DBG | Using SSH private key: /root/.docker/machine/machines/mymachine/id_rsa (-rw-------)
(mymachine) DBG | &{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null [email protected] -o IdentitiesOnly=yes -i /root/.docker/machine/machines/mymachine/id_rsa -p 44643] /usr/bin/ssh <nil>}
(mymachine) DBG | About to run SSH command:
(mymachine) DBG | exit 0

I tried create ssh config:

# cat ~/.ssh/config
Host *
  TCPKeepAlive yes
  ServerAliveInterval 10
  ServerAliveCountMax 10
  ForwardAgent yes
  ControlMaster no

Using --native-ssh no solve issue.

@nathanleclaire
Copy link
Contributor

@tenorok You can't nest virtualization in most cloud providers which is what attempting to create a VirtualBox machine on DO would be doing.

@beatwade
Copy link

beatwade commented Feb 21, 2019

I've tried the tool-box and meet the same issues when I used cmd and native ssh (windows oponssl)
and resolved this issues by tring ssh from git /usr/bin/ssh.

image

@mirr254
Copy link

mirr254 commented Jun 16, 2020

Getting this issue in 2020.

&{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null [email protected] -p 22] /usr/local/bin/ssh <nil>}
About to run SSH command:
exit 0
SSH cmd err, output: exit status 255: 
Error getting ssh command 'exit 0' : ssh command error:
command : exit 0
err     : exit status 255
output  : 
Getting to WaitForSSH function...
(dvc1) Calling .GetSSHHostname
(dvc1) Calling .GetSSHPort
(dvc1) Calling .GetSSHKeyPath
(dvc1) Calling .GetSSHUsername
Using SSH client type: external
&{[-F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null [email protected] -p 22] /usr/local/bin/ssh <nil>}
About to run SSH command:
exit 0
➜  dogvscat git:(master) ✗ docker-machine -v
docker-machine version 0.16.2, build bd45ab1
➜  dogvscat git:(master) ✗ docker version
Client: Docker Engine - Community
 Version:           19.03.8

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests