How to run graphics-accelerated GUI apps: "no protocol specified" when accessing the X server openSUSE host and openSUSE container

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?

There are things that you need to do again on the new host.
Can you verify that you did those on the new host (openSUSE KDE Plasma)?
For example, those lxc config device add guiapps … commands.

Yes, I did them, including lxc config device add. I followed your instructions again on the host. Here is a link to the container configuration: https://github.com/lxc/lxd/files/1495456/conteiner-info.txt

The container configuration looks fine.
The difference between Xephyr and OpenSUSE’s X.Org is that the later requires graphics acceleration libraries. There could be a mismatch between what is in the container and what is provided in the OpenSUSE host.