[SOLVED] x11vnc not working on Alpine:3.3

4 posts / 0 new
Last post
#1 Mon, 2016-05-30 02:58
bergtwvd
  • bergtwvd's picture
  • Offline
  • Last seen: 1 year 6 months ago
  • Joined: 2016-05-30

I am running x11vnc on Alpine:3.3 in an identical setup as on Ubuntu:14.04

Dockerfile:

FROM java:8-jre-alpine
MAINTAINER XXXXX
 
# Install vnc and xvfb
RUN apk add x11vnc --update-cache --repository <a href="http://dl-3.alpinelinux.org/alpine/edge/testing/" rel="nofollow">http://dl-3.alpinelinux.org/alpine/edge/testing/</a> --allow-untrusted
RUN apk add xvfb
 
# Also install some fonts
# see: github.com/docker-library/openjdk/issues/73
RUN apk add ttf-dejavu
 
RUN mkdir ~/.vnc
# Setup a password
RUN x11vnc -storepasswd 1234 ~/.vnc/passwd
 
#Expose ports (VNC)
EXPOSE 5900
 
#set the default display used by XVFB
ENV DISPLAY=:20

From a shell in this container image I do:
~ # x11vnc -forever -usepw -create

The server starts. But when I connect from a VNC client it fails, as can be seen in the log below.
On Ubuntu I have no problem.
The first difference is at the line "/usr/bin/xinit: XFree86_VT property unexpectedly has 0 items instead of 1"; this is different from what I see on Ubuntu (see log output at the end of this report.

30/05/2016 00:38:10 -usepw: found /root/.vnc/passwd
30/05/2016 00:38:10 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 7
30/05/2016 00:38:10
30/05/2016 00:38:10 wait_for_client: WAIT:cmd=FINDCREATEDISPLAY-Xvfb
30/05/2016 00:38:10
30/05/2016 00:38:10 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/2560
30/05/2016 00:38:10
30/05/2016 00:38:10 Autoprobing TCP port
30/05/2016 00:38:10 Autoprobing selected port 5900
30/05/2016 00:38:10 Listening also on IPv6 port 5900 (socket 4)
30/05/2016 00:38:10
 
The VNC desktop is:      ef09d4c4c449:0
PORT=5900
30/05/2016 00:38:18 Got connection from client 10.0.2.2
30/05/2016 00:38:18   other clients:
30/05/2016 00:38:18 incr accepted_client=1 for 10.0.2.2:56917  sock=5
30/05/2016 00:38:18 wait_for_client: got client
30/05/2016 00:38:18 Client Protocol Version 3.8
30/05/2016 00:38:18 Protocol version sent 3.8, using 3.8
30/05/2016 00:38:18 client progressed=1 in 1/5 0.001407 s
30/05/2016 00:38:18 client useCopyRect: 10.0.2.2 0
30/05/2016 00:38:18 client_set_net: 10.0.2.2  0.0021
30/05/2016 00:38:18 wait_for_client: running: env X11VNC_SKIP_DISPLAY=''  /bin/sh /tmp/x11vnc-find_display.lhmGdl
xauth:  file /root/.Xauthority does not exist
30/05/2016 00:38:18 wait_for_client: find display cmd failed.
30/05/2016 00:38:18 wait_for_client: FINDCREATEDISPLAY cmd: /bin/sh /tmp/x11vnc-find_display.lhmGdl Xvfb
trying N=20 ...
redir_daemon=
/usr/bin/xauth:  file /root/.Xauthority does not exist
/usr/bin/xinit .xinitrc -- /usr/bin/Xvfb :20 -screen 0 1280x1024x24 -cc 4 -nolisten tcp -auth /tmp/.xas6415425.cKBILj
 
nohup: appending output to nohup.out
/usr/bin/xinit: XFree86_VT property unexpectedly has 0 items instead of 1
/usr/bin/xinit: Unable to run program ".xinitrc": No such file or directory
Specify a program on the command line or make sure that /usr/bin
is in your path.
 
/usr/bin/xinit: connection to X server lost
 
waiting for X server to shut down 30/05/2016 00:38:19 XOpenDisplay(":20") failed.

On Ubuntu:

...
30/05/2016 00:17:56 wait_for_client: running: env X11VNC_SKIP_DISPLAY=''  /bin/sh /tmp/x11vnc-find_display.5kwJxN
xauth:  file /root/.Xauthority does not exist
30/05/2016 00:17:56 wait_for_client: find display cmd failed.
30/05/2016 00:17:56 wait_for_client: FINDCREATEDISPLAY cmd: /bin/sh /tmp/x11vnc-find_display.5kwJxN Xvfb
trying N=20 ...
redir_daemon=
/usr/bin/xauth:  file /root/.Xauthority does not exist
/usr/bin/Xvfb :20 -screen 0 1280x1024x24 -cc 4 -nolisten tcp -auth /tmp/.xas12985011.ncG7O9
/usr/bin/nohup: appending output to 'nohup.out'
/usr/bin/nohup: appending output to 'nohup.out'
/usr/bin/nohup: appending output to 'nohup.out'
30/05/2016 00:18:00 Using X display :20
30/05/2016 00:18:00 rootwin: 0x169 reswin: 0x400001 dpy: 0xe1aad0
30/05/2016 00:18:00
30/05/2016 00:18:00 ------------------ USEFUL INFORMATION ------------------
3
...

Mon, 2016-05-30 10:35
AmatCoder
  • AmatCoder's picture
  • Offline
  • Last seen: 1 year 4 months ago
  • Joined: 2013-10-18

I think that you need a valid .xinitrc file into your $HOME folder. Try:

cp /etc/X11/xinit/xinitrc ~/.xinitrc

Tue, 2016-05-31 00:19 (Reply to #2)
bergtwvd
  • bergtwvd's picture
  • Offline
  • Last seen: 1 year 6 months ago
  • Joined: 2016-05-30

Thanks, it solved the problem.

Mon, 2016-05-30 10:48
AmatCoder
  • AmatCoder's picture
  • Offline
  • Last seen: 1 year 4 months ago
  • Joined: 2013-10-18

Sorry, double post.

Log in or register to post comments