我以前用这样的命令运行程序:
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。 喜欢这个页面的例子:Running GUI App with docker
现在不行了。当我运行 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
够了
关于user-interface - 在 Ubuntu 中的 Docker 中运行 GUI 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47099483/