mviereck / x11docker

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

What is x11docker doing differently? #513

Closed atar-axis closed 3 months ago

atar-axis commented 9 months ago

Hey! I am having a problem and I hope one of the experts here can help me.

Having a host with Nvidia drivers, and one with mesa drivers. x11docker with --hostdisplay runs fine on both. But sharing the following does not when running podman directly, at least not on the nvidia machine (on the other it works):

  --env DISPLAY \
  --env XAUTHORITY \
  --env XSOCKET \
  --env XDG_RUNTIME_DIR \

On the nvidia host podman complains about missing fbConfig or visuals:

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig for QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize -1, redBufferSize 1, greenBufferSize 1, blueBufferSize 1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::SingleBuffer, swapInterval 1, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile)

So, what is x11docker doing differently? Also tried to run x11docker first and then shared with the container what --printenv prints. Same thing, works on my machine but not on the nvidia machine.

I tried to set -x in x11docker to see what it does but man, is that complex!

atar-axis commented 9 months ago

Found the issue, for whatever reason I had to install the nvidia-384 drivers inside the docker as well. Any idea why that is? Btw, xClock worked even without.

mviereck commented 3 months ago

Great that you found the solution yourself!