If I boot into the systemd multi-boot.target (instead of graphical.target), I can’t get the snap-store GUI to start under a VNC server (Xtigervnc). If I reboot into graphical.target, I can start snap-store both under the DM as well as the standalone vncserver. So, it seems like something snap-store is doing depends on the system being booted into graphical.target.
Maybe this can be resolved so that snap-store is usable on a headless system?
The only output I see from snap-store is this:
$ snap-store --verbose
No protocol specified
Unable to init server: Could not connect: Connection refused
17:32:59:0072 Gtk cannot open display: :1.0
Assuming you meant multi-user.target I was able to reproduce the issue you describe.
Interestingly it doesn’t seem to be related to confinement, as I installed the snap in devmode and got the same issue.
It’s not related to the systemd boot target, though. Booting into graphical.target, switching to the text console and logging in there and starting a vnc server ends with the same error.
It’s not just the snap-store snap, either: installing xbill-xaw you also get a “cannot open display”.
Something for @zyga-snapd to look into in the morning, perhaps.
I’m seeing a similar issue on a headless machine running Ubuntu 20.04 Server. If a screen, keyboard and mouse are directly connected to the machine, snaps work fine, but over VNC they get the same error that kmksea mentioned. Any thoughts on how to fix?
before running the snap, but I’m worried about the security implications of this. Is there a more secure way to give snaps the proper permissions they need to access the X server?