为什么Vagrant尝试SSH到Windows客户端?

 Not-Only-For曾广超 发布于 2023-01-15 19:06

我的主机运行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

dfedde.. 17

你需要使用

   config.vm.communicator = "winrm"

在你的流浪文件中.看看这个功能预览

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有