mviereck/x11docker

QT5 issue: could not find or load the Qt platform plugin "xcb"

mviereck opened this issue · 2 comments

Some QT5 applications running with recent QT5 versions fail in docker containers with error message:

This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

Running with QT5 debug option --env QT_DEBUG_PLUGINS=1 shows some more error messages. The important part seems to be:

Cannot allocate memory

Solutions found so far:

  • Use an older QT5 version. For example, QT5 images based on debian stretch work well, while images based on debian buster fail.
  • A quick and dirty fix is to run the container with flag --security-opt seccomp=unconfined. That degrades container security and must not be a general solution.

Related thread: https://forum.qt.io/topic/92783/qt-doesn-t-work-in-my-archlinux-docker

It turns out to be an issue with statx syscall. It is already whitelisted in recent docker versions, but did not reach the distributions yet. It is fixed in docker-ce 18.06, but not in 18.03.

This PR added statx to docker seccomp whitelist: moby/moby#36417
Related SO thread: https://stackoverflow.com/questions/48995826/which-capabilities-are-needed-for-statx-to-stop-giving-eperm

Compare QT5 bug report: https://bugreports.qt.io/browse/QTBUG-70447

Possible solutions for docker versions before 18.06:

Probably there is no Docker version around anymore that is affected by this bug. Closing now.