Windows
Windows
- Get rid of app which occupies given port
- Check app PID
netstat -ano | findstr ":<port>"
netstat -ano | findstr ":8080"
- Find what’s the app
tasklist /fi "pid eq <pid>"
tasklist /fi "pid eq 22216"
- Kill process
taskkill /PID <pid> /F
taskkill /PID 22216 /F
- Check app PID
- Other port commands
- To see current state of ports run:
netsh int ip show excludedportrange protocol=tcp
- To add port 4200 to exclusions, run:
netsh int ipv4 add excludedportrange protocol=tcp startport=3306 numberofports=1
- To see current state of ports run:
Workarounds for Docker-related problems
1
restart-service nhs
Run CMD/Powershell as Admin and run:
1
2
net stop winnat
net start winnat
However, this may make WSL2 unable to connect to the Web.
Solution from Web, not verified yet:
1
2
3
4
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns
Source: https://github.com/microsoft/WSL/issues/3438#issuecomment-410518578