mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.62k stars 378 forks source link

Dbus dependency question #408

Closed CicadaSeventeen closed 2 years ago

CicadaSeventeen commented 2 years ago

I wonder whether things like xfce or mate need dbus. In the examples of x11docker, xfce and mate do not use --dbus or --hostdbus option as gnome does. It seems that they do not rely on dbus. On the other hand, dbus-x11 is installed in your image, which indicates that dbus is needed.


When I tried to test containers by chroot, I found not only xfce and mate, but even like firefox and chromium failed to start. Meanwhile, smaller GUI programmes like xterm or thunar worked. mate error info told me it is a dbus problem, some experienced guy suggested me to check debus too. So I tried to use unset DBUS_SESSION_BUS_ADDRESS before starting programmes. (env is from host system) Then everything became OK. I can use Firefox now and xfce or mate work.


It seems that dbus plays an important role for things like xfce. However, --dbus option is not used in x11docker for it. I wonder why.

mviereck commented 2 years ago

It seems that dbus plays an important role for things like xfce. However, --dbus option is not used in x11docker for it. I wonder why.

dbus in Xfce is needed if starting Xfce applications in Wayland. Fo example x11docker --wayland x11docker/xfce xfce4-terminal will use dbus internally. I assume that dbus is also started by startxfce4, though I did not check that. Mate will at least use dbus if started with option --init=systemd.

Basically dbus serves for communication between processes.

CicadaSeventeen commented 2 years ago

So I think mate and xfce can work without --dbus. The absent of dbus service does not make fatal error, so you do not use --dbus option in your examples. On the other hand, Gnome and Cinnamon will crash without dbus. However, for mate and xfce, some function of them may need --dbus. Is my understanding basically correct ?

mviereck commented 2 years ago

Is my understanding basically correct ?

Yes. Option --dbus is rarely needed directly. Most often desktops run dbus themself if they need it.