Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code connect to WSL Ubuntu 20.04 LTS, fail with error: Could not fetch remote environment

A few days ago I was working just fine with VS Code connected to WSL Ubuntu 20.04, then I did some updating on WSL, Ubuntu 20.04 LTS and VS Code and now I can not connect to WSL 20.04, and I always got those two messages, even when no folder/workspace is selected/open.

Could not fetch remote environment

Failed to connect to the remote extension host server (Error: Connection error: Unauthorized client refused.)

When I try to open a folder it shows the folder structure but it always said that: The path does not exists. And does not show any file in it but I can follow the folder structure up and down just fine.

And on the other hand if I launch WSL with an older Ubuntu 18.04 distro, it works just fine.

I imagine there is some security setting or access list that is wrong, but I can not figure it out, and web searching has not help either.

Any idea what to do to get it working again ?.

like image 204
Luis Carlos Burgos Avatar asked Sep 29 '20 17:09

Luis Carlos Burgos


1 Answers

I had the same error. And solved it by just shutting down the wsl using command

wsl --shutdown

like image 68
Saurav Avatar answered Sep 27 '22 22:09

Saurav