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

搞定

相关推荐
明月醉窗台15 小时前
qt使用笔记六之 Qt Creator、Qt Widgets、Qt Quick 详细解析
开发语言·笔记·qt
R_.L18 小时前
【QT】常用控件(按钮类控件、显示类控件、输入类控件、多元素控件、容器类控件、布局管理器)
开发语言·qt
无小道20 小时前
Qt——常用控件
开发语言·qt
初次见面我叫泰隆21 小时前
Qt——5、Qt系统相关
开发语言·qt·客户端开发
牵牛老人1 天前
【Qt 开发后台服务避坑指南:从库存管理系统开发出现的问题来看后台开发常见问题与解决方案】
开发语言·qt·系统架构
xmRao1 天前
Qt+FFmpeg 实现 PCM 音频转 AAC 编码
qt·ffmpeg·pcm
xmRao1 天前
Qt+FFmpeg 实现录音程序(pcm转wav)
qt·ffmpeg
喜欢喝果茶.1 天前
QOverload<参数列表>::of(&函数名)信号槽
开发语言·qt
wjhx1 天前
QT中对蓝牙权限的申请,整理一下
java·数据库·qt
踏过山河,踏过海1 天前
【qt-查看对应的依赖的一种方法】
qt·visual studio