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

WSL DS doesn't work on Windows 10 build 1709 #84

Open
firelizzard18 opened this issue Feb 26, 2018 · 8 comments
Open

WSL DS doesn't work on Windows 10 build 1709 #84

firelizzard18 opened this issue Feb 26, 2018 · 8 comments

Comments

@firelizzard18
Copy link

firelizzard18 commented Feb 26, 2018

I don't think WSL DS works with the fall creators update (build 1709). This presents similarly to #30, but I think it's a different issue.

I believe this because one of the recent updates (build 1703 or 1709, I'm not sure which), changed a number of things about how the system works. For one, the windows store has multiple available distributions.

Using Anaconda Python 3.6:

$ python install.py centos:latest
[*] Probing the Linux subsystem...
[!] The Linux subsystem is not installed. Please go through the standard installation procedure first.

Attempting a fix from #30:

Warning: lxrun.exe is only used to configure the legacy Windows Subsystem for Linux distribution.
Distributions can be installed by visiting the Windows Store:
https://aka.ms/wslstore

Error: 0x80070002

To be clear, WSL is installed, and the Ubuntu distro for WSL is installed and not running. And I was running from CMD.

@pilpoto
Copy link

pilpoto commented Feb 28, 2018

The same for me, Build 1709 and WSL seems working fine with ubuntu
In fact the "lxss" directory searched at the begening of install.py does not exist.
If it can help, I have found a rootfs directory in AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc/localState/rootfs
A dummy file created in this rootfs/tmp directory effectively apears in bash by typing "ls /tmp"

@akavel
Copy link

akavel commented Apr 1, 2018

There seem to be more details on how to find the path on stackoverflow.

One of the comments suggests to look into HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Lxss\

@RichardBronosky
Copy link

This is a crippling issue. Is this project abandoned?

@fquinner
Copy link

Looks like they're working on similar on #88 - though i just tried that PR and didn't work for me.

@fquinner
Copy link

For the record these were my hacks to get it working (before deciding not to go ahead and actually replace my default instance - I went for LxRunOffline instead to install a new image alongside but used this app to grab the docker images):

C:\Users\fquinn\SourceExternal\github\RoliSoft\WSL-Distribution-Switcher>git diff
diff --git a/install.py b/install.py
index c97b346..b91e660 100755
--- a/install.py
+++ b/install.py
@@ -63,7 +63,7 @@ try:
        else:
                homedir = '/home/' + user

-       homedirw = os.path.join(basedir, homedir.lstrip('/'))
+       homedirw = os.path.join(basedir, 'rootfs', homedir.lstrip('/'))

        if len(homedir) == 0 or not os.path.isdir(homedirw):
                print('%s[!]%s Failed to get home directory of default user in WSL: Returned path %s%s%s is not valid.' % (Fore.RED, Fore.RESET, Fore.BLUE, homedirw, Fore.RESET))
diff --git a/utils.py b/utils.py
index 703910e..4457e1b 100755
--- a/utils.py
+++ b/utils.py
@@ -186,6 +186,7 @@ def probe_wsl(silent = False):
        else:
                basedir = subprocess.check_output('/usr/bin/cygpath -F 0x001c', shell = True, universal_newlines = True)
                basedir = os.path.join(basedir.strip(), 'lxss')
+       basedir = "C:\\Users\\fquinn\\AppData\\Local\\Packages\\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\\LocalState"

        if not os.path.isdir(basedir):
                if silent:
@@ -549,7 +550,7 @@ def get_lxss_user():

                # native implementation

-               with winreg.OpenKey(winreg.HKEY_CURRENT_USER, 'Software\\Microsoft\\Windows\\CurrentVersion\\Lxss', access = winreg.KEY_READ | winreg.KEY_WOW64_64KEY) as lxreg:
+               with winreg.OpenKey(winreg.HKEY_CURRENT_USER, 'Software\\Microsoft\\Windows\\CurrentVersion\\Lxss\\{7e852198-bed0-4a59-bbfd-7074dbddf958}', access = winreg.KEY_READ | winreg.KEY_WOW64_64KEY) as lxreg:
                        uid,  uid_type  = winreg.QueryValueEx(lxreg, 'DefaultUid')
                        gid,  gid_type  = winreg.QueryValueEx(lxreg, 'DefaultGid')
                        user, user_type = winreg.QueryValueEx(lxreg, 'DefaultUsername')

There are a few uuid-ish things in there which you will need to modify to match your environment's registry entry / directory but generally that appeared to be all that was required.

There be dragons.

@Qaad
Copy link

Qaad commented Aug 26, 2018

I've tried fquinner's patch (making the appropriate changes) and while we can make this generic by querying "HKCU\Software\Microsoft\Windows\CurrentVersion\Lxss" for "DefaultDistribution" and get the UUID key (which includes the BasePath for basedir) I'm stopped with another issue.

get_lxss_user in utils.py fails because DefaultGid and DefaultUsername are missing from the Lxss registery keys. Searching the full registry they don't seem to exist.

Can we default these to a value if they don't exist?

This is with a fresh Win10 Pro install (version 1803), WSL enabled, and WSL Ubuntu from the AppStore installed.

@FranklinYu
Copy link

I think this project is dead. Use https://github.com/Microsoft/WSL-DistroLauncher or something else.

@rpili1313
Copy link

The only thing you need to do is go to the windows store and install the Debian package from there.

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

No branches or pull requests

8 participants