-
Notifications
You must be signed in to change notification settings - Fork 171
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
Resolving interop-issue while running wsl-vpnkit as a systemd-service in own wsl-distro #247
Comments
Hi @dabeck81! I encountered the same problem with I understand you implemented the "standalone script" setup variant mentioned in the top-level README. What needs to be modified in addition to your fix that |
I have to correct my above comment, it is my bad. Also, my experience might also be impaired by some other issue I encountered with the local proxy So, to conclude, it seems like @dabeck81 's solution works, indeed! However, I'm still interested in the "distro setup". |
I used @dabeck81 script and modified it for the distro setup. I only did the following: Create the script:
#!/bin/sh
export WSL_INTEROP=
for socket in $(ls /run/WSL|sort -n); do
if ss -elx | grep "$socket"; then
export WSL_INTEROP=/run/WSL/$socket
else
rm $socket
fi
done
# also start wsl-vpnkit
/mnt/c/Windows/system32/wsl.exe -d wsl-vpnkit --cd /app wsl-vpnkit Don't forget to Modify the service to use the script:
That was already sufficient to get my setup working again. |
I have created a pull-request to resolve my issue: #250 And most of all, it is self-healing, so if you have more than one bash-terminals running and you would close the process linked to the WSL-INTEROP-socket, that will be detected and will switch over to another running socket |
@dabeck81 your PR assumes that your interop socket will live forever which is just not true. The stability of your solution will literally hang on the skin of your Bash terminal's teeth. If you close all those terminals, you will ensure that wsl-vpnkit will never find a working interop socket until you manually restart the service from a new terminal. I think a better solution would be to be able to request and free WSL interop sockets much like memory is requested and freed in C. For this purpose, I have created microsoft/WSL#10812 and described my use case and the findings myself and my team made. Secondly, I don't think
I'll be honest. I run into this scenario where there is no valid interop socket on a daily basis, because I use |
@grepwood ,
|
Any word on getting these PRs approved/merged and a new version out? |
I've thrown in on microsoft/WSL#10812, providing the logs they requested. Based on my cursory examination, it looks like @grepwood has it exactly right: the |
I am affraid only @sakai135 is able to approve and merge the Pull Request, so we will need to wait for that |
I've read @OneBlue's post and I have a dastardly idea how to cheese the system for our gain. I'll let you know if it worked. |
"dastardly" was right! |
Description of issue:
I created my own wsl-distribution where I wanted to start the wsl-vpnkit immediatly with a systemd-service upon start.
For this I created a dockerfile containing following instructions:
As you can see the wsl-vpnkit is installed under
/opt/wsl-vpnkit
I adapted the
wsl-vpnkit.service
file to point to that directory, but I quickly encountered upon inspecting the journalctl-logs of the service, that I constantly received the wsl-gvproxy.exe is not executable due to WSL interop settings or Windows permissions-errorSolution implemented
The problem was that when the systemd-service started, there was no WSL_INTEROP environment variable set to point towards the socket used for running ".exe" files in a WSL-distro.
I came up with following solution while reading following WSL-thread around this issue: microsoft/WSL#5065
Adapt service-file as follows:
And here you have the
wsl-interop-env.sh
script that initializes the WSL_INTEROP variable:Proposal as a change in wsl-vpnkit
Add a check in the
wsl-vpnkit
-script to set theWSL_INTEROP
variable when it is empty/not existant based upon the code in thewsl-interop-env.sh
script.If you have another working proposal to run wsl-vpnkit as a service within your own distro, please let me know
Thanks for this awsome project
The text was updated successfully, but these errors were encountered: