Windows vagrant up 一直 ssh 不了

2017-06-18 21:51:56 +08:00
 xcai

default: SSH auth method: private key default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying...

通过 vagrant ssh-config 检查了密钥没问题,box 里的公钥也没问题。 平台 windows10 virtualbox 最新版本,vagrant 最新版本,在 macos 没任何问题,在 windows 就瘫痪了,搞了一天,血都快吐完了,各位大佬有遇到过吗?

4250 次点击
所在节点    程序员
17 条回复
xcai
2017-06-18 21:52:21 +08:00
这排版。。。罪过,罪过。
orderc
2017-06-18 23:10:25 +08:00
看下是不是网络配置有问题
sobigfish
2017-06-19 00:10:35 +08:00
ping 下 client 的 ip 呢? 同感觉是网络问题,会不会 client 的 ip 被占用了
fork3rt
2017-06-19 00:12:17 +08:00
遇到过,你可以更换下 virtualbox 试试,貌似之前用了 5.1.x 那个版本就解决了。
zhs227
2017-06-19 00:19:39 +08:00
打开 virtualbox 找到对应的虚拟机,直接登进去看看。vagrant ssh 实际上也是一套类似的机制,在 windows 上可能并不是特别完善,直接用 putty 填上对应的端口往上登。vagrant 证书不好用的话就自己导一个。
gulucn
2017-06-19 00:22:35 +08:00
先去”网络与共享中心“看一下有没有 VirtualBox Host-Only Ethernet Adapter 这个虚拟网卡?
xcai
2017-06-19 07:12:00 +08:00
@orderc
@gulucn
@sobigfish
用 xshell 可以通过密钥登录,但是在 vagrant up 就不行了。这样就不能配置一些东西了。
kaneg
2017-06-19 08:06:39 +08:00
windows 上你用的是什么 ssh 客户端? vagrant ssh 会调用 ssh。建议在 Cygwin 下使用。或者自己用 ssh 客户端登录
xcai
2017-06-19 08:50:35 +08:00
@kaneg git
xcai
2017-06-19 09:08:39 +08:00
在 windows 上通过 netstat 能看到 127.0.0.1:2222
xcai
2017-06-19 09:15:57 +08:00
并且通过 xshell 使用证书能登录,唯独在 vagrant up ssh 超时
ranwu
2017-06-19 12:31:21 +08:00
vagrant box 是从官方导入的吗
xcai
2017-06-19 12:47:20 +08:00
@ranwu 自己做的。导入的也是官方的公玥
ranwu
2017-06-19 13:23:54 +08:00
@xcai 用 vagrant ssh 能连上虚拟机吗
ranwu
2017-06-19 13:26:30 +08:00
试试这个:

Same issue with bento/ubuntu-16.04, solved the same way as @moog-stephen: VirtualBox -> Select virtual machine in question -> Settings -> Network -> Advanced and then make sure the "cable connected" box is checked.

来源: https://github.com/projectatomic/adb-atomic-developer-bundle/issues/264
ranwu
2017-06-19 13:31:02 +08:00
还有这个:
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

config.ssh.username = "vagrant"
config.ssh.password = "vagrant"

config.vm.provider "virtualbox" do |vb|
vb.gui = true
end
end

来源: https://stackoverflow.com/questions/22575261/vagrant-stuck-connection-timeout-retrying
xcai
2017-06-19 17:34:57 +08:00
@ranwu 都不行。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/369399

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX