I did a clean install of 24.04.1 . Things were fine for a few days. Then a dialog box came up saying something to the effect that there were a few additions to be installed. So I triggered the install. When it rebooted, it came up in raw terminal display (this seems to be a bug in the ubuntu additions install) for tty1. To get the GUI back I did:
XDG_SESSION_TYPE=wayland dbus-run-session gnome-session
This resulted in a very odd partial GUI, so I ended up doing:
sudo dpkg-reconfigure gdm3
sudo service gdm3 start
and reboot. Then it came up in the standard ubuntu GUI and applications I tried seemed to work, everything seemed good, except for firefox. On trying to launch it in the terminal, it gives:
$ firefox
Gtk-Message: Not loading module "atk-bridge": The functionality is
provided by GTK natively. Please try to not load it.
Error: cannot open display: :0
It looks like in my attempt to get a GUI back, I messed up something with the display. Note that:
$ echo $XDG_SESSION_TYPE
wayland
and this problem occurs whether starting the snap or the deb version of firefox. Any help would be appreciated.