Giter Club home page Giter Club logo

Comments (9)

sakai135 avatar sakai135 commented on May 30, 2024

Do the logs have anything when you start the service and it doesn't work?

wsl.exe -d wsl-vpnkit cat /var/log/wsl-vpnkit.log
starting wsl-vpnkit
vpnkit.exe exists at /mnt/c/Users/username/wsl-vpnkit/wsl-vpnkit.exe
npiperelay.exe exists at /mnt/c/Users/username/wsl-vpnkit/npiperelay.exe
waiting for /var/run/wsl-vpnkit.sock ...
found /var/run/wsl-vpnkit.sock
waiting for eth1 ...
found eth1
ip: RTNETLINK answers: File exists
successfully created TAP device eth1
starting in connect mode with path=/var/run/wsl-vpnkit.sock and tap=eth1
2021/10/11 23:11:04 open //./pipe/wsl-vpnkit: The system cannot find the file specified.
EOF reading from socket: closing

Failed to read hello from client
Failed to negotiate vmnet connection
wsl-vpnkit.exe: [INFO] Setting handler to ignore all SIGPIPE signals
wsl-vpnkit.exe: [INFO] ...multiple logs here...
wsl-vpnkit.exe: [INFO] TCP/IP ready
wsl-vpnkit.exe: [INFO] TCP/IP stack connected

I would also like to see the pstree when it fails.

wsl.exe -d wsl-vpnkit pstree
init-+-init---wsl-vpnkit-+-wsl-vpnkit---socat---npiperelay.exe
     |                   |-wsl-vpnkit---wsl-vpnkit.exe
     |                   `-wsl-vpnkit---vpnkit-tap-vsoc---vpnkit-tap-vsoc---4*[{vpnkit-tap-vsoc}]

Also, if you want to run the script in the foreground for nohup you can just use the script directly without the service script.

wsl.exe -d wsl-vpnkit /app/wsl-vpnkit

from wsl-vpnkit.

sakai135 avatar sakai135 commented on May 30, 2024

I've added a little bit more logging with #49. I would appreciate it if you could recreate the issue with v0.2.2 and get the logs.

from wsl-vpnkit.

philippe-granet avatar philippe-granet commented on May 30, 2024

@sakai135
When I have the issue:

dev@localhost:~$ wsl.exe -d wsl-vpnkit service wsl-vpnkit start
dev@localhost:~$ wsl.exe -d wsl-vpnkit pstree
init-+-init---init---pstree
     `-3*[{init}]
dev@localhost:~$ wsl.exe -d wsl-vpnkit cat /var/log/wsl-vpnkit.log
dev@localhost:~$

from wsl-vpnkit.

philippe-granet avatar philippe-granet commented on May 30, 2024

I have add a sleep just after start-stop-daemon command:
wsl.exe -d wsl-vpnkit sed -i 's/--start/--start; sleep 15;/g' /app/wsl-vpnkit.service

Then I launch this in a window:

date && wsl.exe -d wsl-vpnkit service wsl-vpnkit start && date
lun. 18 oct. 2021 22:32:31 CEST
lun. 18 oct. 2021 22:32:47 CEST

And this in an other window:
while :; do date && wsl.exe -d wsl-vpnkit ps -Af && timeout 1 /bin/ping internal.corporate.website.com -c 1 ; done

Here the logs:

lun. 18 oct. 2021 22:32:29 CEST
PID   USER     TIME  COMMAND
    1 root      0:00 /init
 1020 root      0:00 /init
 1021 root      0:00 /init
 1022 root      0:00 ps -Af
 
lun. 18 oct. 2021 22:32:30 CEST
PID   USER     TIME  COMMAND
    1 root      0:00 /init
 1023 root      0:00 /init
 1024 root      0:00 /init
 1025 root      0:00 ps -Af
 
lun. 18 oct. 2021 22:32:32 CEST
PID   USER     TIME  COMMAND
    1 root      0:00 /init
 1026 root      0:00 /init
 1027 root      0:00 /init
 1028 root      0:00 {wsl-vpnkit} /bin/sh /etc/init.d/wsl-vpnkit start
 1029 root      0:00 {wsl.exe} /tools/init /mnt/c/WINDOWS/system32/wsl.exe --user root --distribution wsl-vpnkit -- sh -c             start-stop-daemon                 --pidfile /var/run/w
 1031 root      0:00 /init
 1032 root      0:00 /init
 1033 root      0:00 ps -Af
 
