1

I have two Linux subsystems install Ubuntu 18.04 and Kali Linux. Presently when I run wsl ls ~ it executes on Kali Linux how do I instruct wsl.exe to execute commands on Ubuntu 18.04?

From command prompt:

C:\>wsl ls ~/
kali

C:\>

From Ubuntu 18.04:

colton@DESKTOP-SHJ6OK8:~$ ls ~
Ubuntu
colton@DESKTOP-SHJ6OK8:~$

From Kali:

colton@DESKTOP-SHJ6OK8:~$ ls ~
kali
colton@DESKTOP-SHJ6OK8:~$
2
  • 1
    According to docs.microsoft.com/en-us/windows/wsl/wsl-config , you can run the command "wslconfig /setdefault name". Replace name with the appropriate distribution name, probably "ubuntu" for you. I don't have multiple subsystems installed so can't verify, but if that works for you, please create that Answer below. Oct 31, 2018 at 19:31
  • Command: wsl.exe --distribution <distro-name>.
    – Biswapriyo
    Oct 31, 2018 at 20:20

1 Answer 1

0

You may enter the shell of a distribution from the Start menu :

image

You may enter the shell from the command-line by running :

ubuntu.exe

You may execute one particular WSL command from the command-line, returning to the command-line prompt, by running :

ubuntu.exe run ls ~/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .