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 Command Prompt

     lxrun /setdefaultuser
  2. copy your files over from the old user /home/oldusername directory.

Don’t forget to copy:

item location
SSH keys and config /home/oldusername/.ssh
Git config /home/oldusername/.gitconfig