wslg icon indicating copy to clipboard operation
wslg copied to clipboard

Cannot open display :0.0

Open yltx opened this issue 1 year ago • 3 comments

Is your feature request related to a problem:

No response

Describe the solution you'd like:

I don't know.

Describe alternatives you've considered:

I don't know.

Additional context:

weston.log ~_AOAM9)~J38PBU30QZ1K

yltx@yltx:~$ cat /mnt/wslg/versions.txt
WSLg (x86_64): 1.0.61+Branch.main.Sha.54f177d201aecda01347f952e01777c75480fc74
Built at: Tue Apr 2 20:52:28 UTC 2024
Mariner: VERSION="2.0.20240112"
DirectX-Headers:
mesa:
pulseaudio: 6f045ff0dca233a939a2aba815f84d177e294122
FreeRDP: c4030980b29322a9cb2190711a5fadeeeb8b6a33
weston: f227edd681479ec3cb2290a25d84d2d3462aebfa
yltx@yltx:~$ echo $DISPLAY
:0.0
yltx@yltx:~$ ls -la /tmp/.X11-unix
总计 0
drwxrwxrwt  2 root root  40  7 月 31 17:59 .
drwxrwxrwt 12 root root 240  7 月 31 20:15 ..
yltx@yltx:~$ ls -la /tmp/.X11-unix/
总计 0
drwxrwxrwt  2 root root  40  7 月 31 17:59 .
drwxrwxrwt 12 root root 240  7 月 31 20:15 ..

yltx avatar Aug 03 '24 15:08 yltx

One not directly relevant comment: This is a bug report but is posted as a feature request because the bug report template contains an error and is therefore no longer available since the last update a month ago. Please fix the template as well.

image

GhostScript0r avatar Aug 26 '24 08:08 GhostScript0r

One not directly relevant comment: This is a bug report but is posted as a feature request because the bug report template contains an error and is therefore no longer available since the last update a month ago. Please fix the template as well.

image

In fact,you don't even have the tag for bug issue.

yltx avatar Aug 26 '24 13:08 yltx

ubuntu22.04的wslg是基于systemd的一个bug运行起来的,24.04使用的systemd没有这个bug了反而用不了了,可以使用wslg-links来解决这个问题。#1244

The WSLg in Ubuntu 22.04 runs on a bug related to systemd, while the systemd used in 24.04 no longer has this bug. You can use this wslg-links to resolve this issue temporary. #1244

另外, 如果你是直接安装的24.04版本,还有另一个问题 WSL/issues/468 wslg只对UID=1000的用户生效,直接安装的ubuntu24.04版本默认ubuntu用户的UID为1000(/mnt/wslg/runtime-dir权限决定),导致wsl创建的用户无法使用wslg。 可以使用回复中提到的方法,手动编辑/etc/passwd对调UID,再使用chown切换家目录的所有者。

Besides, if you're using freshly-installed ubuntu 24.04 version, there's another issue mentioned in WSL/issues/468 . You can use the method mentioned in the replies to the issue.

Maybe there is only unstable and insecure method:

manually edit /etc/passwd to swap uid chown uid for home of swapped user

ghost avatar Sep 06 '24 05:09 ghost