1

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

1

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.

4
  • Thanks! I will give that a shot. I apologize for the image, I have not personally posted on stack overflow much. I am using Ubuntu 20.04, and I'm pretty sure I haven't installed vscode myself, but a setup script for a class maybe done that. Commented Mar 20, 2022 at 13:46
  • @randomzebra Cool - Let me know if that doesn't work, and we can dig deeper. Commented Mar 20, 2022 at 13:49
  • No, that was it. There was a script that I ran to set up an environment for a class that installed vscode for some reason. Commented Mar 24, 2022 at 7:10
  • @randomzebra Good to hear. Remember to accept the answer when you get a chance so that this gets closed out. I think you can upvote too, but it won't actually "take effect" until you hit 20 or 50 rep. Thanks! Commented Mar 24, 2022 at 12:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.