Firefox is broken on a fresh install of Ubuntu 22.04 LTS (Xubuntu) with Firefox 113.0.2, installed by the now default method, from Snap.
When I try to launch Firefox with a profile that is already running, I get an error:
"Firefox is already running, but is not responding. To use Firefox,
you must first close the existing Firefox process, restart your
device, or use a different profile."
This problem did not exist with Ubuntu 20.04 (where the default install was managed via apt).
Using Firefox on 20.04, my everyday workflow as a knowledge worker involved starting new instances of Firefox with profiles that were already running on other workspaces.
Now when I run Firefox from the terminal I get the following error:
._. firefox -P default "https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1951491"
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
Numerous other reports on the matter suggest that the problem can sometimes be that the environment variable $DBUS_SESSION_BUS_ADDRESS
is not set, and that the fix can involve simply setting this envar to unix:path=/run/user/$DBUS_SESSION_BUS_ADDRESS/bus
. For example, see here, here and here.
My $DBUS_SESSION_BUS_ADDRESS does appear to be set.
._. echo $DBUS_SESSION_BUS_ADDRESS
unix:path=/run/user/1000/bus
._. echo $XDG_RUNTIME_DIR
/run/user/1000
But systemd thinks it is not.
._. sudo systemd --user
Trying to run as user instance, but $XDG_RUNTIME_DIR is not set.
Reports on this problem suggest systemd might be responsible.
But syslog seems to report no problems when Firefox is called. It runs with uid 1000.
When I run SNAPD_DEBUG=1 snap run firefox --profile-manager
, Snap also reports that it is using a uid of 1000 but does appear to be have an error:
ATTENTION: default value of option mesa_glthread overridden by environment.
What can I do to get Firefox working properly from its default Snap install on Ubuntu 22.04 LTS, and launch new windows/instances with profiles that are already running?
I cannot simply close the other running window/instance of Firefox, since that would destroy my workflow. Indeed, I usually have multiple windows open with the same profile on multiple workspaces.
To close the other instance would defeat the object of my attempt to launch Firefox with a profile that is already open.(Thanks to @raffa for the suggestion).
Whether my prior habit of launching Firefox multiple times with profiles that were already running did so in a new window in the same running instance or a new window and new instance makes no difference to me: it worked before; now it does not.