-
-
Notifications
You must be signed in to change notification settings - Fork 127
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
Does running .exe's still work with the custom init system? #32
Comments
It doesn't seem to work for me. The path isn't forwarded like usual, but even running with the full path I don't get any output from running .exes:
Also, if anyone else is having issues with [automount]
enabled = true
options = "metadata,uid=1000,gid=100,noauto,x-systemd.automount" |
I got it to work, you need to forward some environment variables through # ...this is replacing the very last line of syschdemd.sh, the `exec $sw/nsenter...`
exportCmd="export WSLENV=\"$WSLENV\"; export WT_SESSION=\"$WT_SESSION\"; export WT_PROFILE_ID=\"$WT_PROFILE_ID\"; export WSL_INTEROP=\"$WSL_INTEROP\""
exec $sw/nsenter -t $(< /run/systemd.pid) -p -m -- $sw/machinectl -q --uid=@defaultUser@ shell .host /bin/sh -c "cd \"$PWD\"; $exportCmd; exec $cmd" There's probably some nicer way of doing it, though. |
Awesome that you got it working though! I'll have a try then after migrating to Windows. Thanks! |
Changed machinectl to systemd-run to have finer grained control on how the user session is initiated. It has the following advantages: * Direct support for specifying working directory * Can be passed arbitrary directives understood by Systemd (see `systemd.exec(5)` for details). It is used to pass environment variables. * Returns proper exit status of internal commands (machinectl swallows it) By passing these variables WSLg and windows executables now just work out of the box. Hopefully any new environment variables introduced in the WSL ecosystem in the future will just work as well. Fixes nix-community#32
after replacing the last line of syschdemd.sh with the above and running |
I don't really use WSL anymore, so I'm not sure, but you may be able to use |
Apologies in advance for posting the question in the title as an issue (didn't notice anywhere I could post questions regarding this repo), though I'm looking to migrate from NixOS to Windows w/ WSL2 + NixOS and wanted to know if this is doable.
The use case is for writing Windows code in WSL2, and debugging them directly on Windows. As of now w/ NixOS, I use Wine to debug Windows code I write.
The text was updated successfully, but these errors were encountered: