【发布时间】:2014-06-27 18:29:42
【问题描述】:
我的主机运行的是 Windows 7 Pro(64 位)。在这种情况下,来宾操作系统是 Windows Server 2008 R2。 “vagrant up”命令遇到了我不断遇到的问题:
****default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: password
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...****
直到它最终超时并说:
等待机器启动时超时。这意味着 Vagrant 无法与内部的来宾机器通信 配置的(“config.vm.boot_timeout”值)时间段。 如果你看上面,你应该能够看到错误 Vagrant 在尝试连接到机器时出现过。这些错误 通常可以很好地提示可能出现的问题。 如果您使用的是自定义框,请确保网络正确 工作,您可以连接到机器。这是一个常见的 在这些框中未正确设置网络的问题。 验证身份验证配置是否也设置正确, 也是。 如果该框似乎可以正常启动,您可能需要增加 超时(“config.vm.boot_timeout”)值。
虚拟机实际上运行良好,可访问且可用。
- 为什么还要尝试通过 SSH 连接到 Windows 机器?
我的 Vagrantfile 内容是:
Vagrant.configure("2") do |config|
# Max time to wait for the guest to shutdown
config.windows.halt_timeout = 60
# Admin user name and password
config.winrm.username = "Administrator"
config.winrm.password = "Password"
# Configure base box parameters
config.vm.box = "BaseBox"
config.vm.box_url = "./Base.box"
config.vm.guest = :windows
config.vm.provider "virtualbox" do |v|
v.gui = true
end
# Port forward WinRM and RDP (changed values to NOT conflict with host)
config.vm.network :forwarded_port, guest: 3389, host: 3391
config.vm.network :forwarded_port, guest: 5985, host: 5987, id: "winrm", auto_correct: true
end
【问题讨论】:
-
你安装了 vagrant-windows 吗?
gem install vagrant-windows -
我应该在原始帖子中添加此内容,但我忘记了。我使用站点上的 Windows 二进制文件安装了 Vagrant 1.6.1。我还在我的 Windows 7 机器上运行了 4.3.10r93012 版本的 Virtual Box。
标签: virtualbox vagrant vagrantfile