Comments (9)
This seems to work:
export DISPLAY=$(ip route | grep default | awk '{print $3}'):0.0
Credit - GPT4o
from wsl.
Weird. I have DISPLAY set as:
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
which currently results in DISPLAY=10.255.255.254:0. I assume this was the same value when all was good but I don't know. With DISPLAY set thusly I am getting the behaviour decribed above.
But...if I get the IP address of the ethernet adapter using ipconfig I get 192.168.0.223. And setting DISPLAY=192.168.0.223:0 makes the X GUI apps work OK again.
I wonder why this is.
from wsl.
Folks you are likely seeing this as we change and upgrade networking in WSL. In the latest WSL versions we turned on DNStunneling
by default which I think is affecting this path.
As others have put in the thread please update your variable to be the logic above instead (Thank you to @Maxim-Mazurok and others who posted their working configs!!).
We had that old string in our docs page which is why folks might be using it (It's also floating around on GitHub somewhere) but we've gone ahead and updated our docs to use the latest working string.
Since this doesn't have any actionable items for the WSL team I'm going to close it out, thank you for filing this! :)
from wsl.
Weird. I have DISPLAY set as:
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2}'):0
which currently results in DISPLAY=10.255.255.254:0. I assume this was the same value when all was good but I don't know. With DISPLAY set thusly I am getting the behaviour decribed above.
But...if I get the IP address of the ethernet adapter using ipconfig I get 192.168.0.223. And setting DISPLAY=192.168.0.223:0 makes the X GUI apps work OK again.
Same behavior here, using X410.
My suspicion is that the problem was introduced by 'Windows 11 Version 23H2 for x64-based Systems (KB5039212)'.
from wsl.
Having the same issue.
DISPLAY=10.255.255.254:0.0
- doesn't work
DISPLAY=172.20.144.1:0.0
- works.
I'm pretty sure that nameserver
in /etc/resolve.conf
used to be 172.20.144.1
.
The 10.255.255.254
address looks new and unexpected to me.
Both me and two of my teammates are having the same issue since recent Windows upgrade.
My Windows system info:
Edition Windows 11 Enterprise
Version 23H2
Installed on 04-May-2023
OS build 22631.3737
Experience Windows Feature Experience Pack 1000.22700.1009.0
WSL info:
WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.3737
from wsl.
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'.
Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1
The scipt will output the path of the log file once done.
Once completed please upload the output files to this Github issue.
Click here for more info on logging
If you choose to email these logs instead of attaching to the bug, please send them to [email protected] with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.
View similar issues
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!
Closed similar issues:
- WSL version: 1.0.3.0: no longer able to use external X server with Windows 10 (20H2) (#9541), similarity score: 0.74
- wslg
cannot open display
if wsl started with Task Scheduler (#8217), similarity score: 0.74 - wslg not working on windows 11 (#9206), similarity score: 0.71
- WSL2 Windows 11 suddenly cannot open display (#7950), similarity score: 0.71
- X Windows broken on fast ring WSL2 (?) (#5106), similarity score: 0.70
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
from wsl.
The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running.
Diagnostic information
Issue was edited and new log file was found: https://github.com/user-attachments/files/15840842/WslLogs-2024-06-14_17-10-15.zip
Detected appx version: 2.2.4.0
Found no WSL traces in the logs
from wsl.
Logs added.
from wsl.
export DISPLAY=$(ip route | grep default | awk '{print $3}'):0.0
Maxim
's solution seems to work. And the interpretation is given by bobf32
.
ip route
will give the right ip, while /etc/resolv.conf
will not.
from wsl.
Related Issues (20)
- Register WSL without importing HOT 5
- wsl --update错误。查看了https://github.com/microsoft/WSL/discussions/8383, 但是我无法更改系统设置 HOT 3
- SSH connection hangs and stops responding after some time, effectively freezing WSL HOT 5
- Disk Letter description Changed and Ubuntu disk appeared in Task Manager When Using a File Outside of WSL HOT 2
- Can't show SDL window HOT 4
- we need to restricting root access for users using WSL2. HOT 4
- Suspect installed Windows 11 June 11, 2024—KB5039212 (OS Builds 22621.3737 and 22631.3737) cause the WSL can't access host's TCP port HOT 2
- Enabling systemd should automatically set / to shared HOT 3
- WslRegisterDistribution failed with error: 0x8007023e HOT 6
- /etc/hosts not getting generated with the contents of the windows hosts file HOT 7
- Unable to connect to server on Windows from WSL HOT 3
- Multiple BadZipFile errors while installing any project HOT 4
- mouse problem HOT 2
- Mouse in games HOT 2
- plz Support all still supported OSes!!1 HOT 2
- Unable to start Ubuntu HOT 1
- Terminal text goes invisible after running the stopping docker-compose in foreground HOT 3
- WSL 2 kernel file is not found - Installing: Windows Subsystem for Linux - Catastrophic failure HOT 1
- default DNS server has some problems with Github Copilot extension in VSCode in WSL when using fixed internet HOT 6
- when networkingMode=mirrored, windows can't request the k8s service(nodePort), but it's ok on wsl . HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wsl.