Machine: docker-machine create挂在驱动程序virtualbox上:SSH cmd err,输出:退出状态255:

创建于 2015-07-27  ·  68评论  ·  资料来源: docker/machine

# 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挂起,调试日志:

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<strong i="8">@localhost</strong> 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<strong i="9">@localhost</strong> 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
... ...
drivevirtualbox

所有68条评论

我相信这与我在MacOSX上遇到的问题相同。 尝试过几次,从头开始创建新的VirtualBox Dev VM。 清理了.docker /甚至从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
让我知道您可能需要哪些特定的日志/信息; 以下是我的调试日志信息:
 STDERR:
执行:/ usr / bin / VBoxManage Modifyvm docker-vm --nic2 hostonly --nictype2 82540EM --hostonlyadapter2 vboxnet2 --cableconnected2 on
标准输出:
 STDERR:
执行:/ usr / bin / VBoxManage Modifyvm docker-vm --natpf1 delete ssh
标准输出:
 STDERR:VBoxManage:错误:代码NS_ERROR_INVALID_ARG(0x80070057)-无效的参数值(扩展信息不可用)
 VBoxManage:错误:上下文:文件VBoxManageModifyVM.cpp的第1717行处的“ RemoveRedirect(Bstr(ValueUnion.psz).raw())”
执行:/ usr / bin / VBoxManage Modifyvm docker-vm --natpf1 ssh,tcp,127.0.0.1,50083,,22
标准输出:
 STDERR:
执行:/ usr / bin / VBoxManage startvm docker-vm --type headless
 STDOUT:等待VM“ docker-vm”开机...
虚拟机“ docker-vm”已成功启动。
 STDERR:
