本文主要是介绍qt.qpa.xcb: could not connect to display 0,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
问题
docker中启动rviz有问题
$ rviz
qt.qpa.xcb: could not connect to display 0
qt.qpa.plugin: Could not load the Qt platform plugin “xcb” in “” even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
Aborted (core dumped)
原来是display不对,估计是之前重装nvidia的驱动,使得display搞错了。在host机器上看下display是多少。
echo ${DISPLAY}
:1
在容器中将display设置为:1
export DISPALY:=1
rviz
搞定
这篇关于qt.qpa.xcb: could not connect to display 0的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!