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

Support manually configured resolv.conf #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hmnd
Copy link

@hmnd hmnd commented Oct 9, 2021

GWSL currently relies on WSL automatically setting the default gateway IP in /etc/resolv.conf. /etc/resolv.conf cannot be relied upon in cases where a user has set network.generateResolvConf = false in their /etc/wsl.conf, in order to override their /etc/resolv.conf (eg. microsoft/WSL#5336).

This PR uses ip route show default to get the default gateway IP instead.

Possibly resolve #97 too.

@Pololot64
Copy link
Member

Hey hmnd. Thanks for the PR. This is a good idea but unfortunately I have already tried pushing a change like this and it broke more than it fixed. At this point I doubt that there is a one size fits all solution. The current solution seems to fit most configurations. The best fit for a change like this may be in the manual for people to adjust their configurations if need be.

However, it is true that I do not understand WSL networking completely. I think it is wise to stay on the safe side.

@Random-Eric
Copy link

FYI as a VPN user on Windows 10, I had to edit my /etc/resolv.conf and /etc/wsl.conf as described above, and it took me a long while to figure out why GWSL was not working. Maybe use an if statement to apply the IP lookup method only if network.generateResolvConf = false, otherwise use the "cat /etc/resolv.conf " method?

@Pololot64
Copy link
Member

The problem is that I don't think I know enough to be sure that this will be a sure way to know what GWSL should do. Especially since there are endless ways to change setting like this...

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 this pull request may close these issues.

Issues with opening UI apps, display export problem?
3 participants