-
Notifications
You must be signed in to change notification settings - Fork 52
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
WSL: pass-through PATH variable to the SkiffOS environment #239
Comments
@clayauld I think this comes down to two issues:
This is because of how the SkiffOS system starts up:
It's easy to mount paths into the SkiffOS WSL is reading The only workaround I can think of is to bind-mount wsl.conf into the target FS. But then, the changes made to wsl.conf in the SkiffOS image wont' apply. It would have to do something like this:
... but then WSL wouldn't read wsl.conf until the next reboot. What are the extra windows paths that don't appear? Are they always mounted into WSL distributions or is this something configured with wsl.conf? |
The extra windows paths for my WSL distro(s) are as follows:
It appears it is taken from the Windows PATH variable and translated over to the Linux equivalent, referencing everything in the Based on the order of how the PATH variable comes in to WSL is the base PATH for Linux is first ( There is a workaround here, of course. I could just have the Skiff Core user manually set the PATH, and things should work just fine. However, I didn't know if there was a way to use the "standard" way of WSL appending the paths. |
Hmm, I feel like I had configured it to bind mount /mnt/ including mnt/c - will check. |
/mnt/c and all other drives are certainly bound to /mnt so that part does work as expected. |
@clayauld Do I understand correctly: in other WSL distros $PATH is correctly updated to include the /mnt/c paths but here they are reset by SkiffOS during the systemd boot process? In that case it should be possible to add a workaround which stores PATH somewhere and loads it back after systemd starts. |
That is a good summary of what is occurring. I was thinking of a workaround similar to your suggestion by storing the PATH variables in a file somewhere then pulling them in after Skiff and systemd start. I wasn't sure what stage of the startup process would need to do this, but I think that's a good way to address this. |
I think it's going to have to be something like...
|
That sounds like it should work to me and makes sense. The Skiff Core container could also use that file to load the PATH variables. I'm using custom docker containers now for Skiff Core so that part should be straightforward and the Core user can source that file and add the directories to the PATH. |
Interesting development on systemd in WSL. https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/ Looks like systemd is getting official support soon. Not sure how this changes the WSL config for SkiffOS. Let me know what I can do if there is rework necessary when this support comes out of beta testing. |
I think we can support either way - right now, the skiff-init-wsl binary checks if an existing systemd instance is running. So we can, without any changes, add skiff-init-wsl as the init binary (instead of systemd). Then;
|
I'll take a look at this & other WSL related things soon - also having a look at submitting it to the WSL store. |
The WSL build doesn't bring over the Windows paths as is typical of WSL distros. More info here:
https://docs.microsoft.com/en-us/windows/wsl/wsl-config (Look at example wsl.conf)
I have tried forcing it using edits in the wsl.conf file, but as the default for that string is
true
, I have been unsuccessful in getting that to work.The text was updated successfully, but these errors were encountered: