gpt4 book ai didi

virtualbox - 为什么 Vagrant 尝试通过 SSH 连接到 Windows guest ?

转载 作者:行者123 更新时间:2023-12-03 22:16:54 26 4
gpt4 key购买 nike

我的主机运行的是 Windows 7 Pro(64 位)。在这种情况下, guest 操作系统是 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 无法与内部的 guest 机器通信
配置的(“config.vm.boot_timeout”值)时间段。
如果你看上面,你应该能够看到错误
Vagrant 在尝试连接到机器时有过。这些错误
通常是关于可能出错的很好的提示。
如果您使用的是自定义框,请确保网络连接正确
工作,您可以连接到机器。这是一个常见的
在这些框中未正确设置网络的问题。
验证身份验证配置是否也已正确设置,
以及。
如果该框似乎正常启动,您可能需要增加
超时(“config.vm.boot_timeout”)值。


VM 实际上运行良好,可访问且可用。
  • 为什么它甚至试图通过 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

    最佳答案

    你需要使用

       config.vm.communicator = "winrm"

    在你的 Vagrant 文件中。 Take a look at this feature preview

    关于virtualbox - 为什么 Vagrant 尝试通过 SSH 连接到 Windows guest ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23574387/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com