Failed to start wsl-vpnkit.service: Interactive authentication required.
AllenElguira16 opened this issue · 3 comments
AllenElguira16 commented
Hello @AmmarRahman, there is a persisting issue regarding systemctl where it needs a Interactive authentication required.
I am using zsh for my shell
If I manually run sudo systemctl start wsl-vpnkit.service
it will work
andyneff commented
What OS are you trying to run this in? The command is normally (Not systemctl):
service wsl-vpnkit status > /dev/null || service wsl-vpnkit start
No sudo should be need for that.
andyneff commented
This only runs on Debian and Ubuntu. If you are using something else, you need to create an Ubuntu WSL and install it in there.
Only install this in one WSL.
In my case, I installed in the distro named Ubuntu-20.04
so I added the following to all of my all my bashrc's (or zshrc in your case)
if [ -n "${WSL_INTEROP+set}" ] && \
[ "${WSL_DISTRO_NAME}" != "Ubuntu-20.04" ] && \
! /mnt/c/Windows/System32/wsl.exe --cd / -d Ubuntu-20.04 service wsl-vpnkit status &>/dev/null; then
/mnt/c/Windows/System32/wsl.exe --cd / -d Ubuntu-20.04 service wsl-vpnkit start
# sudo equivalent
# /mnt/c/Windows/System32/wsl.exe --cd / -d Ubuntu-20.04 --user root service wsl-vpnkit start
fi
AllenElguira16 commented
Yep, I forgot to add to zsh
will close this one, thanks~!