Skip to content

Commit d9607c6

Browse files
authored
Added section for changing default user
Added section for changing default user
1 parent 0082a53 commit d9607c6

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

WSL/wsl-config.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,18 @@ To reinstall, find the distribution in the Microsoft store and select "Launch".
166166

167167
Run WSL as the specified user. Please note that user must exist inside of the WSL distribution.
168168

169+
### Change the default user for a distribution
170+
171+
`<DistributionName> config --default-user <Username>`
172+
173+
Change the default user that a distribution automatically logs you in as. The user has to already exist inside the distribution in order to become the default user.
174+
175+
For example:
176+
`ubuntu config --default-user johndoe` would change the default user for the Ubuntu distribution to the johndoe user.
177+
178+
> [!NOTE]
179+
> If you are having trouble figuring out the name of your distribution, see the section titled [List distributions](https://docs.microsoft.com/en-us/windows/wsl/wsl-config#list-distributions-1) for the command to list the official name of the installed distributions.
180+
169181
#### Run a specific distribution
170182

171183
`wsl -d <DistributionName>`, `wsl --distribution <DistributionName>`

0 commit comments

Comments
 (0)