MicrosoftDocs / WSL

Source code behind the Windows Subsystem for Linux documentation.
https://docs.microsoft.com/windows/wsl
Other
1.92k stars 579 forks source link

PortTrackerEnabledMode shouldn't be deleted apparently #2050

Open makotom opened 1 month ago

makotom commented 1 month ago

Type of issue

Code doesn't work

Feedback

The section of "Troubleshooting Network Access Issues on Windows" suggests to delete the registry key HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\PortTrackerEnabledMode. However, at least on my environment, removal of this key hampered TCP ports that were opened inside WSL2 mirrored network mode to be reflected to the NT layer.

For instance, after removing the PortTrackerEnabledMode key, a development HTTP server inside my WSL environment (say, python -m http.server 8000) became inaccessible from the MSEdge running natively on Windows. It recovered and became accessible again only after running reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v PortTrackerEnabledMode /t REG_DWORD /d 0x2 and restarting the entire system.

As the matter of fact, removal of the registry key can break networking of WSL. The removal of the key might help reset FSE somehow (as documented - but we outsiders have almost zero clue on whether that's true), but the documentation definitely lacks a reminder that there're certain cases where PortTrackerEnabledMode needs to be restored with a value of 0x2.

Page URL

https://learn.microsoft.com/en-us/windows/wsl/troubleshooting

Content source URL

https://github.com/MicrosoftDocs/wsl/blob/main/WSL/troubleshooting.md

Author

@mattwojo

Document Id

91d93e7d-8206-77bf-ace0-f8c44810bf17

Klutton commented 1 week ago

I did what the document said and can't connect to my system proxy. With your help I finally fixed this problem.

And I still have a question, what should it normally be when I use command sc queryex FSE ? Nothing printed(same using administered powershell).

I tried to change registry key because the connection to the Docker service is intermittent(This happens when I try to apply a wordpress container and test it using yakit). Sometimes the tool returns a 502 while connection through a browser is 200.