IMPORTANT: Windows support in Drydock requires the use of third-party patches. It is **not** supported by upstream.
If you are interested in upstream support for Windows in Drydock, then go put a token 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 WinRM ==
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.
You can configure WinRM fully from an Administrator PowerShell prompt with:
```lang=powershell
Enable-PSRemoting -Force
winrm set winrm/config/service/Auth '@{Basic="true"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
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"}'
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-Service winrm
```