User interface 在Ubuntu的Docker中运行GUI程序
我曾经使用如下命令运行程序:User interface 在Ubuntu的Docker中运行GUI程序,user-interface,ubuntu,docker,User Interface,Ubuntu,Docker,我曾经使用如下命令运行程序: docker run -ti \ --name wireshark \ -e DISPLAY=$DISPLAY \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -v $HOME/.Xauthority:/root/.Xauthority \ --privileged \ -d ubuntu:17.10 /bin/bash 然后我可以使用我的Ubuntu系统的显示器运行wireshark。 如本页的示例所示: 现在它不起作用了。运行
docker run -ti \
--name wireshark \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $HOME/.Xauthority:/root/.Xauthority \
--privileged \
-d ubuntu:17.10 /bin/bash
然后我可以使用我的Ubuntu系统的显示器运行wireshark。
如本页的示例所示:
现在它不起作用了。运行wireshark时,出现以下错误:
root@5ad127a8333a:/# wireshark
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
No protocol specified
QXcbConnection: Could not connect to display :0
Aborted (core dumped)
有可能通过以下方法解决此问题:
xhost+
但这样做是明智的
xhost-
在您不再使用此容器之后
事实上,限制性更强
xhost+local:docker
足够好了。你知道为什么我以前的方式不再有效了吗?我忘记了提到param(-v$HOME/.Xauthority:/root/.Xauthority)我以前遇到过的方式我也遇到过同样的问题,你能不能请你再写一次完整的cmd或指令你应该打开一个新的线程并放置所有的命令和消息