IMPORTANT: Windows support in Drydock requires the use of third-party patches. It is **not** supported by upstream.
NOTE: If you are interested in upstream support for Windows in Drydock, then go leave a comment on T10203.
== Compile and install WinRM for Linux ==
Compile and build the `winrm` tool for Linux from https://github.com/masterzen/winrm. You will need to install Go and then place `winrm` somewhere in Phabricator's `PATH`.
== Patch Phabricator ==
There is a patched version of Phabricator that has support for Windows support in Drydock here: https://github.com/hach-que/phabricator. This is continuously rebased on the latest version of upstream Phabricator, so it is constantly kept up to date with the latest features.
== Enable and Configure WinRMInstall OpenSSH for Windows ==
Windows has some pretty silly defaults for WinRM, including very low quota limits on remote shells. These limits interfere with processes like running remote builds, because they restrict the amount of RAM and other resources that the builds have access to.Use the following Chocolatey package to install OpenSSH for Windows: https://chocolatey.org/packages/win32-openssh
You can configure WinRM fully from an Administrator PowerShell prompt with:Once you've installed Chocolatey, running the following command will install what you need:
```lang=powershell
Enable-PSRemoting -Force
winrm set winrm/config/service/Auth '@{Basic="true"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service '@{MaxConcurrentOperations="4294967295"}'
winrm set winrm/config/service '@{MaxConcurrentOperationsPerUser="4294967294"}'
winrm set winrm/config/service '@{EnumerationTimeoutms="4294967294"}'
winrm set winrm/config/service '@{MaxConnections="4294967294"}'
winrm set winrm/config/service '@{MaxPacketRetrievalTimeSeconds="4294967294"}'
winrm set winrm/config/client '@{NetworkDelayms="4294967294"}'
winrm set winrm/config/winrs '@{IdleTimeout="999999999"}'
winrm set winrm/config/winrs '@{MaxConcurrentUsers="100"}'
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="999999999"}'
winrm set winrm/config/winrs '@{MaxProcessesPerShell="999999999"}'
winrm set winrm/config/winrs '@{MaxShellsPerUser="999999999"}'
winrm set winrm/config '@{MaxTimeoutms="4294967294"}'
winrm set winrm/config '@{MaxEnvelopeSizekb="4294967294"}'
winrm set winrm/config '@{MaxBatchItems="4294967294"}'
Set-Item WSMan:\localhost\Plugin\microsoft.powershell\Quotas\MaxIdleTimeoutms 2147483647
Set-Item WSMan:\localhost\Plugin\microsoft.powershell\Quotas\MaxConcurrentUsers 100
Set-Item WSMan:\localhost\Plugin\microsoft.powershell\Quotas\IdleTimeoutms 999999999
Set-Item WSMan:\localhost\Plugin\microsoft.powershell\Quotas\MaxProcessesPerShell 999999999
Set-Item WSMan:\localhost\Plugin\microsoft.powershell\Quotas\MaxMemoryPerShellMB 999999999
Set-Item WSMan:\localhost\Plugin\microsoft.powershell\Quotas\MaxConcurrentCommandsPerShell 999999999
Set-Item WSMan:\localhost\Plugin\microsoft.powershell\Quotas\MaxShells 999999999
Set-Item WSMan:\localhost\Plugin\microsoft.powershell\Quotas\MaxShellsPerUser 999999999
Set-Item WSMan:\localhost\Plugin\microsoft.powershell32\Quotas\MaxIdleTimeoutms 2147483647
Set-Item WSMan:\localhost\Plugin\microsoft.powershell32\Quotas\MaxConcurrentUsers 100
Set-Item WSMan:\localhost\Plugin\microsoft.powershell32\Quotas\IdleTimeoutms 999999999
Set-Item WSMan:\localhost\Plugin\microsoft.powershell32\Quotas\MaxProcessesPerShell 999999999
Set-Item WSMan:\localhost\Plugin\microsoft.powershell32\Quotas\MaxMemoryPerShellMB 999999999
Set-Item WSMan:\localhost\Plugin\microsoft.powershell32\Quotas\MaxConcurrentCommandsPerShell 999999999
Set-Item WSMan:\localhost\Plugin\microsoft.powershell32\Quotas\MaxShells 999999999
Set-Item WSMan:\localhost\Plugin\microsoft.powershell32\Quotas\MaxShellsPerUser 999999999
Restart-choco install -y win32-openssh -version 2016.04.05 -params '"/SSHService winrmerFeature /KeyBasedAuthenticationFeature"'
```
== Configure authorized_keys ==
You need to configure `authorized_keys` on the Windows agent by creating a `.ssh` folder under `C:\Users\<username>`. In this folder create `authorized_keys` and paste the OpenSSH public key that you obtained from Passphrase when creating the Credential.
== Patch Phabricator ==
NOTE: This is WIP while I prepare some more up-to-date patches.