Skip to content

Instantly share code, notes, and snippets.

@sneal
Last active May 13, 2023 15:04
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save sneal/39d47401e9eaefcf8727 to your computer and use it in GitHub Desktop.
Save sneal/39d47401e9eaefcf8727 to your computer and use it in GitHub Desktop.
Configure WinRM for Vagrant
netsh advfirewall firewall set rule group="remote administration" new enable=yes
netsh advfirewall firewall add rule name="Open Port 5985" dir=in action=allow protocol=TCP localport=5985
winrm quickconfig -q
winrm quickconfig -transport:http
winrm set winrm/config '@{MaxTimeoutms="7200000"}'
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="0"}'
winrm set winrm/config/winrs '@{MaxProcessesPerShell="0"}'
winrm set winrm/config/winrs '@{MaxShellsPerUser="0"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
winrm set winrm/config/client/auth '@{Basic="true"}'
net stop winrm
sc.exe config winrm start= auto
net start winrm
@brunofin
Copy link

brunofin commented Mar 1, 2017

First line returned an error on Windows 7 but nonetheless WinRM is configured and working perfectly with Vagrant. Thanks mate :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment