Hey stackoverflow community i have an issue with vscode connecting to wsl2 with the following error [picture bellow] message i already searched for hours and couldnt find a solution.
reinstalled both with a clean updated version without any success
Edit 1:Tried to unmount and remount folders also tried opening with high privilege’s from cmd ‘wsl code .’ moreover i completely deleted wsl and vscode with all the extensions but still am getting the same error, i was able to reproduce more readable error, when opening a project it prompts with
unable to resolve resource vscode-re…://%ubuntu-22.04/file_path
Edit 2: opening WSL, ‘New WSL window using distro’ works fine but i cant open any directory, without it producing the error in Edit 1
5
Answers
I am the same.
I also reinstalled VSCode and Docker, but nothing changed.
In the "Remote – Containers" tutorial, I was able to connect without any problems.
It doesn’t work with my code.
I got the same issue. I use Windows and I open the folder in vscode in this way:
shift+right-click the folder -> open linux shell -> type in "code ."
when vscode opens, the error does not exist.
I got the same.
If your project is on another drive mount it and
run vscode as administrator.
For me this was due to the secondary sidebar being visible.
After disabling it via
View -> Appearance -> Secondary Side Bar
, WSL2 starts up fine again.I had this issue and needed to run..
in WSL2 to update the WSL2 server. Then uninstalling and reinstalling the WSL extension from VSCode did the trick.