[GH-ISSUE #42] Update README.md to calculate 'Win Host IP Addr' without /etc/resolv.conf (for DISPLAY env variable) #37

Closed
opened 2026-03-04 12:24:08 +03:00 by kerem · 1 comment
Owner

Originally created by @ryeleo on GitHub (Jul 14, 2021).
Original GitHub issue: https://github.com/cascadium/wsl-windows-toolbar-launcher/issues/42

I recently had to update my /etc/resolv.conf to include a proper DNS server -- this resolved an issue I was struggling with in my Network. This had the unfortunate result of breaking my DISPLAY environment variable for wsl-windows-toolbar!

I recommend updating the README.md to include the following example for calculating own IP Address. I think this should work well for all wsl folks -- I've only tested on my WSL2 Ubuntu 20.04 so far:

export DISPLAY=$(ip route show | grep 'via.*eth0' | cut -d' ' -f3):0.0

I hope this is a more resilient solution for folks, but I'm unsure if it is a stable alternative to using /etc/resolv.conf. What do you think?

Originally created by @ryeleo on GitHub (Jul 14, 2021). Original GitHub issue: https://github.com/cascadium/wsl-windows-toolbar-launcher/issues/42 I recently had to update my `/etc/resolv.conf` to include a proper DNS server -- this resolved an issue I was struggling with in my Network. This had the unfortunate result of breaking my DISPLAY environment variable for wsl-windows-toolbar! I recommend updating the README.md to include the following example for calculating own IP Address. I think this should work well for *all* wsl folks -- I've only tested on my WSL2 Ubuntu 20.04 so far: ``` export DISPLAY=$(ip route show | grep 'via.*eth0' | cut -d' ' -f3):0.0 ``` I hope this is a more resilient solution for folks, but I'm unsure if it is a *stable* alternative to using /etc/resolv.conf. What do you think?
kerem closed this issue 2026-03-04 12:24:08 +03:00
Author
Owner

@fquinner commented on GitHub (Jan 5, 2022):

I think we're actually fine without this because the example provided was only really an example. I have seen literally hundreds of commands to do this, each of which have their pros and cons (for example, your example assumes grep=egrep but that's not the case for all distros). I think what we have is probably fine as a starting point under the assumption that mileage may vary depending on the distro / wsl configuration / customization.

<!-- gh-comment-id:1005810271 --> @fquinner commented on GitHub (Jan 5, 2022): I think we're actually fine without this because the example provided was only really an example. I have seen literally hundreds of commands to do this, each of which have their pros and cons (for example, your example assumes grep=egrep but that's not the case for all distros). I think what we have is probably fine as a starting point under the assumption that mileage may vary depending on the distro / wsl configuration / customization.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/wsl-windows-toolbar-launcher#37
No description provided.