-
Notifications
You must be signed in to change notification settings - Fork 842
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
User sessions started from non-wsl.exe sources (such as systemd services) don't have WSL_INTEROP #8846
Comments
The failure in this case is obviously from the lack of WSL_INTEROP in systemd-started sessions. It can be worked around, if you have a long-running WSL session, by pushing the WSL_INTEROP environment variable for that session into the system environment block using
at which point it is inherited by all systemd services and sessions. (The problem with that is that while it was a viable solution for genie, because the init above genie would always be around for as long as systemd would be, there isn't such a guaranteed-present-as-long-as-systemd init around under the native systemd support - and so this workaround relies on keeping one particular WSL session open perpetually to provide the socket behind WSL_INTEROP.) |
Thanks - I agree launching Windows processes from things launched from systemd would be a good enhancement and shouldn't be too bad to implement. I'll see what I can do. |
Voting for this enhancement - I am specifically prefer to use my XWin instead of wslg and till now i enabled it from systemd user unit. Unfortunately it stopped working when I moved to builtin systemd |
Same problem in 68.2, I'm afraid. Both, in fact - no WSL_INTEROP in the systemd or systemd user session environment, and the binfmt is lost. |
The solutions provided in #5065 are a workaround for my own systemd services |
This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request. Thank you! |
Version
Microsoft Windows [Version 10.0.22000.856]
WSL Version
Kernel Version
5.15.62.1-20220921-1-microsoft-custom-WSL2+
Distro Version
Debian bookworm/sid
Other Software
No response
Repro Steps
echo $WSL_INTEROP
will return a value, such as/run/WSL/136_interop
sudo machinectl shell <username>@.host
to enter a user session under systemd.(This is used as a workaround to get a systemd user session created; see #8842 . But the same issue applies to any user session created under systemd/by non-wsl.exe means, including ssh, etc.)
echo $WSL_INTEROP
will show nothing./mnt/c/Windows/notepad.exe
Expected Behavior
The Windows application should run as normal for interop.
Actual Behavior
The Windows application fails to run and exit code 1 is returned:
Diagnostic Logs
No response
The text was updated successfully, but these errors were encountered: