Skip to content

WSL default user configuration

The default user for a Windows Subsystem for Linux (WSL) distribution is managed through the instance's configuration file. This file is located at /etc/wsl.conf inside the Linux file system^[600-developer__tools__windows__install-multiple-Ubuntu-WSL2.md].

To set the default user, the user section must be defined within this file. Specifically, the default parameter is used to specify the username of the default account^[600-developer__tools__windows__install-multiple-Ubuntu-WSL2.md].

Configuration format

The configuration is structured in the INI format. The relevant entry must be placed under the [user] header^[600-developer__tools__windows__install-multiple-Ubuntu-WSL2.md].

[user]
default=username

After updating this configuration, the WSL instance typically needs to be terminated and restarted for the changes to take effect^[600-developer__tools__windows__install-multiple-Ubuntu-WSL2.md].

  • [[WSL]]
  • [[Linux user management]]

Sources

^[600-developer__tools__windows__install-multiple-Ubuntu-WSL2.md]