Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up VNC fails #76

Closed
jjmurre opened this issue Jul 9, 2015 · 6 comments
Closed

Setting up VNC fails #76

jjmurre opened this issue Jul 9, 2015 · 6 comments

Comments

@jjmurre
Copy link

jjmurre commented Jul 9, 2015

When trying to use the 'standalone-chrome-debug' image I cannot connect to the vnc port.

In the logs I see:
09/07/2015 01:59:50 passing arg to libvncserver: -rfbport
09/07/2015 01:59:50 passing arg to libvncserver: 5900
Enter VNC password: stty: standard input: Inappropriate ioctl for device
fgets: No such file or directory
stty: standard input: Inappropriate ioctl for device
x11vnc -usepw: could not find a password to use.
Failed to read: session.ignoreBorder

It seems that vnc tries to 'obfuscate' the password that is entered in the tty, but that is not possible in stty.

@ghost
Copy link

ghost commented Jul 9, 2015

Strange indeed.

I just did a test with the docker image ( selenium/standalone-chrome-debug with id be801ca81579 ) and I get this on starting docker container

09/07/2015 13:18:47 passing arg to libvncserver: -rfbport
09/07/2015 13:18:47 passing arg to libvncserver: 5900
09/07/2015 13:18:47 -usepw: found /root/.vnc/passwd
09/07/2015 13:18:47 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 43
09/07/2015 13:18:47 Using X display :99.0

Retracing my steps on mac os x as this:

$ cid=$(docker run -d -P selenium/standalone-chrome-debug)
$ docker logs $cid

And finally connecting as client:

$ docker port $cid
5900/tcp -> 0.0.0.0:32770
4444/tcp -> 0.0.0.0:32771

$ docker-machine ip dev
192.168.99.100

$ open vnc://:[email protected]:32770

and the logs show client connected.
At this point I can start a session on standalone at

http://192.168.99.100:32771/wd/hub/static/resource/hub.html

@jjmurre
Copy link
Author

jjmurre commented Jul 10, 2015

I tried it again and get the same problem. However, when I use the Dockerfile below, vnc works.
Really strange, because that is exactly what happens in the 'StandaloneDebugChrome' Dockerfile.

FROM ubuntu
RUN apt-get update && apt-get install -y x11vnc xvfb
RUN mkdir ~/.vnc
RUN x11vnc -storepasswd 1234 ~/.vnc/passwd
EXPOSE 5900
CMD ["x11vnc", "-forever", "-usepw", "-create"]

@ghost
Copy link

ghost commented Jul 15, 2015

Sorry if this is a stupid question but do you build the images locally? If you do can you rebuild with --no-cache option. I use the officially built from docker. Please pull the latest from hub and try.

I have tried on my locally built image and all if fine. I tested on Mac OS X with docker-machine in virtualbox . Maybe there is another setup that's messed up?

I am perplexed.

@jjmurre
Copy link
Author

jjmurre commented Jul 16, 2015

I used the image from the hub. I tried it now with latest (c0de4f4abc1d) and get the same result.
I also rebuilt the image locally, same problem.
However, when I tried it with latest on another machine (Ubuntu 14:04 server), vnc works ok.
My local laptop is also Ubuntu 14:04 (desktop).

@rkerr
Copy link

rkerr commented Sep 7, 2015

I ran into the same issue today with selenium/standalone-firefox-debug:latest from the hub.

Going through the x11vnc code it seems that if x11vnc can't find the password file for -usepw it will try to create it by calling x11vnc -storepasswd - that will try to prompt for a password on stdin which is in turn generating the stty/fgets errors.

What I'm not sure of is why x11vnc isn't finding the password file or why it apparently works for some people and not others...

@rkerr
Copy link

rkerr commented Sep 8, 2015

Seems to be related to the setting of $HOME in containers. It appears that behaviour in docker changed at some point: moby/moby#2968

For recent versions of docker $HOME gets set to /root and that's where the VNC password file ends up in the published image. If you're using an older version of docker $HOME gets set to / which stops the password file being found.

The -debug images could be made compatible with both versions of docker by symlinking /.vnc to /root/.vnc

@lock lock bot locked and limited conversation to collaborators Aug 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants