Cannot find wayland-0 socket under non-root user

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Cannot find wayland-0 socket under non-root user

跳至解决方案
16,234 次查看
pgentili
Contributor III

Hi,

I'm trying to launch a GUI application on my system (iMX8MM, Yocto Sumo) without root permissions.

When I login with my non-root user I have this situation:

  • XDG_RUNTIME_DIR = /run/user/1000
  • wayland-0 does not exists inside /run/user/1000
  • When I try to open any gui aplication I get: failed to connect to Wayland display: No such file or directory
    failed to create display: No such file or directory

The only way I've found to make it work is to chmod /run/user/0 and /run/user/0/wayland-0 and then set XDG_RUNTIME_DIR to /run/user/0. The problem is that the wayland-0 under /run/user/0 is not created until a user login (or at least it seems like that) so I cannot write a systemd service to chmod the directory and the file.

I don't think it is supposed to work this way, what do you think? How should I do it?

Thanks

Paolo Gentili

标记 (4)
1 解答
16,122 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Paolo,

  There is no better way to solve it,  we will have to change it manually. See these 2 links, please!

1.Weston on RPi: running as non-root 

--Non-root user doesn't have permission to connect to Wayland socket.

2. [SPEC-546] Run weston with dedicated 'display' user and group - Automotive Linux 

It is also a kind of way to add user to display group.

Hope above information is helpful to you!

Have a great day!

B.R,

Weidong

在原帖中查看解决方案

1 回复
16,123 次查看
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Paolo,

  There is no better way to solve it,  we will have to change it manually. See these 2 links, please!

1.Weston on RPi: running as non-root 

--Non-root user doesn't have permission to connect to Wayland socket.

2. [SPEC-546] Run weston with dedicated 'display' user and group - Automotive Linux 

It is also a kind of way to add user to display group.

Hope above information is helpful to you!

Have a great day!

B.R,

Weidong