Change default WSL username
It’s often convenient to use the same username for Windows and WSL. Here’s how to change the existing WSL default user (easier to do that than change your WSL username).
From Windows Command Prompt (example creating WSL username joe
)
Ubuntu config --default-user joe
Copy user files over from the old WSL user /home/oldusername
directory.
Don’t forget to copy:
item | location |
---|---|
SSH keys and config | /home/oldusername/.ssh |
Git config | /home/oldusername/.gitconfig |