V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
xcai
V2EX  ›  程序员

Windows vagrant up 一直 ssh 不了

  •  
  •   xcai · 2017-06-18 21:51:56 +08:00 · 4236 次点击
    这是一个创建于 2493 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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 就瘫痪了,搞了一天,血都快吐完了,各位大佬有遇到过吗?

    第 1 条附言  ·  2017-06-19 13:14:35 +08:00
    我晕,用官方的 box 就没问题,自己做的在两部 MAC 都行,在 WIN 就不行
    17 条回复    2017-06-19 17:34:57 +08:00
    xcai
        1
    xcai  
    OP
       2017-06-18 21:52:21 +08:00
    这排版。。。罪过,罪过。
    orderc
        2
    orderc  
       2017-06-18 23:10:25 +08:00 via iPhone
    看下是不是网络配置有问题
    sobigfish
        3
    sobigfish  
       2017-06-19 00:10:35 +08:00
    ping 下 client 的 ip 呢? 同感觉是网络问题,会不会 client 的 ip 被占用了
    fork3rt
        4
    fork3rt  
       2017-06-19 00:12:17 +08:00 via iPhone
    遇到过,你可以更换下 virtualbox 试试,貌似之前用了 5.1.x 那个版本就解决了。
    zhs227
        5
    zhs227  
       2017-06-19 00:19:39 +08:00
    打开 virtualbox 找到对应的虚拟机,直接登进去看看。vagrant ssh 实际上也是一套类似的机制,在 windows 上可能并不是特别完善,直接用 putty 填上对应的端口往上登。vagrant 证书不好用的话就自己导一个。
    gulucn
        6
    gulucn  
       2017-06-19 00:22:35 +08:00
    先去”网络与共享中心“看一下有没有 VirtualBox Host-Only Ethernet Adapter 这个虚拟网卡?
    xcai
        7
    xcai  
    OP
       2017-06-19 07:12:00 +08:00 via Android
    @orderc
    @gulucn
    @sobigfish
    用 xshell 可以通过密钥登录,但是在 vagrant up 就不行了。这样就不能配置一些东西了。
    kaneg
        8
    kaneg  
       2017-06-19 08:06:39 +08:00 via iPhone
    windows 上你用的是什么 ssh 客户端? vagrant ssh 会调用 ssh。建议在 Cygwin 下使用。或者自己用 ssh 客户端登录
    xcai
        9
    xcai  
    OP
       2017-06-19 08:50:35 +08:00
    @kaneg git
    xcai
        10
    xcai  
    OP
       2017-06-19 09:08:39 +08:00 via Android
    在 windows 上通过 netstat 能看到 127.0.0.1:2222
    xcai
        11
    xcai  
    OP
       2017-06-19 09:15:57 +08:00 via Android
    并且通过 xshell 使用证书能登录,唯独在 vagrant up ssh 超时
    ranwu
        12
    ranwu  
       2017-06-19 12:31:21 +08:00
    vagrant box 是从官方导入的吗
    xcai
        13
    xcai  
    OP
       2017-06-19 12:47:20 +08:00
    @ranwu 自己做的。导入的也是官方的公玥
    ranwu
        14
    ranwu  
       2017-06-19 13:23:54 +08:00
    @xcai 用 vagrant ssh 能连上虚拟机吗
    ranwu
        15
    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
        16
    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
        17
    xcai  
    OP
       2017-06-19 17:34:57 +08:00
    @ranwu 都不行。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3310 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 13:15 · PVG 21:15 · LAX 06:15 · JFK 09:15
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.