Run gnome-shell in docker container

I want to run gnome in a docker container, but I get an error when I run gnome-shell.
The message is below。

root@295fba2bebf6:~# DISPLAY=:1 gnome-shell --x11
Xlib:  extension "DPMS" missing on display ":1".
Xlib:  extension "DPMS" missing on display ":1".

(gnome-shell:19530): Gjs-WARNING **: 05:14:42.392: Some code accessed the property 'CredentialManager' on the module 'credentialManager'. That property was defined with 'let' or 'const' inside the module. This was previously supported, but is not correct according to the ES6 standard. Any symbols to be exported from a module must be defined with 'var'. The property access will work as previously for the time being, but please fix your code anyway.

(gnome-shell:19530): Gjs-WARNING **: 05:14:42.440: JS ERROR: Gio.IOErrorEnum: Could not connect: No such file or directory
get system@resource:///org/gnome/gjs/modules/core/overrides/Gio.js:456:24

** Message: 05:14:42.440: Execution of main.js threw exception: Script <main> threw an exception

Who can tell me why this is.

I haven’t tried something like that in a while, but I think you need to bind the system bus into the container so it can talk to logind. Maybe try adding a switch like this to the docker run invocation:

-v /run/dbus:/run/dbus

Not sure if that will work though. Note this may also diminish the security of your docker container if it has access to the system bus.

1 Like

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