Skip to content

Instantly share code, notes, and snippets.

@ismarsantos
Created January 31, 2023 17:13
Show Gist options
  • Save ismarsantos/52ff44a93ea2d633824a1e85a20f6c27 to your computer and use it in GitHub Desktop.
Save ismarsantos/52ff44a93ea2d633824a1e85a20f6c27 to your computer and use it in GitHub Desktop.
How to set default user for manually installed WSL distro "wsl --import"

Side Note: This question was specifically about setting the default username in an imported instance. However, for completeness, you can also set the default username for a distro that was installed from the Store (or wsl --install) with:

<distro>.exe config --default-user <username>

For instance, if you installed "Ubuntu 20.04" from the Store, you would use:

ubuntu2004.exe config --default-user <username>

The .exe here is an "App Execution Alias" in Windows. You can check the name by going to "Manage app execution aliases" in the Windows System Settings.

Original post by superuser.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment