[mutter] Application takes time to start on X11

I’m doing basic tests with mutter

On Debian 12 (bookworm) install the packages:

apt install mutter xorg gnome-console

I then create the .xinitrc file to run mutter and a terminal emulator

mutter --x11 &
exec kgx # gnome-console

The problem is that gnome-console takes 40-50 seconds to start.

If I change the emulator to ‘lxterminal’ it opens immediately.

I tried creating and compiling a basic GTK4 application and the same thing happens: it takes a while to start.

Once mutter and gnome-console are loaded, applications (such as thunar or firefox) will take between 20-30 seconds to start.


Running mutter under wayland I have no problems, the application loads immediately:

dbus-run-session mutter --wayland kgx

I am doing the tests in a virtual machine with QEMU.

Am I misusing ‘mutter’ or could I be missing some configuration?

I appreciate any help. Thank you.

I suggest capturing a backtrace with gdb after about 10 or 20 seconds. It’s much better if you also install the debug package for GLib

bash> gdb -p <PID>
gdb> thread apply all bt
gdb> quit

You also need to start a dbus session when using X11.

2 Likes

Well. It seems there is the answer. change the .xinitrc to:

mutter --x11 &
exec dbus-run-session -- kgx # gnome-console

and it seems to be working well. thank you.

Did you mean it to debug ‘mutter’ or the application to be executed?

Running dbus-run-session this way only runs it so that the relevant environment variables are set for that terminal, but not mutter itself. It’s probably not going to be a big issue since from the file it looks like you are using the terminal to start everything else, so these would inherit the correct variables from the terminal, but it might prevent dbus communication with mutter if you are trying to change the resolution this way.

You would need to use dbus-run-session when starting X11 to have the environment variables also set for mutter.

Yeah. Ideally, dbus-run-session executes a main program such as ‘gnome-shell’ so that it is valid throughout the session.