Strange vscode issue in WSL

Viewed 194

I've been trying to set up the vscode code . shortcut to work in WSL. Following the instructions from the vscode website, I reinstalled vscode in windows, reinstalled the Remote-Wsl extension, made sure it was in my System Path, and tried running code . in the WSL linux distro terminal. I get the message instructing me to install it on the windows side, and asking me if I want to continue. I hit yes, but it doesn't create the code server folder in my home directory. Typing code . again does the same thing.

Does anyone know why this may be?

This is the output text:

To use Visual Studio Code with the Windows Subsystem for Linux, please install Visual Studio Code in Windows and uninstall the Linux version in WSL. You can then use the code command in a WSL terminal just as you would in a normal command prompt.

Do you want to continue anyway? [y/N]

1 Answers

The error message isn't just pointing out that you need to install the Windows version, but it indicates that you have the Linux version installed in WSL and should remove it.

From that, it sounds like at some point you may have installed the Linux version of VSCode in WSL, and that one is taking priority. You'll need to uninstall it in order to run the Windows version of VSCode with the "Remote - WSL" extension.

You don't mention what distribution you are running, but if it is Ubuntu, try:

sudo apt remove code # or
sudo apt remove code-insiders

Also see the uninstall doc from Microsoft.

Related