1

I had to change my Windows 10 username (local account) to remove white space from the user folder("User Name" to "User-Name". I followed the advice in this Q&A. I had a running install of WSL 2 in the user account i renamed.

However after the change of the username i was asked for setting user name and password on the Ubuntu Terminal again. I was able to set the same username used before in WSL and quickly found that it seems to be a fresh install of WSL and all of the previous information is gone e.g. ssh-keys.

I've read that Windows 10 manages WSL on a per user basis. So maybe the WSL for user "User Name" still exists and the configuration wasn't updated automatically. Where would i find the configuration that maps between Windows user accounts and WSL instances and is there a way to change these?

1 Answer 1

3

This issue was raised in Bug #3720 : Renaming user profile folder breaks WSL, where the official answer was:

Just to make sure I'm following this correct, you did not run into issues until modifying the ProfileImagePath registry key? The link you pasted does not mention Windows 10, so I'm thinking it is not supported.

From playing around with this a bit myself, all sorts of things fall over when this value is modified (including not being able to install store apps any longer and getting error messages when I log in). As such, I don't think there's much that can be done about this.

Although Microsoft does not intend fixing this problem, a workaround was proposed by a user:

  • Installed LxRunOffline

  • Ran

      lxrunoffline rg -n 'Debian' -d C:\Users\riolly\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu20.04onWindows_79rhkp1fndgsc\LocalState
    

    to register my distro again; at this point, I could only log into it as root;

  • Ran

      debian.exe config --default-user $my_existing_debian_user
    

    and was able to log in as a regular user as was the case before renaming my windows user directory.

Substitute your user-name in the above commands.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .