I installed Ubuntu App on Windows 10 and I would like to use it as a terminal in VS Code. I see VS Code automatically detecting options like Git Bash, PowerShell, Cmd.exe and gives options to use them as terminal. But I would like to use Ubuntu. Is it possible?
2 Answers
For specifically using Ubuntu distro you just have to type a simple command to change the default distro used by wsl to ubuntu.
Type wslconfig /setdefault Ubuntu
in cmd thats it.
Then in my pc vscode gave me option to choose which terminal i wanted to use so i selected wsl bash so it edited the user settings "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\bash.exe"
in Preferences->settings . The above code overrides the default setting.
Your pc may have a different path so refer to stackoverflow link to configure vscode for wsl as terminal
you can also refer to the microsoft link for wsl configuration https://learn.microsoft.com/en-us/windows/wsl/wsl-config
you can refer to similar question as yours for ubuntu and multiple distros

- 376
- 5
- 13
I have configured VS code as follows, so I can use it as "integrated Terminal"
"terminal.integrated.profiles.windows": {
"Ubuntu (WSL)": {
"path": "wsl.exe",
"args": ["-d", "ubuntu"]
}
},
...

- 2,349
- 2
- 32
- 60