Bug 2700

Summary: cannot reconnect to x11vnc
Product: [Build System, Metadata & Runtime] BSPs Reporter: Alexandru Georgescu <alexandru.c.georgescu>
Component: bsps-toolsAssignee: Saul Wold <sgw>
Status: VERIFIED NOTABUG QA Contact:
Severity: normal    
Priority: Medium CC: laurentiu.serban, sgw, yilongx.y.sun
Version: 1.2.1   
Target Milestone: 1.3 M3   
Hardware: E-Menlow   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Alexandru Georgescu 2012-07-05 13:28:50 UTC
GENERAL DESCRIPTION:
After a user connects successfully via vnc on the BSP, when trying to reconnect the user cannot because x11vnc process stops.

IMAGE USED:
http://autobuilder03.jf.intel.com/pub/nightly-meta-intel/20120704-1/machines/emenlow/core-image-sato-sdk-emenlow-20120704210110.hddimg

STEPS TO REPRODUCE:
1. Intall the hddimg on an eMenlow bsp
2. after boot, start from command line x11vnc on the bsp:
   # x11vnc -display :0.0
3. Connect from another vnc client machine to the bsp
4. Disconnect and try again to reconnect

EXPECTED RESULT:
4. The vnc client can reconnect

ACTUAL RESULT:
4. x11vnc process stops, so the vnc client isn't able to connect to the bsp.