lun. 18 oct. 2021 22:32:33 CEST
PID   USER     TIME  COMMAND
    1 root      0:00 /init
 1026 root      0:00 /init
 1027 root      0:00 /init
 1028 root      0:00 {wsl-vpnkit} /bin/sh /etc/init.d/wsl-vpnkit start
 1029 root      0:00 {wsl.exe} /tools/init /mnt/c/WINDOWS/system32/wsl.exe --user root --distribution wsl-vpnkit -- sh -c             start-stop-daemon                 --pidfile /var/run/w
 1034 root      0:00 /init
 1035 root      0:00 /init
 1036 root      0:00 sh -c             start-stop-daemon                 --pidfile /var/run/wsl-vpnkit.pid                 --make-pidfile                 --background                 --std
 1038 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1039 root      0:00 sleep 15
 1045 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1047 root      0:00 socat UNIX-LISTEN:/var/run/wsl-vpnkit.sock,fork,umask=007 EXEC:/mnt/c/.../wsl-vpnkit/npiperelay.exe -ep -s //./pipe/wsl-vpnkit,nofork
 1048 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1049 root      0:00 vpnkit-tap-vsockd --tap eth1 --path /var/run/wsl-vpnkit.sock --daemon --pid /var/run/vpnkit-tap-vsockd.pid
 1054 root      0:00 {wsl-vpnkit.exe} /tools/init /mnt/c/.../wsl-vpnkit/wsl-vpnkit.exe --ethernet \\.\pipe\wsl-vpnkit --gateway-ip 192.168.67.1 --host-ip 192.168.67.2 --lo
 1059 root      0:00 /init
 1060 root      0:00 /init
 1061 root      0:00 ps -Af
PING internal.corporate.website.com (10.x.x.x) 56(84) bytes of data.
64 bytes from 10.x.x.x (10.x.x.x): icmp_seq=1 ttl=38 time=12.0 ms

--- internal.corporate.website.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 12.011/12.011/12.011/0.000 ms


.....


lun. 18 oct. 2021 22:32:46 CEST
PID   USER     TIME  COMMAND
    1 root      0:00 /init
 1026 root      0:00 /init
 1027 root      0:00 /init
 1028 root      0:00 {wsl-vpnkit} /bin/sh /etc/init.d/wsl-vpnkit start
 1029 root      0:00 {wsl.exe} /tools/init /mnt/c/WINDOWS/system32/wsl.exe --user root --distribution wsl-vpnkit -- sh -c             start-stop-daemon                 --pidfile /var/run/w
 1034 root      0:00 /init
 1035 root      0:00 /init
 1036 root      0:00 sh -c             start-stop-daemon                 --pidfile /var/run/wsl-vpnkit.pid                 --make-pidfile                 --background                 --std
 1038 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1039 root      0:00 sleep 15
 1045 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1047 root      0:00 socat UNIX-LISTEN:/var/run/wsl-vpnkit.sock,fork,umask=007 EXEC:/mnt/c/.../wsl-vpnkit/npiperelay.exe -ep -s //./pipe/wsl-vpnkit,nofork
 1048 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1054 root      0:00 {wsl-vpnkit.exe} /tools/init /mnt/c/.../wsl-vpnkit/wsl-vpnkit.exe --ethernet \\.\pipe\wsl-vpnkit --gateway-ip 192.168.67.1 --host-ip 192.168.67.2 --lo
 1062 root      0:00 {npiperelay.exe} /tools/init /mnt/c/.../wsl-vpnkit/npiperelay.exe -ep -s //./pipe/wsl-vpnkit
 1063 root      0:00 vpnkit-tap-vsockd --tap eth1 --path /var/run/wsl-vpnkit.sock --daemon --pid /var/run/vpnkit-tap-vsockd.pid
 1064 root      0:00 vpnkit-tap-vsockd --tap eth1 --path /var/run/wsl-vpnkit.sock --daemon --pid /var/run/vpnkit-tap-vsockd.pid
 1147 root      0:00 /init
 1148 root      0:00 /init
 1149 root      0:00 ps -Af
PING internal.corporate.website.com (10.x.x.x) 56(84) bytes of data.
64 bytes from 10.x.x.x (10.x.x.x): icmp_seq=1 ttl=38 time=12.3 ms

--- internal.corporate.website.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 12.270/12.270/12.270/0.000 ms

lun. 18 oct. 2021 22:32:47 CEST
PID   USER     TIME  COMMAND
    1 root      0:00 /init
 1026 root      0:00 /init
 1027 root      0:00 /init
 1028 root      0:00 {wsl-vpnkit} /bin/sh /etc/init.d/wsl-vpnkit start
 1029 root      0:00 {wsl.exe} /tools/init /mnt/c/WINDOWS/system32/wsl.exe --user root --distribution wsl-vpnkit -- sh -c             start-stop-daemon                 --pidfile /var/run/w
 1034 root      0:00 /init
 1035 root      0:00 /init
 1036 root      0:00 sh -c             start-stop-daemon                 --pidfile /var/run/wsl-vpnkit.pid                 --make-pidfile                 --background                 --std
 1038 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1039 root      0:00 sleep 15
 1045 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1047 root      0:00 socat UNIX-LISTEN:/var/run/wsl-vpnkit.sock,fork,umask=007 EXEC:/mnt/c/.../wsl-vpnkit/npiperelay.exe -ep -s //./pipe/wsl-vpnkit,nofork
 1048 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1054 root      0:00 {wsl-vpnkit.exe} /tools/init /mnt/c/.../wsl-vpnkit/wsl-vpnkit.exe --ethernet \\.\pipe\wsl-vpnkit --gateway-ip 192.168.67.1 --host-ip 192.168.67.2 --lo
 1062 root      0:00 {npiperelay.exe} /tools/init /mnt/c/.../wsl-vpnkit/npiperelay.exe -ep -s //./pipe/wsl-vpnkit
 1063 root      0:00 vpnkit-tap-vsockd --tap eth1 --path /var/run/wsl-vpnkit.sock --daemon --pid /var/run/vpnkit-tap-vsockd.pid
 1064 root      0:00 vpnkit-tap-vsockd --tap eth1 --path /var/run/wsl-vpnkit.sock --daemon --pid /var/run/vpnkit-tap-vsockd.pid
 1150 root      0:00 /init
 1151 root      0:00 /init
 1152 root      0:00 ps -Af
 
lun. 18 oct. 2021 22:32:48 CEST
PID   USER     TIME  COMMAND
    1 root      0:00 /init
 1035 root      0:00 /init
 1038 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1045 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1047 root      0:00 socat UNIX-LISTEN:/var/run/wsl-vpnkit.sock,fork,umask=007 EXEC:/mnt/c/.../wsl-vpnkit/npiperelay.exe -ep -s //./pipe/wsl-vpnkit,nofork
 1048 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1054 root      0:00 {wsl-vpnkit.exe} /tools/init /mnt/c/.../wsl-vpnkit/wsl-vpnkit.exe --ethernet \\.\pipe\wsl-vpnkit --gateway-ip 192.168.67.1 --host-ip 192.168.67.2 --lo
 1062 root      0:00 {npiperelay.exe} /tools/init /mnt/c/.../wsl-vpnkit/npiperelay.exe -ep -s //./pipe/wsl-vpnkit
 1063 root      0:00 vpnkit-tap-vsockd --tap eth1 --path /var/run/wsl-vpnkit.sock --daemon --pid /var/run/vpnkit-tap-vsockd.pid
 1064 root      0:00 vpnkit-tap-vsockd --tap eth1 --path /var/run/wsl-vpnkit.sock --daemon --pid /var/run/vpnkit-tap-vsockd.pid
 1153 root      0:00 /init
 1154 root      0:00 /init
 1155 root      0:00 ps -Af
 
lun. 18 oct. 2021 22:32:50 CEST
PID   USER     TIME  COMMAND
    1 root      0:00 /init
 1035 root      0:00 /init
 1038 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1045 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1047 root      0:00 socat UNIX-LISTEN:/var/run/wsl-vpnkit.sock,fork,umask=007 EXEC:/mnt/c/.../wsl-vpnkit/npiperelay.exe -ep -s //./pipe/wsl-vpnkit,nofork
 1048 root      0:00 {wsl-vpnkit} /bin/sh /usr/sbin/wsl-vpnkit
 1054 root      0:00 {wsl-vpnkit.exe} /tools/init /mnt/c/.../wsl-vpnkit/wsl-vpnkit.exe --ethernet \\.\pipe\wsl-vpnkit --gateway-ip 192.168.67.1 --host-ip 192.168.67.2 --lo
 1062 root      0:00 {npiperelay.exe} /tools/init /mnt/c/.../wsl-vpnkit/npiperelay.exe -ep -s //./pipe/wsl-vpnkit
 1063 root      0:00 vpnkit-tap-vsockd --tap eth1 --path /var/run/wsl-vpnkit.sock --daemon --pid /var/run/vpnkit-tap-vsockd.pid
 1064 root      0:00 vpnkit-tap-vsockd --tap eth1 --path /var/run/wsl-vpnkit.sock --daemon --pid /var/run/vpnkit-tap-vsockd.pid
 1156 root      0:00 /init
 1157 root      0:00 /init
 1158 root      0:00 ps -Af

As soon as sleep command end, ping stop working, and processes wsl-vpnkit.exe and npiperelay.exe are killed in windows

from wsl-vpnkit.

philippe-granet avatar philippe-granet commented on May 30, 2024

In order to keep process running, I use daemonize tool and launch this in my distro:
daemonize $(which wsl.exe) -d wsl-vpnkit wsl-vpnkit

from wsl-vpnkit.

sakai135 avatar sakai135 commented on May 30, 2024

@philippe-granet Thanks for the logs and additional info. What version of Windows (cmd.exe /c ver) are you using?

Could you try this build from #63 and see if wsl.exe -d wsl-vpnkit service wsl-vpnkit start works with it on your machine?

from wsl-vpnkit.

philippe-granet avatar philippe-granet commented on May 30, 2024

@sakai135 My version of Windows: Microsoft Windows [version 10.0.19042.1288]

from wsl-vpnkit.

philippe-granet avatar philippe-granet commented on May 30, 2024

@sakai135 same problem with build from #63

from wsl-vpnkit.

sakai135 avatar sakai135 commented on May 30, 2024

@philippe-granet do you still have this issue? Although if daemonize is working for you, that might be the best solution for now.

from wsl-vpnkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.