Change default Windows Subsystem for Linux 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).

  1. from Windows Command Prompt (example creating WSL username joe)

     Ubuntu config --default-user joe
    
  2. copy your WSL 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

Leave a Comment