eg in powershell
PS > wslconfig.exe /? Performs administrative operations on Windows Subsystem for Linux
Usage: /l, /list [/all] Lists registered distributions. /all - Optionally list all distributions, including distributions that are currently being installed or uninstalled.
/s, /setdefault <DistributionName>
Sets the distribution as the default.
/t, /terminate <DistributionName>
Terminates the distribution.
/u, /unregister <DistributionName>
Unregisters the distribution.
/upgrade <DistributionName>
Upgrades the distribution to the WslFs file system format.
PS > ubuntu1804.exe ? Launches or configures a Linux distribution.
Usage: Launches the user's default shell in the user's home directory.
install [--root]
Install the distribuiton and do not launch the shell when complete.
--root
Do not create a user account and leave the default user set to root.
run <command line>
Run the provided command line in the current working directory. If no
command line is provided, the default shell is launched.
config [setting [value]]
Configure settings for this distribution.
Settings:
--default-user <username>
Sets the default user to <username>. This must be an existing user.
help
Print usage information.
#. Open PowerShell (Start, type PowerShell) or Win+R 'powershell.exe'
#. Type :code:ubuntu
then press the Tab key to autocomplete (you will have something similar to :code:ubuntu.exe
or :code:ubuntu1804.exe
installed)
ubuntu.exe config --default-user root
#. (Reset password instructions)
#. Remember to change default user back once done (get your username from 'whoami' in WSL)
In PowerShell
wsl -u root
passwd <username>
https://docs.microsoft.com/en-us/windows/wsl/user-support
(older WSL: https://docs.microsoft.com/en-us/windows/wsl/user-support-archived)
https://github.com/wslutilities/wslu
- wslusc
- wslview