4

I have both Ubuntu and Debian installed for WSL. When I open a WSL workspace using VS Code remote development, it always opens Ubuntu. How can I open a workspace under the Debian install using WSL in VS Code?

Matt Bierner
  • 58,117
  • 21
  • 175
  • 206
  • you can check out this [https://stackoverflow.com/questions/75929012/vscode-not-opening-in-wsl-from-wsl-terminal/76514219#76514219](https://stackoverflow.com/questions/75929012/vscode-not-opening-in-wsl-from-wsl-terminal/76514219#76514219) – Ejeh Jun 20 '23 at 11:27

2 Answers2

10

The VS Code Remote - WSL extension always uses the default WSL distro. You can change the default distro using the wsl command (wslconfig on earlier windows versions):

# List the available distributions
wsl --list

Listing distributions with the wsl --list command

# Set the default version to debian
wsl --setdefault debian

Switch the default distro with the wsl --setDefault command

After changing the default for WSL, make sure to restart VS Code

Matt Bierner
  • 58,117
  • 21
  • 175
  • 206
4

Click the "remote button" in the bottom left

remote button screenshot

Choose New Window using Distro...

new windows using distro screenshot

Pick your distro!

pick distro screenshot

spottedmahn
  • 14,823
  • 13
  • 108
  • 178