I’ve set up an LXD/LXC container in Ubuntu and can’t get GUI SNAPs to run in the container (which is also Ubuntu), I believe there is an issue accessing the display. X11 “deb” apps work fine after tweaking a few settings as described in the very helpful article https://blog.simos.info/how-to-run-graphics-accelerated-gui-apps-in-lxd-containers-on-your-ubuntu-desktop/, but SNAPs do not.
When starting notepadqq or firefox I get ln errors such as:
ln: failed to create symbolic link ‘/home/ubuntu/snap/notepadqq/841/snap/notepadqq/841/Documents’: No such file or directory
ln: failed to create symbolic link ‘/home/ubuntu/snap/notepadqq/841/snap/notepadqq/841/Desktop’: No such file or directory
ln: failed to create symbolic link ‘/home/ubuntu/snap/notepadqq/841/snap/notepadqq/841/Downloads’: No such file or directory
ln: failed to create symbolic link ‘/home/ubuntu/snap/notepadqq/841/snap/notepadqq/841/Music’: No such file or directory
ln: failed to create symbolic link ‘/home/ubuntu/snap/notepadqq/841/snap/notepadqq/841/Pictures’: No such file or directory
ln: failed to create symbolic link ‘/home/ubuntu/snap/notepadqq/841/snap/notepadqq/841/Videos’: No such file or directory
ln: failed to create symbolic link ‘/home/ubuntu/snap/notepadqq/841/snap/notepadqq/841/Templates’: No such file or directory
Then the gui window does not display and the app eventually gets this error:
QXcbConnection: Could not connect to display :0
Aborted (core dumped)
x11 apps (such as firefox) work fine if installed with apt.
The host is running Ubuntu 18.04 and so is the container.
dmesg shows this error for notepadqq:
[349363.925230] audit: type=1107 audit(1527123518.868:1456): pid=516 uid=103 auid=4294967295 ses=4294967295 msg='apparmor=“DENIED” operation=“dbus_signal” bus=“system” path="/org/freedesktop/NetworkManager/ActiveConnection/7" interface=“org.freedesktop.NetworkManager.Connection.Active” member=“PropertiesChanged” name=":1.10" mask=“receive” pid=25488 label=“snap.notepadqq.notepadqq” peer_pid=545 peer_label=“unconfined”