我对Docker相当陌生(昨天了解到它,发现它很有趣),而且对它完全没有技巧,所以请尽量使您的回答尽可能友好。我运行了一个ubuntu映像,并试图在其中安装和运行wireshark (基于GUI的数据包捕获器),但是在运行时我得到了以下错误:
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
dbus[2537]: The last reference on a connection was dropped without closing the connection. This is a bug in an application. See dbus_connection_unref() documentation for details.
Most likely, the application was supposed to call dbus_connection_close(), since this is a private connection.
D-Bus not built with -rdynamic so unable to print a backtrace
Aborted (core dumped)我用:
sudo docker run --name ubuntu -v /home/anmol/Projects/Docker/Ubuntu/:/home -it --volume="$HOME/.Xauthority:/root/.Xauthority:rw" --env="DISPLAY" --net=host ubuntu
此外,我还努力:
xhost +local:docker
但不管用所以我试了一下:
xhost +
这也不起作用,我也一直犯同样的错误。
我有一种感觉,我应该在我的容器内安装一些x11软件包,但我不知道该做哪一件或是否正确的事情。
发布于 2020-11-16 15:48:04
编写完xhost +x之后,如果您在docker命令中添加了--privileged,那么它应该可以工作。
sudo docker run -it \
--privileged \
-e DISPLAY=$DISPLAY \
-v $HOME/.Xauthority:/root/.Xauthority \
<imageId>然而,使用xhost +x和--privileged并不安全。不建议在生产环境中使用它们,因为它们公开内核和主机的硬件资源。
发布于 2022-07-17 12:42:41
面对这个问题,他遵循了“Doğuş”和“Casey Jones”作为参考,这几乎是有帮助的。仍然面临着没有将主机设置为该机器的问题。
因此,我更新的命令如下
docker运行-it --特权-net=主机-e DISPLAY=$DISPLAY -v $HOME/..Xauthority:/root/..Xauthority /bin/bash
其中IMAGE_ID是您的码头形象id。
https://stackoverflow.com/questions/60773578
复制相似问题