-
Notifications
You must be signed in to change notification settings - Fork 19
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
Mounting Windows drives to non-default location in wsl.conf stops wslbridge from starting #22
Comments
I wonder if wslpath accepts a GUID specifying the WSL instance. Assuming it does, then I think this issue can be fixed by invoking |
You'd have to ramp up a WSL environment twice for calling wslpath in advance, right? |
Oh, wslpath is a WSL command. I thought it was an EXE for some reason. That would be pretty slow. Yeah, it should probably read |
|
Thanks, that should work. |
It seems to be even worse; reading the release notes, it seems that the mount point can also be adjusted with |
That seems hairy -- e.g. permissions, concurrent startup, conflicting wslbridge versions, etc. If wslbridge can't find a WSL path to its backend, maybe the user should configure its backend WSL path? I wonder if wslpath is correct when wslbridge currently invokes Maybe it could use wslpath inside the lone
|
Ah, that sounds worth a try. Provided |
Also, if it should not be correct, we can blame it on wslpath :) |
@rprichard I'm pretty sure that wslpath will obey the |
You could just put a little test in the bash invocation and use the default mount if
|
If the wslpath command is in the PATH, then wslbridge relies on it to find the backend. If it's not in the PATH, then it falls back on its own X:\foo\bar ==> /mnt/x/foo/bar path conversion. I tested using the /etc/wsl.conf file here: https://blogs.msdn.microsoft.com/commandline/2018/02/07/automatically-configuring-wsl/ If the /windir directory didn't exist, then no /windir/c mount was created, and wslbridge failed with this error message: $ ./out/wslbridge wslbridge error: failed to start backend process note: backend error output: wslpath: C:\rprichard\proj\wslbridge\out\wslbridge-backend: No such file or directory If the directory does exist, then wslbridge finds the /windir/c/... backend path. Fixes #22
I implemented a version of the invoke-wslpath idea on this branch: https://github.com/rprichard/wslbridge/tree/wslpath. I decided to use this syntax (w/o newlines): $(if [ "$(command -v wslpath)" ]; then
wslpath 'C:\path\to\backend' || echo false;
else
echo /mnt/c/path/to/backend;
fi) <args> Part of my rationale was that |
@rprichard looks good to me. Your assumption that something is always written to stderr on failure looks to be true - I've tried a few things. Also, this may be obvious, but it's worth mentioning that # Single backslash fails
wslpath C:\Users
# wslpath: C:Users: Invalid argument
# Escaped backslash is fine
wslpath C:\\Users
# /c/Users
# Forward slash is also fine
wslpath C:/Users
# /c/Users |
The chosen approach prevents an obvious solution to another issue, the user's default shell; |
Yeah, the backend effectively chooses the shell when it invokes The frontend's use of |
If wslbridge and backend are installed in the folder containing spaces, bash exits immediately with error wslbridge error: failed to start backend process note: backend error output: /bin/bash: /mnt/c/Program: No such file or directory
If wslbridge and backend are installed in the folder containing spaces, bash exits immediately with error wslbridge error: failed to start backend process note: backend error output: /bin/bash: /mnt/c/Program: No such file or directory
If wslbridge and backend are installed in the folder containing spaces, bash exits immediately with error wslbridge error: failed to start backend process note: backend error output: /bin/bash: /mnt/c/Program: No such file or directory
@rprichard @mintty Worth noting that in the latest Insiders Preview, there are now additional flags for the These include |
But to run with exec option there should be a GUID entry in Lxss registry. Wsl.exe won't run without any registry. There is a RtlGuidToString() before exec option. |
Is there any actual explanation of the new options (not just listing their existence as on that page...)? |
exec option only accepts only Linux path (i.e. /mnt/c). Distribution option has only the distro name. Do you want that wsl.exe? I can upload that. |
No thanks. In that case the -exec option isn't useful for our case. |
The exec option uses the COM interface. If someone reverse that COM interface that can be used in mintty. Though the COM vtable is unstable and undocumented. It also sets the console output to UTF-16 and lot more stuffs. |
In the latest insider build of Windows 10 [17093] there is a new configuration file for the WSL at
/etc/wsl.conf
. Among other things, this allows you to change the path on which your Windows drives are mounted (default is/mnt/
).This is extremely useful at the moment, as it allows us to get Docker working via the WSL. (See this issue for details).
I originally created an issue with wsltty as the terminal was exiting immediately after launching, but @mintty has determined that the issue is here instead. The error given when starting wsltty or wslbridge is:
Having had a quick look through the code here, it seems that the only mentions of the
/mnt
path string are in this function. It's just a question of how to find what path the user has mounted their Windows drives to (in my case/
) and using that instead.It may also be worth mentioning that the task that function performs, can now be done with the wslpath tool included in the latest insiders builds (since 17046).
The text was updated successfully, but these errors were encountered: