0

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:~$
  • 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. – Christopher Hostage Oct 31 '18 at 19:31
  • Command: wsl.exe --distribution <distro-name>. – Biswapriyo Oct 31 '18 at 20:20
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 ~/

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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