ThinLinc on Ubuntu 22.04 refuses to open Snap apps saying "cannot open display"

Hi there

I’m struggling with ThinLinc server running on a virtual Ubuntu machine. Some people asked me for help because they wanted to install ThinLinc on Ubuntu (I’m an openSUSE user) and then I installed a virtual Ubuntu 22.04 machine (using kvm/qemu) and installed ThinLinc server on it.

First problem was that “Click to Install.desktop” did not work, I had to manually run ./install-server script from the terminal (maybe one thing that the Ubuntu users were missing). But ok, installed it, ran tl-setup and everything seemed to be OK.

Then, I started ThinLinc client from the host machine, connected to the virtual Ubuntu machine. Firefox did not start, neither other software that were installed through SNAP (it seems that Ubuntu decided that many software should not come from the distro’s repo anymore, instead, they should be now installed from the snap store, along with everything that they would need).

Running firefox from the command says: “Error: cannot open display: :10” And so does snap-store and any other program installed from snap.

I’ve searched the internet and found some bug reports: It seems that systems that use wayland by default won’t open software installed through snap on a Xorg session. Here are some links:
https://bugs.launchpad.net/ubuntu/+source/gnome-session/+bug/1965113

https://www.reddit.com/r/Ubuntu/comments/qrwio0/cannot_open_display_0_for_firefox_and_snap_store/

Unfortunately, I couldn’t see any workaround… Some people suggested a simple reboot, some people suggested that it only occurs if you enter a wayland session, then start a xorg session, some people reinstalled snapd… but in my case, none have worked. I also tried to clear all snap related config from the user, tried to create a new user, tried to change from gdm3 to lightdm, tried to disable wayland, tried to use a xfce session…

So, I’ve seen this video here https://www.youtube.com/watch?v=9prhMCiURyg and his firefox is working under ThinLinc…

So, is there any suggestion? If you could try to reproduce it, I just followed these steps here:

  1. Install Ubuntu 22.04 (and updates until 13/july/2022) (VirtualMachine using virt-manager kvm/qemu)
  2. Install openssh-server
  3. Install ThinLinc server 4.14.0
  4. Connect from the host directly to the VM’s IP using both ThinLinc client or using web client
  5. Everything that is not from snap works, snap softwares claim that they can’t open display.

It seems like a known bug involving snap software, wayland and remote access/xorg, but why people could workaround (or got it working straight from the installation) and I couldn’t?

If you need more details, please, let me know.

Hi @VirusABC

This is a known issue in Snap. See: 7788 – Snap applications does not work inside ThinLinc session

The current solution would be to install applications from the package repository rather than through Snap. On Ubuntu this can be done using apt.

1 Like

Hi @aaron , Thanks for your answer. I’ve seen a brazilian youtuber installing ThinLinc on Ubuntu and at 8:43 he clicked Firefox and it didn’t work… I guess that he just forgot that he clicked it :smiley: https://youtu.be/L_gA-fRfBV4?t=523

I thought that it would be the only answer to install the non-snap software… but then I saw the “Average Linux User”'s video https://youtu.be/9prhMCiURyg?t=421 and on 7:01 he clicks Firefox and it opens… I know that he might have swapped the snap version, but since I saw some other people working around it (reinstalling snapd or rebooting…)

Anyway, thanks for pointing me to a better bug report, I’ll keep that in mind when answering people that asked me.

Just a note @aaron : running

apt remove snapd

will remove Snap and all installed software through it… but

apt install firefox

will install snap and will install firefox from snap… The way would be to download the .deb package from the website I think.

@VirusABC yes, you’re right. It looks like Firefox is only available as a Snap in Ubuntu.

There are a number of tutorials online on how to disable Snap in Ubuntu, and Mozilla has a repository which you could add to your system for Firefox.

1 Like

Just an update about this issue: Flatpak Firefox works like a charm:

Uninstall Snap firefox;
Install flatpak;
Configure flatpak;
Install Firefox using flatpak;
Logout and login to see Firefox on the programs list.