Skip to content
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

Only start if needed: wsl-vpnkit status not working #160

Closed
STiAT opened this issue Oct 28, 2022 · 4 comments
Closed

Only start if needed: wsl-vpnkit status not working #160

STiAT opened this issue Oct 28, 2022 · 4 comments

Comments

@STiAT
Copy link

STiAT commented Oct 28, 2022

First of all thank you, this made it possible to reliably use WSL2 via VPN.

To the issue:
In your documentation, you say we could only start the service if required (or not already running).

wsl.exe -d wsl-vpnkit service wsl-vpnkit status >/dev/null || \
  wsl.exe -d wsl-vpnkit service wsl-vpnkit start

The issue is, that wsl-vpnkit in the 0.3.4 release seems to be missing the status option:
grafik

Therefore the command fails and it always tries to start the service anyway.

@STiAT
Copy link
Author

STiAT commented Oct 28, 2022

Update: Seems the docs refer to a feature implemented after the release. Probably should only be there after it was released ;-).

@josesa-xx
Copy link
Contributor

josesa-xx commented Oct 29, 2022

I've added that to the documentation after changing the init scripts (#147), however this will only become effective when there is a new release published.

Alternatively you can build it from source.

Or use the following:

  flock ~ -c '
    if [ -z "$(wsl.exe -d wsl-vpnkit --cd /app ps | grep wsl-vm)" ]; then
        wsl.exe -d wsl-vpnkit --cd /app service wsl-vpnkit start
    fi
  '

I use flock because I use windows terminal with multiple splited panes, so this prevents concurrency starting those external services

@sakai135
Copy link
Owner

sakai135 commented Nov 15, 2022

@STiAT @josesa-xx thanks, v0.3.5 v0.3.6 is out as a pre-release now. I'll mark it as release after a few days of use.

@sakai135
Copy link
Owner

sakai135 commented Jan 4, 2023

v0.3.8 should resolve this issue.

@sakai135 sakai135 closed this as completed Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants