-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Default X Server IP config not working, but alternate value does. #184
Comments
I just had the same issue, and adding these lines instead to my profile fixed it for me:
This is adapted from the solution here: microsoft/WSL#11698 (comment). Apparently a recent WSL update changed the way DNS works and |
@ckeeney @KMohZaid Thank you for working on this, and thank you for noticing Microsoft's documentation update, @creinker. We want to make sure all guest platforms are supported, and @Pololot64 and I are concerned about the portability of the |
Yes I was planning to update logging system later, also i didn't knew that ip command is not same in all linux OS |
Wsl Beauty fix the issue We can use ipconfig.exe in wsl is the way, if |
Good find @KMohZaid. It seems ipconfig comes with Windows, so if we can invoke that from within GWSL that's a great fallback. I suggest we break the fix down into the following stages (separate PRs):
Could you make a PR for the change to use |
Be careful with ipconfig. Make sure you don't parse it in a way sensitive to regional differences. I know this method was tried in the past. It is worth testing the other solution in more distros first. Unless @JosiahWI you know that ip doesn't work for them. There may be a closed issue related to this. Edit: see this #9 To make sure we don't create this issue again. |
We will want to make sure not to rely on ipconfig being in |
I think ipconfig should always be in the path unless it is a misconfigured distro. Worth double checking ofc. It is easy to point to the direct location. |
I can try it if I get time |
Yes, window is sharing it's path env with wsl distro path env |
if ipconfig not in path variable then we can use static parth
and maybe now we dont need of anything else? window Edited : issue if window installation drive letter is not
we can use cut to get any binary if multiple window installation is there, Or have own ipconfig.exe bundled together? |
Getting any binary is fine at this point. There should always be one, so I don't think we need to bundle our own. We might eventually want to revisit that if there are significant differences in output between versions if ipconfig.exe that inhibit parsing. |
i was and will be unable to add commits here for some time, busy with some other works (in private repo) |
This can be assigned to me. |
Appreciate |
Here is my current idea for a way forward. We can add a button for exporting in the "new way". Then I can do a message on update that says "be sure to press this button if things have broken". That might be the only way atm |
Btw, you can test for the if command -v ip >/dev/null
then
DISPLAY="$(ip route show default | awk '{print $3; exit;}')"
else
DISPLAY="$(netstat -rn | awk '/default/ { print $2; exit; }' )"
fi Personally, I would do this rather than relying on the less-trivial-to-parse output of a Windows executable. That way you're minimizing dependencies: distro just needs its out-of-the-box standard native functionality, parsing same output format that scripts have been relying on for years (closer to half a century in the case of But to add some technical clarity: we can confidently predict a BSD will never run in WSL. They're too non-interchangeable. Linux has an entirely different kernel from the BSDs, each has many system calls and internal details that the other doesn't, etc. The different BSDs are also less plug-and-play than Linux distros on a Linux kernel are - Microsoft can build and ship one WSL-compatible Linux kernel and layer distro's file systems on top, but BSDs are developed in a more coupled way, where their libc and stock utilities make assumptions about that BSD's current kernel, etc. So BSDs simply can't be WSL guests, due to deep technical differences, and we can forecast that none of this will ever need to work on a BSD. The only reason to not just use |
Are you all using VPNs? I think I have reproduced the issue by using a VPN on the Windows host. I think this is a prerequisite for reproducing the issue. |
@ckeeney I have a question, were you using a VPN? |
Whoops great minds think alike @JosiahWI |
I was not using a VPN. I don't even have one I could be using on accident. |
I'm also not using any VPN. |
Update : i got addicted to linux, i thought i could use window on external hdd but i can't So this way I will have 80gb free for window partition, than after installing window I can try and contribute to this repo It will take time, i can't specify how much. I may also forgets about this project. @JosiahWI appreciate if you taking over |
Thank you for the update, @KMohZaid. I am using the WSL2 OpenSUSE and have not had any issues with networking. I don't want to use more disk space to install a second WSL. Thus, I have been unable to reproduce the issue. |
If I use the "GWSL Distro Tools" -> "Display/Audio Auto-Exporting", it adds the following lines to my profile:
/etc/resolv.conf
is a symlink to/mnt/wsl/resolv.conf
, and the contents of that file are:The contents of
/etc/wsl.conf
are:The XClock app in the about menu properly loads for me, but
jetbrains-toolbox
is unable to connect to my X Server.However, when I run
ipconfig
from my Windows terminal, I see aEthernet adapter vEthernet (WSL (Hyper-V firewall)):
with IP172.22.112.1
. If I use this setDISPLAY
to this IP,jetbrains-toolbox
loads fine. However, I do not see this IP address listed when I typeifconfig
from WSL, and I do not know how to otherwise find this IP address programmatically. I could hardcode theDISPLAY
andPULSE_SEVER
variables to this IP, and maybe that IP never changes, but this still feels kind of dirty.I have a few questions:
/etc/resolv./conf
The text was updated successfully, but these errors were encountered: