Simos, thanks for the article. I followed the steps and it worked seamlessly on my Lubuntu host. However, when I transferred my container to openSUSE KDE Plasma, I didn’t manage to connect to the host X server. The X server responds with “No protocol specified” message. I checked all permissions to the socket /tmp/.X11-unix/X0 and the authorization. Everything was as expected.
Then I ran Xephyr in a window on my host system and assigned it :3 socket. I shared /tmp/.X11-unix/X3 with the container and it worked fine. I think it’s related to the way openSUSE configures X server. It’s different from Ubuntu and Xephyr. The x server process is executed from sddm.
I thought it was because of the snap isolation and even compiled LXD from source and got the same problem. I ran strace xclock and it seems the app connects to the socket but then the server responds with “no protocol specified” and xclock stops.
Running it through Xephyr is acceptable but not ideal. I would appreciate any help. In which way can openSUSE x server be different from the other two?