我正在使用 Windows Server 2016 创建一个基本映像。该映像已完全修补并应用了所有正常配置,但是当我对其进行测试时,它无法以 vagrant 用户身份连接,并带有一条来自 Google 搜索的消息,暗示它正在尝试使用 SSH,尽管对话框中列出了 WinRM。
我已将构建文档放在github中以供参考。
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'WindowsDocker'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: temp_default_1489982222856_48671
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 5985 (guest) => 55985 (host) (adapter 1)
default: 5986 (guest) => 55986 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: WinRM address: 127.0.0.1:55985
default: WinRM username: vagrant
default: WinRM execution_time_limit: PT2H
default: WinRM transport: negotiate
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
default: Warning: Authentication failure. Retrying...
注意:一旦盒子启动,我可以手动连接到使用 WinRM 吗?
$securePassword = ConvertTo-SecureString 'vagrant' -asplaintext -force
$cred = New-Object System.Management.Automation.PSCredential ('vagrant', $securePassword)
enter-pssession 127.0.0.1 -port 55985 -Auth CredSSP -credential $cred
[127.0.0.1]: PS C:\Users\vagrant\Documents> exit
平台详情
- 主机是 Windows 10
- 流浪者版本是 1.9.2
- 甲骨文虚拟机 5.1.18
- 来宾是 Windows Server 2016 标准评估
注意:在 Vagrant 1.9.1 中,来宾被摧毁了...
default: WinRM transport: negotiate
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
C:/HashiCorp/Vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:57:in `raise_if_auth_error': WinRM::WinRMAuthorizationError (WinRM::WinRMAuthorizationError)
所以事实证明我没有禁用用户帐户控制 (UAC),我已将以下内容添加到我的工作表中。