正在启动VM ...
进入WaitForSSH功能...
测试与以下主机的TCP连接:localhost:50083
使用SSH客户端类型:外部
即将运行SSH命令:
出口0
 &{/ usr / bin / ssh [/ usr / bin / ssh -o PasswordAuthentication = no -o IdentitiesOnly =是-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? 假[] [] [] []}
 SSH cmd err,输出:退出状态255:
获取ssh命令“退出0”时出错:退出状态255
进入WaitForSSH功能...
测试与以下主机的TCP连接:localhost:50083
使用SSH客户端类型:外部
即将运行SSH命令:
出口0
 &{/ usr / bin / ssh [/ usr / bin / ssh -o PasswordAuthentication = no -o IdentitiesOnly =是-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? 假[] [] [] []}
 SSH cmd err,输出:退出状态255:
获取ssh命令“退出0”时出错:退出状态255
进入WaitForSSH功能...
测试与以下主机的TCP连接:localhost:50083
使用SSH客户端类型:外部
即将运行SSH命令:
出口0
 &{/ usr / bin / ssh [/ usr / bin / ssh -o PasswordAuthentication = no -o IdentitiesOnly =是-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? 假[] [] [] []}
 SSH cmd err,输出:退出状态255:
获取ssh命令“退出0”时出错:退出状态255
进入WaitForSSH功能...
测试与以下主机的TCP连接:localhost:50083
使用SSH客户端类型:外部
即将运行SSH命令:
出口0
 &{/ usr / bin / ssh [/ usr / bin / ssh -o PasswordAuthentication = no -o IdentitiesOnly =是-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? 假[] [] [] []}

我可以手动登录到虚拟机,这似乎还可以-因此我认为问题在于docker-machine无法正确获取状态。

我有一个docker-machine环境可以使用:

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

(仅供参考-由于homebrew-cask到目前为止还没有v0.3.0之前的更新,因此需要手动安装)

但是,在“创建”时,docker机器仍然挂起,我必须为“ docker-vm”重新生成证书,才能完全使“ docker-machine env docker-vm”正常工作。

将其发布给存在类似问题的其他任何人。 至少我现在有一个可以正常工作的docker-machine环境-无需还原到boot2docker。 但是只浪费了一整天:(

@tehmaspc与您同样的问题,但我没有找到解决方案

@tehmaspc感谢您的反馈,也很抱歉给您带来麻烦:(不幸的是,这通常是由于VirtualBox网络。感谢v0.4.0-rc1修复的反馈。

@opskumu您介意尝试0.4.0-rc1吗?

我在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...

永远挂...

环保信息:

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

FWIW,我降级到4.3.x VBOX,并执行了重新生成证书命令以克服此问题。 确保尝试使用新的VM。 祝好运。

@opskumu @ wmiller848-所以我刚遇到这个问题: https :

我在〜/ .ssh / config文件中使用SSH多路复用; 我只是禁用了这些设置,但我正在使docker-machine正常工作。 甚至我上面的解决方法也不能始终如一地工作,但是在禁用SSH多路复用的情况下,似乎已经解决了。

想知道你们是否启用了SSH多路复用吗???

我的〜/ .ssh / config文件现在是:

 %cat〜/ .ssh / config
主持人*
 TCPKeepAlive是
 ServerAliveInterval 10
 ServerAliveCountMax 10
 ForwardAgent是
 #ControlMaster自动
 #ControlPath ~/.ssh/sockets/%r@%h-%p
 #ControlPersist 300

干杯,
Tehmasp

禁用SSH多路复用对我也有效(在OS X 10.10.4上)。 谢谢@tehmaspc!

@ehazlett我已经测试了0.4.0,它也不起作用。

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

@tehmaspc Diablling ssh复用对我也不起作用。

在Win10上,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

不确定这是否有帮助,但是在遇到类似问题后,我注意到ssh端口未在计算机的配置文件( ~/.docker/machine/machines/<machine_name>/config.json )中设置。 因此, docker-machine始终尝试在端口22上使用ssh。手动设置此选项后,一切对我都有效。

值得的是,删除我的SSH配置中的Multiplex设置对我来说已经解决了。 我在其他任何未解决的问题上都没有尝试其他方法,但是现在一切似乎都很好。

也许VM设置脚本在建立连接时应该考虑使用SSH -o选项禁用多路复用?

@chrisfosterelli yup +1;

cc @ehazlett-人们继续遇到这个问题; 我们应该碰碰这个吗?

谢谢,
@tehmaspc

问题一直如此严重。 在本次讨论的一部分中,与每个人一起众包潜在修复程序,以确保它可以缓解问题,这将是很棒的。

删除ssh mutiplexing也为我解决了这一问题。

有没有人发现禁用ssh多路复用解决了Linux(而不是Mac)上的问题。 我仍然在Ubuntu上看到禁用它的问题。 人们说它为他们修复了它,但没有注意到Linux,Windows或Mac。

我没有打开ssh复用,但仍然看到此问题。
@ wmiller848 :您找到解决此问题的方法了吗?
这是我的环境:
〜$ docker --version; docker-machine --version; VBoxManage-版本
Docker版本1.9.0-dev,内部版本0e3674d,实验性
docker机器版本0.4.1(e2c88d6)
5.0.0r101573

〜$ sw_vers
产品名称:Mac OS X
产品版本:10.10.4
内部版本号:14E46

我还看到以下错误:

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

我使用默认的Docker Machine安装并让其安装VirtualBox,因为在这台特定的计算机上还没有安装。 我唯一有可能奇怪的是具有严格加密要求的OpenSSH的自制版本。 这是我的环境的详细信息:

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..

有同样的问题。

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

不知道为什么,但是我的问题是机器的config.json错误。 它缺少机器的IP和端口。

也有同样的问题...我正在使用boot2docker,直到解决此问题。

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

我在这里遇到同样的问题:

$ 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

谢谢

同样的问题在这里:

$ 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

我将VBox从5.x降级到4.3.x,它工作了几个小时,然后给出了相同的SSH错误。

我有同样的问题。 我已经找到解决此错误的方法:

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

谢谢@ecylmz。 解决方法+1。 我仍然看到此错误,但它成功创建了计算机。

STDERR:执行:/ usr / local / bin / VBoxManage Modifyvm imc --natpf1删除ssh

STDERR:VBoxManage:错误:代码NS_ERROR_INVALID_ARG(0x80070057)-无效的参数值(扩展信息不可用)
VBoxManage:错误:上下文:文件VBoxManageModifyVM.cpp的第1766行处的“ RemoveRedirect(Bstr(ValueUnion.psz).raw())”

应对@ecylmz表示感谢,也对我docker-machine命令(例如docker-machine env vm_name )运行docker-machine --native-ssh

还值得注意的是,升级到Docker Toolbox 1.8.1c不能解决此问题。

--native-ssh解决方法也对我有用

--native-ssh为我工作。 :+1:@ecylmz

仅供参考,如果您遇到这些问题的原因是由于SSH多路复用配置设置,则应在下一发行版中/主服务器上对其进行修复。

@nathanleclaire感谢您提供有关修复SSH多路复用的更新。 好消息! 我已经在Linux(Ubuntu)上测试了--native-ssh 。 它不能解决问题。 再次,它是命中注定的,因此一次起作用并不意味着什么。 我可以让它连续失败10次,然后突然工作几次,然后失败10次。

@garystafford我可以确认此--native-ssh在Ubuntu没有默认驱动程序时不起作用。

+1

我运行$ docker-machine -D --native-ssh create -d virtualbox local命令,它不适用于错误日志:
执行:/ usr / bin / VBoxManage startvm local --type headless
STDOUT:等待VM“本地”启动...
虚拟机“本地”已成功启动。

STDERR:
正在启动VM ...
进入WaitForSSH功能...
测试与以下主机的TCP连接:
使用SSH客户端类型:本机
即将运行SSH命令:
出口0
拨号TCP时出错:ssh:握手失败:读取tcp 127.0.0.1:49564:对等重置连接
拨号TCP时出错:ssh:握手失败:读取tcp 127.0.0.1:49564:对等重置连接

@nathanleclaire ,我刚刚在GitHub的master分支上为Ubuntu或Fedora克隆并构建了最新的

gstafford@gstafford-X555LA:$ docker-machine -v
docker-machine version 0.5.0-dev (fe5a722)

@nathanleclaire通过删除您提到的那些额外的仅主机网络适配器,我从80%以上的失败创建机器和/或使IP地址冲突变为100%成功。 在VirtualBox 5.0.3上,我转到VirtualBox->首选项->网络->仅主机网络,并将其删除。 之后,我创建了一个5集群群集,并添加了编织,没有明显的错误或问题。 谢谢。 仅供参考,我仍在运行我克隆并构建的docker-machine version 0.5.0-dev (fe5a722)版本。

@garystafford

看来我的问题有两个方面。 不仅需要删除适配器vmnet0和vmnet1,而且所有docker-machine命令都需要sudo。

在我的环境中,这是Virtualbox网络问题。 我不得不
(1)将仅主机适配器更改为桥接适配器(en0 Wi-Fi)。
然后我可以ssh docker @ ...
(2)docker-machine重新生成证书
然后'docker-machine config'工作

出现了完全相同的错误,但是通过在BIOS中“启用虚拟化”设法解决了我的问题。

排除故障:

  1. 使用调试标志: docker-machine --debug create --driver virtualbox dev
  2. 如果是适配器/端口转发问题,请在VirtualBox Manager中检查“ dev”虚拟机网络设置
  3. 偶然地,我在VirtualBox Manager中双击正在运行的“ dev” vm,这将打开一个进入“ dev” vm的窗口,该窗口显示了实际问题:“ vt x amd-v在您的系统上不可用”。 因此,码头工人的虚拟机因错误而卡住了“需要x86-64,但仅检测到i686 cpu

只想分享我的疑难解答,尤其是在VirtualBox Manager中正在运行的虚拟机上“双击”的部分。 尝试此操作,可能会提示您挂断的根本原因。

作为一种解决方法,如果您仍然希望在“〜/ .ssh / config”中使用Host * ... ControlMaster auto ,我可以执行以下操作:

# Docker: docker-machine (at least for virtualbox) breaks if ControlMaster
# is used. See:
#     https://github.com/docker/machine/issues/1591#issuecomment-126169020
# This block needs to be before any global "Host *" using ControlMaster.
Host localhost
    ControlMaster no

Host *
    ControlMaster auto
    ControlPath ~/.ssh/socket-%r@%h:%p
    ControlPersist yes

# ...

最新的RC应该在SSH配置中设置的ControlMaster选项下可以正常工作

码头机械-v
docker机器版本0.4.1(e2c88d6)

我也有同样的问题
解决方法是在每个docker-machine命令中添加--native-ssh

我在MacOS 10.11.1上也有此问题。
使用--native-ssh确实有帮助。

我损坏了〜/ .ssh / config。 纠正问题后,便可以像以前一样创建机器。 一种检查方法是尝试ssh到其他服务器,并查看它是否可以确保docker-machine不会由于ssh而失败。

同样的问题,没有任何效果。
对我来说,唯一的解决方法是为每台计算机添加--native-ssh。

我的环境详细信息:
作业系统:OS X El Capitan版本10.11
docker-machine版本0.5.0(04cfa58)
VBoxManage-版本
5.0.8r103449

@tehmaspc https://github.com/docker/machine/issues/1591#issuecomment -126169020对我有用,@ trentm建议了一些解决方法。

在对Docker安装进行少量升级之后,我今天在Windows 10上遇到了这个问题。 我尝试了所有操作-删除了.docker ,重建了VBox虚拟机,摆弄了我的环境vars,对config.json入侵……最后,我卸载了所有内容(包括virtualbox)并重新安装了它们。 可行!

我似乎在升级过程中或某些情况下,VBox网络一定存在问题。 就像使用了预期的IP地址一样,此后一切都炸毁了。

我遇到过同样的问题。 显然我之前安装过OpenSSH,并且在创建导致ControlMaster错误的docker映像时正在使用它。 我卸载了它,将Git \ bin添加到路径中,它就像一个魅力一样工作。

我遇到了同样的问题,并且此页面上建议的解决方法没有任何效果。 有任何想法吗?

这是我的环境:

Docker 1.10.3版,内部版本20f81dd
docker-machine版本0.6.0,内部版本e27fb87
5.0.16r105871
产品名称:Mac OS X
产品版本:10.11.4
内部版本号:15E65

当我发出此命令时:

docker-machine --debug创建-d virtualbox默认

...它总是最终挂在此错误上,该错误反复打印到终端上,直到我手动中断它为止:

(默认)DBG | 进入WaitForSSH功能...
(默认)DBG | 使用SSH客户端类型:外部
(默认)DBG | {[-o BatchMode =是-o PasswordAuthentication =否-o StrictHostKeyChecking =否-o UserKnownHostsFile = / dev / null -o LogLevel = quiet -o ConnectionAttempts = 3 -o ConnectTimeout = 10 -o ControlMaster = no -o ControlPath = none [email protected] -o IdentitiesOnly =是-i /Users/cbenson/.docker/machine/machines/default/id_rsa -p 53332] / usr / local / bin / ssh}
(默认)DBG | 即将运行SSH命令:
(默认)DBG | 出口0
(默认)DBG | SSH cmd err,输出:退出状态255:
(默认)DBG | 收到ssh命令'exit 0'时出错:运行SSH命令时出了点问题!
(默认)DBG | 命令:退出0
(默认)DBG | 错误:退出状态255
(默认)DBG | 输出:

@nathanleclaire你能看看我上面的评论吗? 我在Mac El Cap上,并且我正在使用的所有内容(Docker,Docker Machine,VirtualBox,OS更新)都是最新版本。 在此问题页面或相关问题页面上,我认为没有任何潜在的解决方法可以起作用。 我认为这与我的配置有关,因为它会影响我拥有的两台配置相似的Mac。 我将Homebrew用于最新的Docker,Docker Machine,OpenSSH和OpenSSL。 我已经通过自己的二进制文件安装了VirtualBox,但是我以前也尝试过通过Homebrew(但目前还没有)安装它。 有任何想法吗? 谢谢!

我还没有EL Cap,所以无法分享我在该操作系统上的经验。

另一种选择是进入Docker for Mac beta版,该版本完全消除了Virtualbox的要求。 当然,它可能还有其他问题:)

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

@chrisbenson您的~/.ssh/config文件是什么样的?

docker-machine ssh default -vvv的输出是什么?

@nathanleclaire对不起,耽误您的回复。 我暂时放弃了,没有很快回来。 我会更加警惕,等待您的回复。

不是~/.ssh/config ,因为我实际上删除了我的,只是为了确保不是那样。 没有效果。

在我运行docker-machine --debug create -d virtualbox default ,这一次又一次地产生了前面提到的错误,然后我按Ctrl +C。

然后输入docker-machine ssh default -vvv ,并得到:

OpenSSH_7.2p2,OpenSSL 1.0.2g 2016年3月1日
debug1:读取配置数据/ usr / local / etc / ssh / ssh_config
debug2:解析“ 127.0.0.1”端口22
debug2:ssh_connect_direct:needpriv 0
debug1:连接到127.0.0.1 [127.0.0.1]端口22。
debug2:fd 3设置O_NONBLOCK
debug1:连接到地址127.0.0.1端口22:连接被拒绝
debug1:再试一次...
debug1:连接到127.0.0.1 [127.0.0.1]端口22。
debug2:fd 3设置O_NONBLOCK
debug1:连接到地址127.0.0.1端口22:连接被拒绝
debug1:再试一次...
debug1:连接到127.0.0.1 [127.0.0.1]端口22。
debug2:fd 3设置O_NONBLOCK
debug1:连接到地址127.0.0.1端口22:连接被拒绝
ssh:连接到主机127.0.0.1端口22:连接被拒绝
退出状态255

@chrisbenson只是为了确保, /usr/local/etc/ssh/ssh_config的内容是什么?

@nathanleclaire这是'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

嗯,好的,没事。 您是否可以尝试使用0.7.0版本,看看效果是否更好(它是全新的,因此您必须下载二进制文件,因为Toolbox尚未发行)

@nathanleclaire我尝试了0.7.0,但没什么区别。 得到完全相同的错误。 还有其他想法吗? 谢谢!

@chrisbenson --native-ssh对您有用吗,还是显示相同的问题?

@nathanleclaire内森(Nathan)也有同样的问题。

@chrisbenson您有哪种防火墙/ VPN /代理?

@nathanleclaire不,先生,没什么。 我正在开发运行El Capitan的现代,完全更新的MacBook Pro。 我使用Homebrew保持所有内容(Docker,Docker Machine,OpenSSL,OpenSSH)更新,除了我使用它们的下载二进制文件安装了VirtualBox。 我的设置没有什么特别之处,这就是为什么我很困惑。

@chrisbenson请尝试以下

  • 如果您使用发行页面上提供的Machine Binary,它有什么区别吗? 由于使用了Homebrew,极有可能发生cgo或本机Go问题。
  • 如果您在GUI中查看了暴露的VirtualBox端口(VM的网络设置中的转发端口22 ),可以手动通过SSH进入吗? (例如ssh [email protected] -p 34567 -密码为tcuser

    • 如果没有,像ping 127.0.0.1这样的东西是否起作用?

  • Mac系统防火墙是否已启用? (在设置IIRC中)
  • 请查看VirtualBox日志(嵌套在~/.docker/machine/machines/default/default )以查看是否有任何有趣的事情,例如错误。
  • 127.0.0.1是您的默认环回,对吗? 您的/etc/hosts文件是什么样的?

--native-ssh对我有用,但是每次我在OS X中启动新的终端会话时都会出现此问题。除了生产环境中的docker-machine问题之外,我什么都没有,我希望即将推出的Mac版Docker解决这些问题。

这是在Windows 7,最新的docker工具箱上发生的,当时我将PC放在晚上睡觉。 当我唤醒PC时,所有docker-machine命令都会超时,但是我可以docker-machine ssh $ node正常运行。 在节点内部,泊坞窗运行良好,前一天启动的容器仍在运行。

$ docker -v && docker-machine -v
Docker版本1.12.0,内部版本8eab29e
docker-machine.exe版本0.8.0,内部版本b85aac1

$ docker-machine env

$ docker-machine regenerate-certs [机器名称]

$ docker-machine ls
好!

三年后,在这里的WIN7x64上哇,这仍然发生了!!! 因此,是不是时候不能解决这个问题,或者只是因为无法发布简单的第一个默认create命令而只是称产品损坏了?

(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

不幸的是,我有同样的问题。 看来我阅读了google中的所有链接,但没有任何方法可以解决问题。 请帮忙!

在VPS内创建诸如DigitalOcean Droplet之类的机器是否正确? 我在这样的服务器上有问题:

# 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

我尝试创建ssh配置:

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

使用--native-ssh没有解决问题。

@tenorok您不能在大多数云提供商中嵌套虚拟化,这就是在DO上创建VirtualBox计算机的尝试。

使用cmd和本机ssh(Windows oponssl)时,我尝试过工具箱并遇到相同的问题
并通过从git / usr / bin / ssh修改ssh解决了此问题。

image

在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
此页面是否有帮助?
0 / 5 - 0 等级