Firefox fails to run via VNC remote desktop

Hello. A recent Ubuntu update to my headless Twonky server has forced me to use Snaps for the first time. My server is built with an Odroid-XU4 w/ armv7l processor, with a Cloudshell2 interface. I’m running Ubuntu 22.04 LTS (GNU/Linux 5.4.195-404) with snapd ver 2.55.5. I created a login for snap so no sudo command is needed. I successfully installed Firefox 100.0.2-1.

Using my remote desktop, the Firefox shortcut is in the menu but does nothing when clicked. If I attempt to launch Firefox via command line within the remote desktop, this is the result:

dnla@odroid:~$ firefox update.go:85: cannot change mount namespace according to change mount (/run/user/1001/doc/by-app/snap.firefox /run/user/1001/doc none bind,rw,x-snapd.ignore-missing 0 0): cannot inspect "/run/user/1001/doc": lstat /run/user/1001/doc: transport endpoint is not connected Gtk-Message: 10:04:02.892: Failed to load module "appmenu-gtk-module" Client is not authorized to connect to ServerUnable to init server: Could not connect: Connection refused Error: cannot open display: :1

Attempting to start Firefox as sudo results:

dnla@odroid:~$ sudo firefox [sudo] password for dnla: Client is not authorized to connect to ServerUnable to init server: Could not connect: Connection refused Error: cannot open display: :1

Any ideas? Thank you!

Hi, I’ve the same problem after upgrading from 20.04 to 22.04. $ snap connections firefox | grep x11 x11 firefox:x11 :x11

No graphical snap applications (i.e. xeyes) works fine under the vnc session.

This is not actually a problem with the snap but rather with the switch to a default wayland session with 22.04

you’d have to make sure the started session is been forced from the default wayland one to X11 to be able to have a valid session-wide DISPLAY variable … (no idea how you’d do that non-interactively when not doing it from the option at the gdm login screen though)