root@emenlow:~/bsp# x11vnc -display :0.0
###############################################################
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@                                                           @#
#@  **  WARNING  **  WARNING  **  WARNING  **  WARNING  **   @#
#@                                                           @#
#@        YOU ARE RUNNING X11VNC WITHOUT A PASSWORD!!        @#
#@                                                           @#
#@  This means anyone with network access to this computer   @#
#@  may be able to view and control your desktop.            @#
#@                                                           @#
#@ >>> If you did not mean to do this Press CTRL-C now!! <<< @#
#@                                                           @#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
#@                                                           @#
#@  You can create an x11vnc password file by running:       @#
#@                                                           @#
#@       x11vnc -storepasswd password /path/to/passfile      @#
#@  or   x11vnc -storepasswd /path/to/passfile               @#
#@  or   x11vnc -storepasswd                                 @#
#@                                                           @#
#@  (the last one will use ~/.vnc/passwd)                    @#
#@                                                           @#
#@  and then starting x11vnc via:                            @#
#@                                                           @#
#@      x11vnc -rfbauth /path/to/passfile                    @#
#@                                                           @#
#@  an existing ~/.vnc/passwd file from another VNC          @#
#@  application will work fine too.                          @#
#@                                                           @#
#@  You can also use the -passwdfile or -passwd options.     @#
#@  (note -passwd is unsafe if local users are not trusted)  @#
#@                                                           @#
#@  Make sure any -rfbauth and -passwdfile password files    @#
#@  cannot be read by untrusted users.                       @#
#@                                                           @#
#@  Use x11vnc -usepw to automatically use your              @#
#@  ~/.vnc/passwd or ~/.vnc/passwdfile password files.       @#
#@  (and prompt you to create ~/.vnc/passwd if neither       @#
#@  file exists.)  Under -usepw, x11vnc will exit if it      @#
#@  cannot find a password to use.                           @#
#@                                                           @#
#@                                                           @#
#@  Even with a password, the subsequent VNC traffic is      @#
#@  sent in the clear.  Consider tunnelling via ssh(1):      @#
#@                                                           @#
#@    http://www.karlrunge.com/x11vnc/#tunnelling            @#
#@                                                           @#
#@  Or using the x11vnc SSL options: -ssl and -stunnel       @#
#@                                                           @#
#@  Please Read the documention for more info about          @#
#@  passwords, security, and encryption.                     @#
#@                                                           @#
#@    http://www.karlrunge.com/x11vnc/faq.html#faq-passwd    @#
#@                                                           @#
#@  To disable this warning use the -nopw option, or put     @#
#@  'nopw' on a line in your ~/.x11vncrc file.               @#
#@                                                           @#
#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#
###############################################################
05/07/2012 16:16:52 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 834
05/07/2012 16:16:52 Using X display :0.0
05/07/2012 16:16:52 rootwin: 0x75 reswin: 0x1200001 dpy: 0x8410fa0
05/07/2012 16:16:52 
05/07/2012 16:16:52 ------------------ USEFUL INFORMATION ------------------
05/07/2012 16:16:52 X DAMAGE available on display, using it for polling hints.
05/07/2012 16:16:52   To disable this behavior use: '-noxdamage'
05/07/2012 16:16:52 
05/07/2012 16:16:52   Most compositing window managers like 'compiz' or 'beryl'
05/07/2012 16:16:52   cause X DAMAGE to fail, and so you may not see any screen
05/07/2012 16:16:52   updates via VNC.  Either disable 'compiz' (recommended) or
05/07/2012 16:16:52   supply the x11vnc '-noxdamage' command line option.
05/07/2012 16:16:52 
05/07/2012 16:16:52 Wireframing: -wireframe mode is in effect for window moves.
05/07/2012 16:16:52   If this yields undesired behavior (poor response, painting
05/07/2012 16:16:52   errors, etc) it may be disabled:
05/07/2012 16:16:52    - use '-nowf' to disable wireframing completely.
05/07/2012 16:16:52    - use '-nowcr' to disable the Copy Rectangle after the
05/07/2012 16:16:52      moved window is released in the new position.
05/07/2012 16:16:52   Also see the -help entry for tuning parameters.
05/07/2012 16:16:52   You can press 3 Alt_L's (Left "Alt" key) in a row to 
05/07/2012 16:16:52   repaint the screen, also see the -fixscreen option for
05/07/2012 16:16:52   periodic repaints.
05/07/2012 16:16:52 
05/07/2012 16:16:52 XFIXES available on display, resetting cursor mode
05/07/2012 16:16:52   to: '-cursor most'.
05/07/2012 16:16:52   to disable this behavior use: '-cursor arrow'
05/07/2012 16:16:52   or '-noxfixes'.
05/07/2012 16:16:52 using XFIXES for cursor drawing.
05/07/2012 16:16:52 GrabServer control via XTEST.
Xlib:  extension "RECORD" missing on display ":0.0".
05/07/2012 16:16:52 
05/07/2012 16:16:52 The RECORD X extension was not found on the display.
05/07/2012 16:16:52 If your system has disabled it by default, you can
05/07/2012 16:16:52 enable it to get a nice x11vnc performance speedup
05/07/2012 16:16:52 for scrolling by putting this into the "Module" section
05/07/2012 16:16:52 of /etc/X11/xorg.conf or /etc/X11/XF86Config:
05/07/2012 16:16:52 
05/07/2012 16:16:52   Section "Module"
05/07/2012 16:16:52   ...
05/07/2012 16:16:52       Load    "record"
05/07/2012 16:16:52   ...
05/07/2012 16:16:52   EndSection
05/07/2012 16:16:52 
05/07/2012 16:16:52 
05/07/2012 16:16:52 XKEYBOARD: number of keysyms per keycode 6 is greater
05/07/2012 16:16:52   than 4 and 2 keysyms are mapped above 4.
05/07/2012 16:16:53   Automatically switching to -xkb mode.
05/07/2012 16:16:53   If this makes the key mapping worse you can
05/07/2012 16:16:53   disable it with the "-noxkb" option.
05/07/2012 16:16:53   Also, remember "-remap DEAD" for accenting characters.
05/07/2012 16:16:53 
05/07/2012 16:16:53 X FBPM extension not supported.
05/07/2012 16:16:53 X display is capable of DPMS.
05/07/2012 16:16:53 --------------------------------------------------------
05/07/2012 16:16:53 
05/07/2012 16:16:53 Default visual ID: 0x21
05/07/2012 16:16:53 Read initial data from X display into framebuffer.
05/07/2012 16:16:53 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/4096
05/07/2012 16:16:53 
05/07/2012 16:16:53 X display :0.0 is 32bpp depth=24 true color
05/07/2012 16:16:53 
05/07/2012 16:16:53 Autoprobing TCP port 
05/07/2012 16:16:53 Autoprobing selected port 5900
05/07/2012 16:16:53 Listening also on IPv6 port 5900 (socket 6)
05/07/2012 16:16:53 fb read rate: 30 MB/sec
05/07/2012 16:16:53 The X server says there are 10 mouse buttons.
05/07/2012 16:16:53 screen setup finished.
05/07/2012 16:16:53 
05/07/2012 16:16:53 WARNING: You are running x11vnc WITHOUT a password.  See
05/07/2012 16:16:53 WARNING: the warning message printed above for more info.
05/07/2012 16:16:53 

