Search notes:

wsl.exe

wsl.exe is the command line program for adminstration of the Windows Subsystem for Linux.

Command lines arguments/options

Without command line option or argument, executing wsl.exe launches the default shell.
The second columns shows the abbreviation
--exec <command> -e Execute command without spawning a shell
-- <command> Execute command in the default shell
--cd <dir> Set working directory (~…, /… or c:\…)
--destribution <distro> -d Runs distro
--user name -u Runs as user
--install [options] Installs addition WSL distributions (for example wsl --install -d Ubuntu). (See wsl --list --online)
--set-default-version <v> Changes the default install version for new distributions to <v> (1 or 2)
--shutdown Immediately terminates all running instances and the WSL 2 lightweight utility virtual machine. (Necessary when changing /etc/wsl.conf?)
--status Show WSL status
--update [--rollback] Update to newest version or rollback to previous WSL kernel version. Requires elevated privileges.
--export <distro> <tarFile> Exports distribution to a tar file. <tarFile> can be - for std out.
--import <distro> <tarfile> Imports from a tar or tar.xz file (- is possible)
--list [options] -l Lists distributions. Options: --all lists all (locally installed?) distributions; --running; --quiet lists only distribution names (without (Default)); --verbose; --online lists all distributions that are a available for installation
--set-default <distro> -s Sets the default distribution
--set-version <distro> <v> Changes the version of the specified distribution to <v>. Possible version numbers are 1 and 2.
--terminate <distro> -t Terminates the specifed distribution
--unregister <distro> Removes the distribution and deletes its the root filesystem
--mount, --unmount Mount physical disks, whose filesystem is not supported by Windows (such as ext4), to WSL. See Access Linux filesystems in Windows and WSL 2
--debug-shell opens a WSL2 debug shell for diagnostics purposes.
--version -v version information

Index