microsoft / microsoft/wslg

wslg: Can't open display: :0 + X11 server is not running

Open
#558 25 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug GPU
Dominant language
C++
Stars
11.9k
Forks
429
PR merge metrics
No merged PRs in 30d

Description

Environment

Windows build number: Microsoft Windows [Version 10.0.22000.282]
Your Distribution version: Ubuntu 20.04
Your WSLg version: 1.0.26

Steps to reproduce

Problem 1: Can't open display: :0

  1. Update WSL2 (through wsl --update in windows terminal) and before that make sure "Virtual Machine Platform", "Windows Hypervisor Platform" and "Windows Subsystem for Linux" are turned on in Windows Features.
  2. Install Intel GPU driver for WSL (Note: CsProcessors: {Intel(R) Celeron(R) N4000 CPU @ 1.10GHz}, Integrated GPU: {Intel(R) UHD Graphics 600} and no dedicated gpu)
  3. Run sudo apt update && sudo apt upgrade in wsl terminal
  4. Install x11-apps
  5. Run xcalc or xeyes in windows terminal through wsl xeyes. (Note: when I run xeyes on wsl terminal, it just hangs for a long time and not show up any app)

Result: Error: Can't open display: :0

Problem 2: X11-server is not running

  1. Run ls /tmp/.X11-unix

Result: show no results, and thus suspect X11-server not running.

WSL logs:

  • Attach WSLg logs from /mnt/wslg
    You can access the wslg logs using explorer at: \\wsl$\<Distro-Name>\mnt\wslg (e.g.: \\wsl$\Ubuntu-20.04\mnt\wslg)

  • pulseaudio.log
    pulseaudio.log

  • weston.log
    weston.log

  • versions.txt
    versions.txt

Other logs info:

tys@DESKTOP-SDACRC6:/$ echo $DISPLAY
172.26.48.1:0.0

tys@DESKTOP-SDACRC6:~$ ls -la /tmp/.X11-unix
lrwxrwxrwx 1 tys tys 19 Nov  5 10:26 /tmp/.X11-unix -> /mnt/wslg/.X11-unix

tys@DESKTOP-SDACRC6:/mnt/c/Users/tys$ ls -la /tmp/.X11-unix/
total 0
drwxrwxrwx 2 root root  60 Nov  5 10:29 .
drwxrwxrwt 6 root root 260 Nov  5 10:13 ..
lrwxrwxrwx 1 tys  tys   19 Nov  5 10:29 .X11-unix -> /mnt/wslg/.X11-unix

Expected behavior

GUI running without need of other third-party X11-servers such as Vcxsrv.

Actual behavior

Error: Can't open display: :0. Still needs Vcxsrv to open linux gui apps.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the attached pulseaudio.log, weston.log, and versions.txt under /mnt/wslg, then compare DISPLAY with the /tmp/.X11-unix symlink and directory output. Reproduce with xeyes or xcalc after the stated WSL and x11-apps setup; done means identifying why WSLg cannot open the display without Vcxsrv and documenting or fixing that behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, ubuntu
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.