Reputation: 171
I'm running Windows 10 with WSL2. I'm using VSCode with the Remote - WSL extension to open the files from my wsl file system.
When I boot my Windows laptop, and open VSCode I get the following error:
When I perform a wsl.exe --shutdown
in PowerShell, and restart Docker Desktop, Everything works fine. But I have to do this after every laptop restart.
Remote WSL extension version: v0.51.4 Visual Studio Code version: v1.51.1 Windows version: 10.0.19041 Build 19041
Someone any idea?
Upvotes: 4
Views: 3932
Reputation: 11
I have had this problem several times, and I have found that on Windows 10 20H2 one of the two options described below solves the problem.
Network reset This option can make you lose your network configuration, so use it with discretion and read every warning. You can perform this task by going to Settings > Network & Internet > Status. There you need to click on the option "Network reset" after that, you can start the network reset by clicking on "Reset now" Picture of Windows 10 20H2 status section. Then you will need to wait some minutes until your PC is restarted automatically and try to execute Visual Studio Code under WSL2 again.
Reset Windows This option is dangerous as it will remove either all your files and programs or all your installed programs. You select what you want to remove before starting the reset process. This option can be performed by going to Settings > Update & Security > Recovery. Then you have to click on the button "Get started" on the section "Reset this PC" and follow the instructions provided by the reset tool Picture of Windows 10 20H2 recovery section. After your Windows is reset, you will have to configure your WSL again because all your WSL files will be lost when executing this operation.
Upvotes: 0