Whenever I restarts Visual Studio Code, Remote - WSL extension gives me warning message

Viewed 1788
  1. I installed Visual Studio Code(Version 1.59.0)with Node.JS 14.16.0 on WSL2(updated from WSL1)

  2. Every time I start Visual Studio Code, Remote - WSL(Extension) gives warning "You're currently using WSL 1. We strongly recommend upgrading to WSL 2 for improved performance."

  3. The read more button simply redirect me to Microsoft's Comparing WSL 1 and WSL 2 page. "https://docs.microsoft.com/en-us/windows/wsl/compare-versions"

  4. But I already upgrade WSL to WSL2(kernel 5.10.16)

  5. I also ran "wsl --set-default-version 2" from Windows PowerShell and it worked.

  6. Tried uninstall and reinstall Remote - WSL extension of Visual Studio Code but failed.

What is wrong with this?

3 Answers

Feel damned to answer to my own question.

The issue here is the WSL2 update. MS's description on WSL2 upgrade really sucks and looks to complicate for users to comprehend with too much screen captures and fuzzy instructions.

To properly update from WSL to WSL 2 in Windows 10,

  1. Open PowerShell as Administrator(If you don't have Windows PowerShell, install it first.)

  2. To install WSL, run this command: dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart.

  3. Enable the Virtual Machine Platform optional feature by running the following command: dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

  4. Restart Windows 10.

  5. Download the latest Linux kernel update package and install it: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

  6. Run the command "wsl --set-version <distro_name> 2" e.g. Ubuntu: "wsl --set-version Ubuntu 2" If you have many files and directories made with wsl version 1 it may takes more than few minutes.

  7. Open PowerShell as Administrator and run: "wsl --set-default-version 2" to set WSL 2 as your default version.

  8. Go check wether WSL is updated to WSL2 or not by typing "wsl -l -v"

  9. If the command "wsl -l -v" shows followings, wsl 2 updated is successfully completed.
    NAME STATE VERSION * Ubuntu Running 2

Open the powershell and run the command:

wsl --set-version <your distro name here> 2

The prompt return you a message like "converting this task may be leave minutes".

Then open your VSCode on your WSL.

you need to set the version for your specific distro. In PowerShell run

wsl --set-version 2 <

Related