mviereck / x11docker

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

Can x11docker run more docker containers with --desktop? #63

Closed wanhongbo closed 6 years ago

wanhongbo commented 6 years ago

Hello, I am trying to run more deepin desktop images with x11docker on one machine. And I am use this command to run the deepin images: sudo x11docker --desktop --systemd --gpu --sudouser --homedir /home/sdk/workspace/sdk -- "--privileged -v /dev/kvm:/dev/kvm" x11docker/deepin I use the private nvidia drivers to support openGL APIs,it is no problem when this command is executed firstly.

But when I opened a another terminal and executed the uppper command again,it failed and the error is like the following shows:

x11docker WARNING: Will run DBus system services as root in container.
  If the image contains malicious applications started by DBus service files,
  they may abuse their root privileges and may try to break out of container.

x11docker ERROR: Error during startup of X server --xorg.
  Last lines of xinit log:
(EE)
Fatal server error:
(EE) no screens found(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE) Please also check the log file at "/var/log/Xorg.11.log" for additional information.
(EE)
(EE) Server terminated with error (1). Closing log file.

The /var/log/Xorg.11.log is like this:

[1711772.409] (==) NVIDIA(0): Depth 24, (==) framebuffer bpp 32
[1711772.409] (==) NVIDIA(0): RGB weight 888
[1711772.409] (==) NVIDIA(0): Default visual is TrueColor
[1711772.409] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
[1711772.409] (**) NVIDIA(0): Enabling 2D acceleration
[1711772.411] (--) NVIDIA(0): Valid display device(s) on GPU-0 at PCI:1:0:0
[1711772.412] (--) NVIDIA(0):     CRT-0
[1711772.412] (--) NVIDIA(0):     DFP-0
[1711772.412] (--) NVIDIA(0):     DFP-1 (boot)
[1711772.412] (--) NVIDIA(0):     DFP-2
[1711772.412] (--) NVIDIA(0):     DFP-3
[1711772.412] (--) NVIDIA(0):     DFP-4
[1711772.412] (--) NVIDIA(0):     DFP-5
[1711772.412] (--) NVIDIA(0):     DFP-6
[1711772.412] (--) NVIDIA(0):     DFP-7
[1711772.414] (II) NVIDIA(0): NVIDIA GPU GeForce GTX 960 (GM206-A) at PCI:1:0:0 (GPU-0)
[1711772.414] (--) NVIDIA(0): Memory: 2097152 kBytes
[1711772.414] (--) NVIDIA(0): VideoBIOS: 84.06.54.00.01
[1711772.414] (II) NVIDIA(0): Detected PCI Express Link width: 16X
[1711772.414] (EE) NVIDIA(GPU-0): Failed to acquire modesetting permission.
[1711772.414] (EE) NVIDIA(0): Failing initialization of X screen 0
[1711772.416] (II) UnloadModule: "nvidia"
[1711772.416] (II) UnloadSubModule: "wfb"
[1711772.416] (II) UnloadSubModule: "fb"
[1711774.613] (EE) intel(G0): [drm] failed to set drm interface version: Permission denied [13].
[1711774.613] (II) intel(G0): [drm] Contents of '/sys/kernel/debug/dri/0/clients':
[1711774.613] (II) intel(G0): [drm]              command   pid dev master a   uid      magic
[1711774.613] (II) intel(G0): [drm]                 Xorg  1296   0   n    y     0          0
[1711774.613] (II) intel(G0): [drm]                 Xorg 12439   0   y    y     0          0
[1711774.613] (II) intel(G0): [drm]                 Xorg 17603   0   n    y     0          0
[1711774.613] (EE) intel(G0): Failed to claim DRM device.
[1711774.613] (II) UnloadModule: "intel"
[1711774.614] (EE) Screen(s) found, but none have a usable configuration.
[1711774.614] (EE)
Fatal server error:
[1711774.614] (EE) no screens found(EE)
[1711774.614] (EE)
Please consult the The X.Org Foundation support

Is there any suggestions?My object is to want to run more desktops in one machine at the same time,Is there any other solution ?Thanks very mych.

mviereck commented 6 years ago

Thank you for reporting!

I often run more than one desktop on more than one tty. In general that is not a problem. (I have an AMD GPU with free radeon driver). I assume there is an issue with NVIDIA driver.

Most probably it would work with free nouveau driver.

I think it should work with proprietary nvidia driver, too. I don't have an idea yet, but will think about it.

wanhongbo commented 6 years ago

Thanks for your information.Just now ,I reboot the machine,it can work successfully,I do not know the rootcause,may be the under system have problem.Any any, it can work now.Thanks

mviereck commented 6 years ago

ok, good! Even on Linux sometimes a reboot solves issues :-)