我正在使用Windows Server 2016创build基本映像。映像已完全打上补丁,并且已应用所有常规configuration,但是当我testing它时,无法连接作为stream浪用户,并显示来自Googlesearch的消息它试图使用SSH,虽然WinRM列在对话框中。
我已经把我的构build文档在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
平台的细节
注意:在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)
所以事实certificate,我不是diabling用户帐户控制(UAC),我已经将以下内容添加到我的工作表。
reg add HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /d 0 /t REG_DWORD /f /reg:64