【问题标题】:Connecting Docker to X11 via VNC fails通过 VNC 将 Docker 连接到 X11 失败
【发布时间】:2015-08-31 15:39:10
【问题描述】:

我有一个没有显示器的 ubuntu 服务器,它运行一个 vncserver,我通过 VNC 访问它。

在此服务器上,我尝试运行此博客中的 chrome 示例:https://blog.jessfraz.com/post/docker-containers-on-the-desktop/

但它失败了:

>./runChrome.sh 
Warning: '--cpuset' is deprecated, it will be replaced by '--cpuset-cpus' soon. See usage.
Unable to find image 'jess/chrome:latest' locally
latest: Pulling from jess/chrome
42b46c8b387a: Pull complete 
9402e656a0ac: Pull complete 
753b4bb947ba: Pull complete 
9f3ad4f52cb2: Pull complete 
c3374db106fe: Pull complete 
0cdf8bc021c3: Pull complete 
e1db72a1498b: Pull complete 
fe339b19b201: Pull complete 
7b966fb57da2: Already exists 
Digest: sha256:65185c906ab67ca126ca49943cc5c4f05d2e6c9aac04a505fa3f5e6b183b72da
Status: Downloaded newer image for jess/chrome:latest
WARNING: Your kernel does not support swap limit capabilities, memory limited without swap.
[1:1:0729/171614:ERROR:browser_main_loop.cc(185)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
No protocol specified
[1:1:0729/171614:ERROR:browser_main_loop.cc(231)] Gtk: cannot open display: unix:1
>cat runChrome.sh 
docker run -it --net host --cpuset 0 --memory 512mb -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY -v $HOME/Downloads:/root/Downloads -v $HOME/.config/google-chrome/:/data --device /dev/snd --name chrome jess/chrome

知道如何解决这个问题吗?

可能出了什么问题?

【问题讨论】:

    标签: docker x11 vnc


    【解决方案1】:

    这行得通:

    docker run -e DISPLAY -v $HOME/.Xauthority:/home/ghc/.Xauthority --net=host -ti 80d81a4ae162 /bin/bash
    

    受到 cmets 的启发:http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/

    【讨论】:

    • 我收到了xauth: timeout in locking authority file /home/<user>/.Xauthority
    猜你喜欢
    • 2017-07-21
    • 2021-11-15
    • 2020-01-09
    • 2021-06-04
    • 2022-01-07
    • 1970-01-01
    • 2011-12-21
    • 2012-03-08
    • 2015-06-02
    相关资源
    最近更新 更多