jozo / docker-pyqt5

Dockerfile for development of GUI applications with Python 3 + PyQt5
84 stars 24 forks source link

Error: Root user could not connect to display #8

Open Huong-nt opened 3 years ago

Huong-nt commented 3 years ago

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!

jozo commented 3 years ago

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

acmol commented 2 years ago

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 commented 2 years ago

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.