Switching from Xorg to Wayland

Hello,

I’m trying to switch an unprivileged container working perfectly with X to Wayland. (I am using lxc 3.0.0 and Plasma)

So, I adapted my config as follows:

#lxc.mount.entry = /tmp/.X11-unix mnt/X11-unix tmpfs bind,none,create=dir 0 0
lxc.mount.entry =  /run/user/1001/wayland-0 tmp/wayland-0 none bind,ro,create=file

Alas, during the start, I encountered the following error :

lxc-start steam 20191103110640.437 ERROR    utils - utils.c:safe_mount:1187 - Permission denied - Failed to mount "/run/user/1001/wayland-0" onto "/usr/local/lib/lxc/rootfs/tmp/wayland-0"
lxc-start steam 20191103110640.437 ERROR    conf - conf.c:mount_entry:2044 - Permission denied - Failed to mount "/run/user/1001/wayland-0" on "/usr/local/lib/lxc/rootfs/tmp/wayland-0"

On the host, I have got user id 1001.

[uu@host1 ~] ls -l /run/user/1001/wayland-0
srwxr-xr-x 1 uu uu 0  3 nov.  11:53 /run/user/1001/wayland-0

What’s happened ? Any suggestion is welcome.

bk

1 Like

A temporary ugly workaround :

[uu@host ~] sudo chmod 757 /run/user/1001
[uu@host ~] sudo chmod 757 /run/user/1001/wayland-0

My user uu is 1001 on host and 1000 on my unprivileged container.
Maybe a better way is using lxc.idmap rule.

So sharing just the Wayland socket (no Xwayland required) you can get the container apps to show up on the host.

While Wayland-only distro are you using?

I’m using ArchLinux, both on host and container. For the moment, I can’t do without Xwayland. In any case, I have not tried to do without it.

If you are using Xwayland, why would you need to expose the Wayland Unix socket to the container?
Does the same socket speak X11 and Wayland as well? (This is a Wayland question).

I’m not capable answering you. I can just say, under wayland I don’t have any X11 socket (/tmp/.X11-unix/X0) and not mounting the wayland socket, avoid me starting any gui app. Not sure I am answering your question.

I strongly inspired by :
https://gist.github.com/stueja/447bd3bc0d510a0a7e50f9f1ef58ad75