简体   繁体   English

通过VNC将Docker连接到X11失败

[英]Connecting Docker to X11 via VNC fails

I have an ubuntu server without a display which runs a vncserver and I access it via VNC. 我有一个没有显示器的ubuntu服务器,该显示器运行vncserver,并且可以通过VNC访问它。

On this server I have tried to run the chrome example from this blog : https://blog.jessfraz.com/post/docker-containers-on-the-desktop/ 在此服务器上,我尝试从以下博客运行chrome示例: https : //blog.jessfraz.com/post/docker-containers-on-the-desktop/

but it failed like this: 但是它失败了:

>./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

Any idea how to fix this ? 任何想法如何解决这个问题?

What might be going wrong ? 可能出什么问题了?

This worked: 这工作:

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

Got inspired by the comments here : http://fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/ 在这里的评论启发了我: http : //fabiorehm.com/blog/2014/09/11/running-gui-apps-with-docker/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM