docker-pyqt5 icon indicating copy to clipboard operation
docker-pyqt5 copied to clipboard

Error: Root user could not connect to display

Open Huong-nt opened this issue 4 years ago • 3 comments

Hi,

I try to run Qt5 application with Docker, when I run with qtuser it works well. However, when I try to run with the root user, I got the error

''' Got keys from plugin meta data ("xcb") QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ... QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root' loaded library "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so" No protocol specified qt.qpa.screen: QXcbConnection: Could not connect to display :0 Could not connect to any X display. QLibraryPrivate::unload succeeded on "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so" '''

I already add the root user to the audio group. How can I run Qt5 application with the root user? My environment is ubuntu 18.04 in Jetson Nano Dev Kit

Thank you!

Huong-nt avatar Jul 05 '21 08:07 Huong-nt

Hi, I don't know solution for this. If you find one, please share it here with others.

jozo avatar Jul 06 '21 09:07 jozo

weird... I create a new user named qt and add it into audio group, this error keeps showing. I use same operation to create a user named qtuser, it works...

acmol avatar Jan 25 '22 07:01 acmol

weird... I create a new user named qt and add it into audio group, this error keeps showing. I use same operation to create a user named qtuser, it works...

I retried my steps and found out that, if one user runs successfully, the other users will fail to run, even if it's not root.

acmol avatar Jan 25 '22 07:01 acmol