Cannot run firefox via x2go/mate or x2go/xfce4

Ubuntu Support Template

Ubuntu Version: 24.04

Desktop Environment: MATE or XFCE4 via x2go

Problem Description:

When trying to run firefox it does not start and I get the cryptic error message :

/user.slice/user-1001.slice/session-135.scope is not a snap cgroup for tag snap.firefox.firefox

I could not find any information about this error nor how to make it work, just a hint from an LLM that one cannot use snap programs when logged in via x2go.
I think this has worked in the past and it would be really disastrous if it cannot be made to work any more! This is a server without a display where several people are meant to work remotely and firefox (and potentially other snap apps) will be needed to work.

What to do?

Funny that you can not find anything, for me search for “x2go snap cgroup” immediately gets me:

(The bug linked in that thread might have some hints)

3 Likes

Thanks. I found that thread rather overwhelming but it showed me that many seem to have the same or related issues. I got into some heavy tinkering then and have found a solution that works for me, posted it there.

Will post it here too for easy reference if others have a similar problem.

(Copied from Comment #116 : Bug #1951491 : Bugs : snapd package : Ubuntu )


In my case the reason was that snap could not find the session bus when logging in via an x2go session and apparently creates the scope under the wrong hierarchy.

I fixed this by adding a startup script for X2GO which sets the session bus address if it is not set.

As root/with sudo created file /etc/x2go/Xsession.d/99-fix-dbus.sh with this content:

#!/bin/sh
# Fix DBUS_SESSION_BUS_ADDRESS for snap compatibility under X2Go
if [ -S "/run/user/$(id -u)/bus" ]; then
    export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u)/bus"
fi

And made it executable: sudo chmod 755 /etc/x2go/Xsession.d/99-fix-dbus.sh

Then restarted the x2go server: sudo systemctl restart x2goserver.service

And after this, running firefox did work for me. This hopefully also helps with running other snap-installed programs under x2go.
Perhaps this is helpful for others.

2 Likes

So you’re running Firefox on a remote system? Is this correct?

Yes, as I wrote, “when logged in via x2go”. This happens when I am logged in via x2go over an ssh tunnel. As I wrote in my previous post and in the bug, the solution is to add an X2GO startup script which takes care to let snap know about the session bus address which is different when running over x2go from what snap expects.

If you have an SSH tunnel then you can point the local browser to the tunnel as a proxy. The Web traffic will flow down the tunnel, to the Internet. The Web traffic will flow back to the remote system, back down the tunnel and be displayed on local client. Sleeker that running the browser over x2go… No? Or are the settings set automatically on the client and you cannot change them (Microsoft Group Policy etc)?

I know I can do that, but I am using x2go for remote work doing a lot more than just using the browsers.
Apart from that, I think I have found a solution which I have shared above.

I just think that snap should be more flexible about which session bus it can use and detect this sitation.
Sadly snap in the state it has been in for years and still is, and with all its restrictions, flaws and bugs, was a terrible decision to force upon Ubuntu users. Almost all machines and configurations I have had (and those are probably more than a dozen) at some point had problems showing up because of snap.

This topic was automatically closed after 30 days. New replies are no longer allowed.