Vagrant Windows 8.1 框超时 - 即使机器启动正确

Vagrant Windows 8.1 框超时 - 即使机器启动正确

我有一个简单的 vagrant master box,里面安装了 Windows、驱动程序和 VB 客户机插件。

我已将该机器添加为一个盒子,并尝试创建一个仅具有基本设置的简单 vagrant vm:

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

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "win"
  config.vm.communicator = "winrm"
end

当我执行 Vagrant up 时出现超时:

C:\Vagrant\win-dev> vagrant up Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'win'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: win-dev_default_1415127726713_75064
==> default: Fixed port collision for 5985 => 55985. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 5985 => 2200 (adapter 1)
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...

它在那里挂了几分钟,然后我收到错误:

Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

我正在观察预览窗口,我可以清楚地看到机器已正确启动并在桌面上等待用户输入,但 Vagrant 并未意识到这一点。

我确实搜索了很多,发现人们以前也遇到过类似的问题,但它们都与 ssh 访问有关。

编辑: 我也尝试过使用 vagrantbox.es 的 Windows8.1 盒子和 vagrantcloud 的随机盒子,遇到了同样的问题,所以我很确定这是一个配置问题。我也尝试过按照 Vagrantup 网站上最简单的指南操作,但遇到了同样的错误。还尝试过在其他主机上操作,但没成功。

答案1

Vagrant 中有一个错误,该错误已修复,但尚未发布,该错误导致 vagrant 快速失败并正确输出错误。

在此之前,请仔细检查您是否可以使用 vagrant 使用的用户名和密码登录到该框,默认情况下,用户名和密码都是“vagrant”。更改 Windows 密码是导致此问题的常见原因。还要仔细检查客户机上的 winrm 配置是否设置为允许通过 http 进行基本身份验证。

相关内容