Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
User interface 在Ubuntu的Docker中运行GUI程序_User Interface_Ubuntu_Docker - Fatal编程技术网

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或指令你应该打开一个新的线程并放置所有的命令和消息