chocolatey-community / chocolatey-test-environment

A testing setup related to how the Chocolatey Package Verifier runs testing. Used for manual testing or prior to submission
Apache License 2.0
117 stars 187 forks source link

The port chosen for WinRM is in reserved range #68

Closed Jackenmen closed 1 year ago

Jackenmen commented 1 year ago
PS C:\Users\Jakub> netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
      5357        5357
     50000       50059     *
     51940       52039
     52040       52139
     55954       56053
     56054       56153
     56154       56253
     56254       56353
     56354       56453
     56454       56553
     56654       56753
     56754       56853
     56854       56953
     56954       57053
     57054       57153
     57154       57253

* - Administered port exclusions.

This means that this port can't be bound at all which causes vagrant up due to timeout while trying to connect through WinRM as that never ends up getting bound.

In general, I would suggest choosing ports that are within user ports range (1024-49151) to avoid these kind of problems.

pauby commented 1 year ago

This WinRM port has been this as far back as I can remember. It's the default used by Vagrant and that's likely why it's used here.

The excluded port ranges are very system-specific. I would expect some crossover, though. My system (Windows 10 up to date) shows:

> netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
      5357        5357
      5985        5985
     47001       47001
     49152       49251
     49252       49351
     49352       49451
     49452       49551
     49552       49651
     50000       50059     *
     50060       50159
     50178       50277
     50278       50377
     50378       50477
     50478       50577
     50578       50677
     50978       51077
     51078       51177
     51178       51277
     51278       51377
     51378       51477
     51478       51577
     51623       51722
     51723       51822
     51823       51922
     51923       52022
     64626       64725
     64726       64825
     64827       64926
     64927       65026
     65030       65129
     65137       65236
     65340       65439

* - Administered port exclusions.

55985 is not in any excluded range.

In general, I would suggest choosing ports that are within user ports range (1024-49151) to avoid these kind of problems.

Ports in those ranges are generally classed as Registered Ports. There is nothing 'registered' for 55985, that I could find, but it does have a history of being commonly used for WinRM for Vagrant (and possibly others).

pauby commented 1 year ago

I'm going to go ahead and close this issue, but we can reopen it if necessary.