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

Document API to get list of installed distros, their .exe files and base pathes. #3515

Closed
throwable-one opened this issue Aug 30, 2018 · 4 comments

Comments

@throwable-one
Copy link

throwable-one commented Aug 30, 2018

wslconfig output is not documented now, and I can't find any official doc for HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss.

If I need to switch default distro, run some distro by name or browse its root fs, I need to rely on not documented things.

Please, document API

@benhillis
Copy link
Member

@Biswa96 - Please do not take a dependency on our registry format, it is subject to change without notice.

@benhillis
Copy link
Member

Right, and I'm warning that approach is fraught with peril.

@throwable-one
Copy link
Author

throwable-one commented Aug 30, 2018

@benhillis thank you. Do you have plans to provide official API instead?

Here is one of my usecases: I want to browse root fs from Windows. I do not want to change it, only browse.

The only stable way to do that is to run Linux app and so some IPC, but it seems to be overkill here.

Is there any way to find BasePath for distro except registry Lxss record?

@therealkenc
Copy link
Collaborator

Here is one of my usecases: I want to browse root fs from Windows

That isn't a use case. The reason you want/need to browse the lxss directory is the use case.

Linux app and so some IPC

You can use WebDAV which is agreed gross overkill but at least all the infrastructure already exists, so from a coding point it isn't too bad. Depends on your... use case.

[FWIW I did a PoC thing using the above in early 2017 for which I had grand plans, but shelved it in the hopes that #1524 (UserVoice) was going to work out. Unfortunately it didn't.]

jayschwa added a commit to jayschwa/desktop that referenced this issue Dec 14, 2018
The shell is invoked with `wsl.exe`, which uses whichever Linux
distribution the user has configured as their default. [1]

The option is presented to the user when the following conditions
are met:

1. `wsl.exe` and `wslconfig.exe` are both found in the system.
2. `wslconfig.exe /list` returns an exit code of zero.

I verified that `wslconfig.exe /list` returns a non-zero exit code
when the system has no Linux distributions installed. I decided to
avoid the registry for detection since that has been discouraged
by the WSL developers. [2]

Closes desktop#4641

[1]: https://docs.microsoft.com/en-us/windows/wsl/wsl-config#wsl-and-wsl-command
[2]: microsoft/WSL#3515
jayschwa added a commit to jayschwa/desktop that referenced this issue Dec 15, 2018
The shell is invoked with `wsl.exe`, which uses whichever Linux
distribution the user has configured as their default. [1]

The option is presented to the user when the following conditions
are met:

1. `wsl.exe` and `wslconfig.exe` are both found in the system.
2. `wslconfig.exe /list` returns an exit code of zero.

I verified that `wslconfig.exe /list` returns a non-zero exit code
when the system has no Linux distributions installed. I decided to
avoid the registry for detection since that has been discouraged
by the WSL developers. [2]

Closes desktop#4641

[1]: https://docs.microsoft.com/en-us/windows/wsl/wsl-config#wsl-and-wsl-command
[2]: microsoft/WSL#3515
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants