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

A way to set/disable port-max-idle-time option #79

Closed
marad opened this issue Dec 10, 2021 · 1 comment · Fixed by #85
Closed

A way to set/disable port-max-idle-time option #79

marad opened this issue Dec 10, 2021 · 1 comment · Fixed by #85

Comments

@marad
Copy link

marad commented Dec 10, 2021

I'm facing an issue where after a bit of time my X11 windows disappear with this in the vpnkit log:

wsl-vpnkit.exe: [WARNING] TCP 192.168.67.3:56138 > 192.168.67.2:6000 closing flow due to idle port disconnection

After using some google-fu I found this moby/vpnkit#414 and docker/for-win#2639

Is there a way to disable or set port-max-idle-time option in wsl-vpnkit?

@marad
Copy link
Author

marad commented Dec 10, 2021

Ok, so I've found that a quick and dirty hack is to just edit the wsl-vpnkit script like so:

wsl.exe -d wsl-vpnkit vi /usr/sbin/wsl-vpnkit

And then find the vpnkit() function and just add the --port-max-idle-time parameter at the end:

vpnkit () {
    echo "starting vpnkit..."
    WIN_PIPE_PATH=$(echo $PIPE_PATH | sed -e "s:/:\\\:g")
    CMD='"$VPNKIT_PATH" \
        --ethernet $WIN_PIPE_PATH \
        --gateway-ip $VPNKIT_GATEWAY_IP \
        --host-ip $VPNKIT_HOST_IP \
        --lowest-ip $VPNKIT_LOWEST_IP \
        --highest-ip $VPNKIT_HIGHEST_IP \
        --port-max-idle-time 43000 \
    '
    if [ "$VPNKIT_DEBUG" ]; then
        CMD="$CMD"' --debug'
    fi
    eval "$CMD"
}

I'm testing how long my X11 session can survive with this. I'm at 15 minutes right now. After 1h I'll assume it "fixed" the problem. (though I'm not really sure why the connection is viewed as "idle" in the first place).

// EDIT: ok, it's been an hour and X11 session is still standing strong. I'm not happy with the hack, but it seems to work and I'll take it, and maybe this will even help someone else.

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

Successfully merging a pull request may close this issue.

1 participant