Summary:
I have my firewall blocking the WSL server (Ubuntu 18.04) only when running on Visual Studio Code. It is also preventing my Hyper-V VM (Ubuntu 19.04) to establish almost every connection to internet, for example sudo apt update
or browsing (for some reason I can ping successfully though but I would't focus on this as of now).
Details:
After many trail and error efforts I have isolated and concluded that my firewall (Avast Premier) is the only culprit for this. Disabling the firewall for 10 mins allows me to do these two different operations, connect to WSL server from Visual Studio Code and also to navigate and update packages in my virtualized Ubuntu from Hyper-V.
What I have done so far:
I have checked that VSCode has all connections allowed in all ports (inbound and outbound):
Allowing rules seem to be in place:
And also added VSCode to the antivirus exceptions list:
None of the actions above worked, only disabling the firewall.
Question:
What rules should I add to the firewall for allowing:
- WSL server (Ubuntu 18.04.2) from VSCode
- Internet connection on Ubuntu 19.04 from Hyper-V.
Notes: WSL works perfectly outside VSCode. I can even start a batch terminal from it (the connection from the left of status bar is what is the issue).
UPDATE:
This is the output I get from WSL terminal in VSCode:
Failed to connect to the remote extension host server (Error: connect ETIMEDOUT 127.0.0.1:62388)
C:\Windows\System32\wsl.exe
to the exceptions list