The VNC desktop is:      emenlow:0
PORT=5900

******************************************************************************
Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?

The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval.  It should work with any VNC viewer.  Try it by running:

    x11vnc -ncache 10 ...

One can also add -ncache_cr for smooth 'copyrect' window motion.
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

05/07/2012 16:17:01 Got connection from client 10.237.112.151
05/07/2012 16:17:01   other clients:
05/07/2012 16:17:01 Disabled X server key autorepeat.
05/07/2012 16:17:01   to force back on run: 'xset r on' (3 times)
05/07/2012 16:17:01 incr accepted_client=1 for 10.237.112.151:50080  sock=7
05/07/2012 16:17:01 Client Protocol Version 3.8
05/07/2012 16:17:01 Protocol version sent 3.8, using 3.8
05/07/2012 16:17:01 rfbProcessClientSecurityType: executing handler for type 1
05/07/2012 16:17:01 rfbProcessClientSecurityType: returning securityResult for client rfb version >= 3.8
05/07/2012 16:17:01 Pixel format for client 10.237.112.151:
05/07/2012 16:17:01   8 bpp, depth 8
05/07/2012 16:17:01   true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
05/07/2012 16:17:01 rfbProcessClientNormalMessage: ignoring unsupported encoding type ultraZip
05/07/2012 16:17:01 Using compression level 9 for client 10.237.112.151
05/07/2012 16:17:01 Using image quality level 0 for client 10.237.112.151
05/07/2012 16:17:01 Enabling X-style cursor updates for client 10.237.112.151
05/07/2012 16:17:01 Enabling full-color cursor updates for client 10.237.112.151
05/07/2012 16:17:01 Enabling cursor position updates for client 10.237.112.151
05/07/2012 16:17:01 Enabling KeyboardLedState protocol extension for client 10.237.112.151
05/07/2012 16:17:01 Enabling NewFBSize protocol extension for client 10.237.112.151
05/07/2012 16:17:01 Enabling LastRect protocol extension for client 10.237.112.151
05/07/2012 16:17:01 Enabling SupportedMessages protocol extension for client 10.237.112.151
05/07/2012 16:17:01 Enabling SupportedEncodings protocol extension for client 10.237.112.151
05/07/2012 16:17:01 Enabling ServerIdentity protocol extension for client 10.237.112.151
05/07/2012 16:17:01 Using tight encoding for client 10.237.112.151
05/07/2012 16:17:02 client useCopyRect: 10.237.112.151 -1
05/07/2012 16:17:02 client_set_net: 10.237.112.151  0.0031
05/07/2012 16:17:02 created   xdamage object: 0x1200024
05/07/2012 16:17:02 copy_tiles: allocating first_line at size 33
05/07/2012 16:17:03 client_count: 0
05/07/2012 16:17:03 Restored X server key autorepeat to: 1
05/07/2012 16:17:03 viewer exited.
05/07/2012 16:17:03 deleted 32 tile_row polling images.
root@emenlow:~/bsp#
Comment 1 Saul Wold 2012-07-13 00:31:02 UTC
This is expected behaviour, the default for x11vnc is -once.

From the man page for x11vnc:
By default x11vnc will not allow the screen to be shared and it will exit as soon as the client disconnects.  See -shared and -forever below to override these protections.

Further:
-once
Exit after the first successfully connected viewer
disconnects, opposite of -forever. This is the Default.

-forever
Keep listening for more connections rather than exiting
as soon as the first client(s) disconnect. Same as -many
Comment 2 Laurentiu Serban 2012-08-19 09:14:27 UTC
Setting this to verified.