Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to register already exist WSL distribute when I changed windows account #4591

Closed
qclzdh opened this issue Oct 12, 2019 · 7 comments
Closed
Labels

Comments

@qclzdh
Copy link

qclzdh commented Oct 12, 2019

I already setup wsl distribution in my WIN10 account as following:
1

But, when i changed my WIN10 account to another one, i can't find my distribution, is there some easy way to register this:
2

My distribution already install many things, it takes about 800G, I don't want to re-install it, or export/import, it is too long to do this, since it's so big.

@qclzdh
Copy link
Author

qclzdh commented Oct 12, 2019

BTW, my distribution installed in D:\wsl\Ubuntu\

@Biswa96
Copy link

Biswa96 commented Oct 12, 2019

Let assume two users, 1st user has installed a distro but 2nd does not.

  • 😇 Good advice:

    • Use wsl --export in 1st user to make a tar file.
    • Move that file to 2nd user realm.
    • Use wsl --import to install it in 2nd user.
  • 😈 Evil advice:

    • Copy the VHDX file from 1st user. See this Superuser answer for how to find.
    • Export the registry HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss from 1st user in a REG file.
    • Copy or move those two files to 2nd user realm.
    • Double click to import the registry.
    • Copy the path where you put the VHDX file in 2nd user realm and paste it in the BasePath in Lxss registry key. Make sure to match the distribution name.

As you have said your Linux distribution installed in different drive then you have to only export the Lxss registry from 1st use and import it in 2nd.

@benhillis
Copy link
Member

@Biswa96 - I wish you'd stop suggesting people mess around with the registry...

@Konstantin-Glukhov
Copy link

You can even go further, just create a new entry under Lsxx and register whatever you want :) Just make sure to generate a unique key for the distribution.
E.g.:

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss{5526db11-a739-4a33-9031-9793a481c2ed}]
"State"=dword:00000001
"DistributionName"="Ubuntu-18.04"
"Version"=dword:00000002
"BasePath"="\\?\E:\Linux\Ubuntu\18.04"
"Flags"=dword:0000000f
"DefaultUid"=dword:00000000

@sisrfeng
Copy link

sisrfeng commented Aug 5, 2022

@Biswa96 - I wish you'd stop suggesting people mess around with the registry...

Hi, is there any command that can solve this issue without touching the registry?
Here is the detail of my similar problem:
pxlrbt/move-wsl#35

@eugenesvk
Copy link

FYI to correct a few typos in the version listed above the full .reg file you can paste it into, update and open to add

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{5526db11-a739-4a33-9031-9793a481c2ed}]
"State"=dword:00000001
"DistributionName"="Ubuntu"
"Version"=dword:00000002
"Flags"=dword:0000000f
"DefaultUid"=dword:00000000
"BasePath"="\\\\?\\E:\\Linux\\Ubuntu"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants