skip to Main Content

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

1

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


  1. 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.

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
  3. I got the same.

    If your project is on another drive mount it and
    run vscode as administrator.

    Login or Signup to reply.
  4. 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.

    Login or Signup to reply.
  5. I had this issue and needed to run..

    $ code
    Updating VS Code Server to version  97dec172d3256f8ca4bfb2143f3f76b503ca0534
    Removing previous installation...
    Installing VS Code Server for x64 (97dec172d3256f8ca4bfb2143f3f76b503ca0534)
    Downloading: 100%
    Unpacking: 100%
    Unpacked 2389 files and folders to /home/dmitri/.vscode-server/bin/97dec172d3256f8ca4bfb2143f3f76b503ca0534.
    

    in WSL2 to update the WSL2 server. Then uninstalling and reinstalling the WSL extension from VSCode did the trick.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search