Some Windows applications can reserve TCP or UDP ports which may cause some other applications fail to run. These threads provide solutions to this problem,
- Reserving ports in the Windows 10 Dynamic Port Range on Superuser.com
- Solution for common Docker not starting problem after latest update
- Cannot bind to some ports due to permission denied on StackOverflow.com
The solution are generally three.
- Removing/disabling the offending application or Windows feature. For instance, the threads point out Hyper-V is often the culprit because it reserves ports dynamically and unpredictably. We can disable it if we aren't using it,
In PowerShell, do this to remove all Hyper-V adapters,REM disable Hyper-V dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
Get-HNSNetwork | Remove-HNSNetwork
-
Reset dynamic port range from which the offending application reserves ports. For instance, for Hyper-V, for instance, we can do this,
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V netsh int ipv4 add excludedportrange protocol=tcp startport=50051 numberofports=1 dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
-
Disable dynamic port allocation, i.e.,
reg add HKLM\SYSTEM\CurrentControlSet\Services\hns\State /v EnableExcludedPortRange /d 0 /f
No comments:
Post a Comment