WSL-Distribution-Switcher icon indicating copy to clipboard operation
WSL-Distribution-Switcher copied to clipboard

cannot install centos:latest

Open quin47 opened this issue 8 years ago • 11 comments

python install.py rootfs_centos_latest.tar.xz [*] Probing the Linux subsystem... [!] Failed to get home directory of default user in WSL: [WinError 2] 。

quin47 avatar Feb 13 '17 10:02 quin47

  1. Do you have WSL installed already? You need a working installation first.
  2. Are you running the script inside WSL or from command prompt? You need to run it from command prompt, outside of WSL, while WSL is not running.

RoliSoft avatar Feb 13 '17 12:02 RoliSoft

I'm getting the same error on my desktop trying to install Fedora 23. To answer your questions:

  1. Yes WSL is installed and working.
  2. Running the install script from command prompt outside of WSL directory and WSL is not running.

As a side note, I have used the distro switcher for a month or so on my laptop now and it has worked fine.

Ikuni17 avatar Feb 14 '17 05:02 Ikuni17

There are a few people reporting similar errors. I'll try to install a fresh insiders build and run the script on a few distributions, in order to see if anything is broken.

For the record, what build of Windows 10 are you using?

RoliSoft avatar Feb 14 '17 11:02 RoliSoft

Version 1607, build 14393.693

Ikuni17 avatar Feb 14 '17 15:02 Ikuni17

Have you been able to resolve this issue? If not, I will be requiring more information, since I cannot reproduce it.

RoliSoft avatar Mar 03 '17 20:03 RoliSoft

I have not been able to. I was planning to try reinstalling lxss since I don't have anything critical on it currently.

Ikuni17 avatar Mar 04 '17 22:03 Ikuni17

FWIW, I was able to get centos:latest installed as of today, 3/30/2017. However, I cannot restart services, I get the following error when trying to run systemctl: Failed to get D-Bus connection: Operation not permitted

T-Deuty avatar Mar 30 '17 21:03 T-Deuty

I'm getting the same error when trying to py install.py nixos/nix. Any suggestions? I tried to run this immediately after alwsl (which completed successfully).

edit: With the following patch:

diff --git a/install.py b/install.py
index c65f563..61b7c39 100755
--- a/install.py
+++ b/install.py
@@ -9,6 +9,7 @@ import shutil
 import tarfile
 import os.path
 import subprocess
+import traceback

 from collections import OrderedDict
 from ntfsea import ntfsea, lxattrb, stmode
@@ -73,6 +74,7 @@ try:

 except BaseException as err:
        print('%s[!]%s Failed to get home directory of default user in WSL: %s' % (Fore.RED, Fore.RESET, err))
+       traceback.print_exc()
        sys.exit(-1)

 # check squashfs prerequisites

I'm getting the following stack trace:

[*] Probing the Linux subsystem...
[!] Failed to get home directory of default user in WSL: [WinError 2] Nie można odnaleźć określonego pliku
Traceback (most recent call last):
  File "install.py", line 59, in <module>
    uid, gid, user = get_lxss_user()
  File "C:\dnload\os-etc\wsl-distribution-switcher\utils.py", line 553, in get_lxss_user
    uid,  uid_type  = winreg.QueryValueEx(lxreg, 'DefaultUid')
FileNotFoundError: [WinError 2] Nie można odnaleźć określonego pliku

edit 2: in the registry key HKCU\Software\Microsoft\Windows\CurrentVersion\Lxss, I have only one key: State REG_DWORD 0x00000001 (1)

akavel avatar Jun 20 '17 22:06 akavel

Hmm! Running the following command in Windows (cmd shell):

c:> lxrun /setdefaultuser someuser

seems to create the registry values! I'll try to run install.py again with this...

akavel avatar Jun 21 '17 22:06 akavel

As to my intended docker repo (nixos/nix), after successful install.py, when trying to run "bash" I'm getting 0x80070002, so I assume it's the same as #20, meaning roughly that Alpine Linux doesn't currenly work on WSL.

akavel avatar Jun 21 '17 22:06 akavel

Same error with base/archlinux.

pasteley avatar Sep 01 '17 22:09 pasteley