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

Cannot run wsl-vpnkit with /mnt/wsl/resolv.conf not found in v.0.4.0 #206

Closed
meichenseer opened this issue Apr 14, 2023 · 4 comments
Closed

Comments

@meichenseer
Copy link

I cannot run wsl-vpnkit after installing it with the following error:

wsl.exe -d wsl-vpnkit --cd /app wsl-vpnkit
+ VPNKIT_GATEWAY_IP=192.168.127.1
+ VPNKIT_HOST_IP=192.168.127.254
+ VPNKIT_LOCAL_IP=192.168.127.2
+ TAP_MAC_ADDR=5a:94:ef:e4:0c:ee
+ VMEXEC_PATH=/app/wsl-vm
+ GVPROXY_PATH=/app/wsl-gvproxy.exe
+ TAP_NAME=wsltap
+ CHECK_HOST=example.com
+ CHECK_DNS=1.1.1.1
+ DEBUG=0
+ set +x
cat: can't open '/mnt/wsl/resolv.conf': No such file or directory
+ WSL2_TAP_NAME=eth0
+ WSL2_GATEWAY_IP=
+ '[' 0 -eq 0 ]
+ set +x
**cat: can't open '/mnt/wsl/resolv.conf': No such file or directory
resolv.conf has been modified without setting generateResolvConf**

I installed version 0.4.0 with wsl --import wsl-vpnkit --version 2 $env:USERPROFILE\wsl-vpnkit wsl-vpnkit.tar.gz.

Can you help me?

@kandrejczuk-work
Copy link

Same here.
I checked the wsl.conf and I do have generateResolvConf set to false. Did this by:
wsl.exe -d wsl-vpnkit
vi /etc/wsl.conf

@kandrejczuk-work
Copy link

Had a look in contents of the vsl-vpnkit - I do not have the "if" that falls back to /etc/resolv.conf that was added in
#203
I guess I need to wait for new release or build from src.

@meichenseer
Copy link
Author

v0.3.8 does still work.

@meichenseer meichenseer changed the title Cannot run wsl-vpnkit with /mnt/wsl/resolv.conf not found Cannot run wsl-vpnkit with /mnt/wsl/resolv.conf not found in v.0.4.0 Apr 17, 2023
@sakai135
Copy link
Owner

I've changed the status of v0.4.1 from preview to latest release. It adds the previously mentioned fallback to /etc/resolv.conf for older WSL versions that don't have /mnt/wsl/resolv.conf and also allows the value to be configurable.

I would recommend keeping the auto-generated /etc/resolv.conf if it works for you. If you manually configure /etc/resolv.conf, you may want to set WSL2_GATEWAY_IP

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