【问题标题】:Vagrant 'remote connection disconnect' while booting引导时 Vagrant '远程连接断开'
【发布时间】:2014-09-22 19:01:12
【问题描述】:

每当我尝试使用vagrant up 在git bash 中启动Windows 7 x64 笔记本电脑上的Vagrant 时,我都会收到一长串Warning: Remote connection disconnect. Retrying... 消息。有时这会导致失败并显示几条不同的消息(未安装来宾 VM 工具或超时),但有时,在 10 或 15 条消息之后,它会成功启动,我可以通过 SSH 连接到它。

一张图片来说明:

以及vagrant up 命令的完整输出:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ianwalter/ubuntu-node-nginx' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 9966 => 9966 (adapter 1)
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...

等等。这是通常的行为吗?有什么办法可以解决吗?我正在使用 VirtualBox 4.3.12 运行 Vagrant 1.6.2。

编辑:根据 BrianC 的建议,我启动了一个 GUI 会话,以查看当连接被拒绝时虚拟机在做什么。这是它的样子:

【问题讨论】:

  • 我会尝试启用 GUI 模式,看看这是否指向您的启动问题。详情见我的回答:stackoverflow.com/questions/23690124/vagrant-up-timeout/…
  • @BrianC 谢谢!我会试一试...
  • @BrianC 我在我的问题中添加了一张图片。在vesafb: module verification failed 及其错误消息之后,机器似乎停止了。
  • Vagrantfile 中设置了哪些网络选项?此外,如果您查看 VirtualBox 输出,哪个命令正在停止?我看到 cloud-init-nonet 会等待 10 秒,然后等待 120 秒等待网络设备。
  • @joemaller 只是一个端口转发,没有别的。该 VirtualBox 屏幕截图显示了输出停止的位置。

标签: windows vagrant


【解决方案1】:

我现在已经通过将基本框从ianwalter/ubuntu-node-nginx 更改为ubuntu/trusty64 并手动安装节点/NPM from the package manager 解决了这个问题。它似乎没有给我同样的麻烦,所以我推测另一张图像中的某些东西导致了失速。

【讨论】:

    【解决方案2】:

    我也遇到了与 vagrant 类似的问题,但在我的情况下,即使 vagrant 启动了,我也无法 SSH。

    我正在使用以下配置。

    • windows 10 64 位

    • 虚拟盒子5.0.20

    • HP ab032tx 笔记本电脑
    • 在 BIOS 设置中启用虚拟化

    以下是我的项目文件夹中的 vagrant 文件设置。

    # -*- mode: ruby -*-
    # vi: set ft=ruby :
    

    Vagrant.configure("2") 做 |config|

    config.vm.box = "scotch/box"
    config.vm.network "private_network", ip: "192.168.33.10"
    config.vm.hostname = "scotchbox"
    config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
    config.vm.boot_timeout = 1000    
    
    # Optional NFS. Make sure to remove other synced_folder line too
    #config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] }
    

    结束

    每次我运行vagrant up 命令时都会出现以下错误。

    default: Warning: Remote connection disconnect. Retrying.. 
    

    解决方案为了解决这个问题,我运行以下命令(vagrant destroy)

    vagrant destroy
        default: Are you sure you want to destroy the 'default' VM? [y/N] y
    ==> default: Forcing shutdown of VM...
    ==> default: Destroying VM and associated drives...
    

    运行此命令后,我再次运行 vagrant up,一切都开始工作了。 在此之前,当我运行 vagrang ssh 时,我得到了以下输出。

     vagrant ssh-config
    Host default
      HostName 127.0.0.1
      User vagrant
      Port 2222
      UserKnownHostsFile /dev/null
      StrictHostKeyChecking no
      PasswordAuthentication no
      IdentityFile "C:/Users/muk_t/.vagrant.d/insecure_private_key"
      IdentitiesOnly yes
      LogLevel FATAL
    

    注意:使用的 linux 版本是 64 位。

    【讨论】:

      猜你喜欢
      • 2015-03-24
      • 2020-11-12
      • 2018-10-24
      • 2014-11-21
      • 1970-01-01
      • 2015-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多