https://rancher.com/ logo
Title
p

proud-jewelry-76210

09/27/2022, 7:45 AM
Hey! I'm trying to automatically run a wsl-vpnkit command when rancher desktop starts up, I tried to create a file in the %AppData%\rancher-desktop\provisioning directory called initvpn.start File content:
#!/bin/sh
/mnt/c/Windows/system32/wsl.exe -d wsl-vpnkit service wsl-vpnkit start
Made sur that the line endings are LF. If I run the same command through wsl in the rancher-desktop distribution it works, but not with the script. I couldn't find any logs about the command run either, is it even logged somewhere? Thanks
f

fast-garage-66093

09/27/2022, 5:31 PM
This should work. Not sure if there are any logs, but you could easily add some logging yourself:
#!/bin/sh
date >> /var/log/vpnkit.log
/mnt/c/Windows/system32/wsl.exe -d wsl-vpnkit service wsl-vpnkit start >> /var/log/vpnkit.log
If the file isn't created at all, then the script may not be running. Otherwise it may include some info about what is happening.