• 请不要在回答技术问题时复制粘贴 AI 生成的内容
xcai
V2EX  ›  程序员

Windows vagrant up 一直 ssh 不了

  •  
  •   xcai · Jun 18, 2017 · 4953 views
    This topic created in 3257 days ago, the information mentioned may be changed or developed.

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

    Supplement 1  ·  Jun 19, 2017
    我晕,用官方的 box 就没问题,自己做的在两部 MAC 都行,在 WIN 就不行
    17 replies    2017-06-19 17:34:57 +08:00
    xcai
        1
    xcai  
    OP
       Jun 18, 2017
    这排版。。。罪过,罪过。
    orderc
        2
    orderc  
       Jun 18, 2017 via iPhone
    看下是不是网络配置有问题
    run2
        3
    run2  
       Jun 19, 2017
    ping 下 client 的 ip 呢? 同感觉是网络问题,会不会 client 的 ip 被占用了
    fork3rt
        4
    fork3rt  
       Jun 19, 2017 via iPhone
    遇到过,你可以更换下 virtualbox 试试,貌似之前用了 5.1.x 那个版本就解决了。
    zhs227
        5
    zhs227  
       Jun 19, 2017
    打开 virtualbox 找到对应的虚拟机,直接登进去看看。vagrant ssh 实际上也是一套类似的机制,在 windows 上可能并不是特别完善,直接用 putty 填上对应的端口往上登。vagrant 证书不好用的话就自己导一个。
    gulucn
        6
    gulucn  
       Jun 19, 2017
    先去”网络与共享中心“看一下有没有 VirtualBox Host-Only Ethernet Adapter 这个虚拟网卡?
    xcai
        7
    xcai  
    OP
       Jun 19, 2017 via Android
    @orderc
    @gulucn
    @sobigfish
    用 xshell 可以通过密钥登录,但是在 vagrant up 就不行了。这样就不能配置一些东西了。
    kaneg
        8
    kaneg  
       Jun 19, 2017 via iPhone
    windows 上你用的是什么 ssh 客户端? vagrant ssh 会调用 ssh。建议在 Cygwin 下使用。或者自己用 ssh 客户端登录
    xcai
        9
    xcai  
    OP
       Jun 19, 2017
    @kaneg git
    xcai
        10
    xcai  
    OP
       Jun 19, 2017 via Android
    在 windows 上通过 netstat 能看到 127.0.0.1:2222
    xcai
        11
    xcai  
    OP
       Jun 19, 2017 via Android
    并且通过 xshell 使用证书能登录,唯独在 vagrant up ssh 超时
    ranwu
        12
    ranwu  
       Jun 19, 2017
    vagrant box 是从官方导入的吗
    xcai
        13
    xcai  
    OP
       Jun 19, 2017
    @ranwu 自己做的。导入的也是官方的公玥
    ranwu
        14
    ranwu  
       Jun 19, 2017
    @xcai 用 vagrant ssh 能连上虚拟机吗
    ranwu
        15
    ranwu  
       Jun 19, 2017
    试试这个:

    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  
       Jun 19, 2017
    还有这个:
    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
       Jun 19, 2017
    @ranwu 都不行。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4912 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 54ms · UTC 03:57 · PVG 11:57 · LAX 20:57 · JFK 23:57
    ♥ Do have faith in what you're doing.