[ About | Licence | Contacts ]
Written by Oleksandr Gavenko (AKA gavenkoa), compiled on 2020-11-21 from rev ebbf146d86c1+.

WSL, Windows subsystem for Linux

Documentation

https://docs.microsoft.com/en-us/windows/wsl/
Windows Subsystem for Linux Documentation.
https://github.com/sirredbeard/Awesome-WSL
Awesome list dedicated to Windows Subsystem for Linux.

wsl utility

Run Linux command from default distro:

wsl ls
wsl -e /bin/ls
wsl --exec /bin/bash

Run Linux command from specific distro:

wsl -d ubuntu ls
wsl -d debian -e /bin/ls
wsl -d debian --exec /bin/bash
wsl -distribution debian --exec /bin/bash

Run Linux command from specific user:

wsl -u user ls
wsl --user root ls

Combining user & distro:

wsl -u root -d alpine -- ls
https://docs.microsoft.com/en-us/windows/wsl/wsl-config
Ways to run WSL.

wslconfig utility

List distros:

wslconfig /l
wslconfig /list

Set default distro:

wslconfig /s debian
wslconfig /setdefault debian

Terminate any running parts of distro:

wslconfig /s debian
wslconfig /terminate debian

Mounting external drives

sudo mkdir /mnt/f
sudo mount -t drvfs f: /mnt/f
https://docs.microsoft.com/en-us/windows/wsl/wsl-config
/etc/wsl.conf configuration options.