1X11VNC(1)                        User Commands                       X11VNC(1)
2
3
4

NAME

6       x11vnc - allow VNC connections to real X11 displays
7                version: 0.9.14, lastmod: 2013-11-21
8

SYNOPSIS

10       x11vnc [OPTION]...
11

DESCRIPTION

13       Typical usage is:
14
15              Run  this  command  in  a shell on the remote machine "far-host"
16              with X session you wish to view:
17
18              x11vnc -display :0
19
20              Then run this in another window on the machine you  are  sitting
21              at:
22
23              vncviewer far-host:0
24
25       Once x11vnc establishes connections with the X11 server and starts lis‐
26       tening as a VNC server it will print out a string: PORT=XXXX where XXXX
27       is  typically  5900  (the default VNC server port).  One would next run
28       something like this on the local machine: "vncviewer hostname:N"  where
29       "hostname"  is  the  name of the machine running x11vnc and N is XXXX -
30       5900, i.e. usually "vncviewer hostname:0".
31
32       By default x11vnc will not allow the screen to be shared  and  it  will
33       exit as soon as the client disconnects.  See -shared and -forever below
34       to override these protections.  See the FAQ for details how  to  tunnel
35       the  VNC  connection  through  an encrypted channel such as ssh(1).  In
36       brief:
37
38              ssh -t -L 5900:localhost:5900 far-host 'x11vnc -localhost  -dis‐
39              play :0'
40
41       % vncviewer -encodings 'copyrect tight zrle hextile' localhost:0
42
43       Also,  use of a VNC password (-rfbauth or -passwdfile) is strongly rec‐
44       ommended.
45
46       For   additional   info   see:   http://www.karlrunge.com/x11vnc/   and
47       http://www.karlrunge.com/x11vnc/faq.html
48
49       Config  file support: if the file $HOME/.x11vncrc exists then each line
50       in it is treated as a single command line option.  Disable with  -norc.
51       For  each option name, the leading character "-" is not required.  E.g.
52       a line that is either "forever" or  "-forever"  may  be  used  and  are
53       equivalent.   Likewise  "wait  100"  or  "-wait 100" are acceptable and
54       equivalent lines.  The "#" character comments out to  the  end  of  the
55       line in the usual way (backslash it for a literal).  Leading and trail‐
56       ing whitespace is trimmed off.  Lines may be continued with  a  "\"  as
57       the last character of a line (it becomes a space character).
58

OPTIONS

60       -display disp
61
62              X11  server  display  to  connect  to, usually :0.  The X server
63              process must be running on same  machine  and  support  MIT-SHM.
64              Equivalent to setting the DISPLAY environment variable to disp.
65
66              See  the  description  below  of the "-display WAIT:..."  exten‐
67              sions, where alias "-find" will find the user's display automat‐
68              ically,  and  "-create" will create a Xvfb session if no session
69              is found.
70
71       -auth file
72
73              Set the X authority file to be file, equivalent to  setting  the
74              XAUTHORITY environment variable to file before startup.  Same as
75              -xauth file.  See Xsecurity(7) , xauth(1)  man  pages  for  more
76              info.
77
78              Use  '-auth  guess'  to  have x11vnc use its -findauth mechanism
79              (described below) to try to guess the  XAUTHORITY  filename  and
80              use it.
81
82              XDM/GDM/KDM:  if you are running x11vnc as root and want to find
83              the XAUTHORITY before anyone has logged into an X  session  yet,
84              use:  x11vnc -env FD_XDM=1 -auth guess ...  (This will also find
85              the XAUTHORITY if a user is already logged into the X  session.)
86              When  running  as  root,  FD_XDM=1  will be tried if the initial
87              -auth guess fails.
88
89       -N
90
91              If the X display is :N, try to set the VNC display to also be :N
92              This  just  sets  the -rfbport option to 5900+N The program will
93              exit immediately if that port is not available.  The  -N  option
94              only  works  with  normal  -display  usage, e.g. :0 or :8, -N is
95              ignored in the -display WAIT:..., -create, -find,  -svc,  -redi‐
96              rect, etc modes.
97
98       -autoport n
99
100              Automatically  probe  for  a  free  VNC port starting at n.  The
101              default is to start probing at 5900.  Use this to stay away from
102              other VNC servers near 5900.
103
104       -rfbport str
105
106              The  VNC  port to listen on (a LibVNCServer option), e.g.  5900,
107              5901, etc.  If specified as "-rfbport PROMPT"  then  the  x11vnc
108              -gui is used to prompt the user to enter the port number.
109
110       -6
111
112              IPv6  listening  support.  In addition to IPv4, the IPv6 address
113              is listened on for incoming connections.  The same  port  number
114              as IPv4 is used.
115
116              NOTE:   This  x11vnc  binary  was compiled to have the "-6" IPv6
117              listening mode ENABLED by default (CPPFLAGS -DX11VNC_LISTEN6=1).
118              So  to  disable  IPv6  listening mode you MUST supply the "-no6"
119              option (see below.)
120
121              The "-6"  mode  works  for  both  normal  connections  and  -ssl
122              encrypted  ones.   Nearly  everything  is supported for the IPv6
123              case, but there are a few exceptions.  See -stunnel for its IPv6
124              support.
125
126              Currently,  for  absolutely  everything  to  work  correctly the
127              machine may need to have some IPv4 support, at the least for the
128              loopback interface.  However, for nearly all usage modes no IPv4
129              support is required. See -nopiv4.
130
131              If you have trouble compiling  or  running  in  IPv6  mode,  set
132              -DX11VNC_IPV6=0  in  CPPFLAGS  when  configuring to disable IPv6
133              support.
134
135       -no6
136
137              Disable IPv6 listening support (only useful if the "-6" mode  is
138              compiled  in  to be the default; see the X11VNC_LISTEN6 descrip‐
139              tion above under "-6".)
140
141       -noipv6
142
143              Do not try to use IPv6 for any listening or connecting  sockets.
144              This  includes  both  the listening service port(s) and outgoing
145              connections from -connect,  -connect_or_exit,  or  -proxy.   Use
146              this if you are having problems due to IPv6.
147
148       -noipv4
149
150              Do  not try to use IPv4 for any listening or connecting sockets.
151              This is mainly for  exploring  the  behavior  of  x11vnc  on  an
152              IPv6-only system, but may have other uses.
153
154       -reopen
155
156              If  the X server connection is disconnected, try to reopen the X
157              display (up to one time.)  This is of use for  display  managers
158              like  GDM  (KillInitClients  option) that kill x11vnc just after
159              the user logs into the X session.  Note: the reopened state  may
160              be  unstable.  Set X11VNC_REOPEN_DISPLAY=n to reopen n times and
161              set X11VNC_REOPEN_SLEEP_MAX to the number  of  seconds,  default
162              10, to keep trying to reopen the display (once per second.)
163
164              Update:  as  of 0.9.9, x11vnc tries to automatically avoid being
165              killed by the display manager by delaying  creating  windows  or
166              using   XFIXES.    So   you  shouldn't  need  to  use  KillInit‐
167              Clients=false as long as you log in quickly  enough  (within  45
168              seconds  of  connecting.)   You  can  disable  this  by  setting
169              X11VNC_AVOID_WINDOWS=never.  You can also set it to  the  number
170              of seconds to delay.
171
172       -reflect host:N
173
174              Instead  of  connecting  to and polling an X display, connect to
175              the remote VNC server host:N and be a reflector/repeater for it.
176              This  is useful for trying to manage the case of many simultane‐
177              ous VNC viewers (e.g. classroom broadcasting)  where,  e.g.  you
178              put  a  repeater on each network switch, etc, to improve perfor‐
179              mance by distributing the load  and  network  traffic.   Implies
180              -shared  (use  -noshared  as a later option to disable). See the
181              discussion below under -rawfb vnc:host:N for more details.
182
183       -id windowid
184
185              Show the X window corresponding to windowid not the entire  dis‐
186              play.   New  windows like popup menus, transient toplevels, etc,
187              may not be seen or may  be  clipped.   Disabling  SaveUnders  or
188              BackingStore  in  the  X  server may help show them.  x11vnc may
189              crash if the window is  initially  partially  obscured,  changes
190              size, is iconified, etc.  Some steps are taken to avoid this and
191              the -xrandr mechanism is used to track resizes.  Use xwininfo(1)
192              to get the window id, or use "-id pick" to have x11vnc run xwin‐
193              info(1) for you and extract the id.  The -id  option  is  useful
194              for exporting very simple applications (e.g. the current view on
195              a webcam).
196
197       -sid windowid
198
199              As -id, but instead of using the window  directly  it  shifts  a
200              root view to it: this shows SaveUnders menus, etc, although they
201              will be clipped if they extend beyond the window.
202
203       -tag str
204
205              This option is ignored, but  allows  you  to  specify  a  unique
206              string   on   the   x11vnc   command  line,  for  example  "-tag
207              test34934z", this could enable a reliable way to  identify  dif‐
208              ferent  x11vnc  processes  via  their command lines (see ps(1) ,
209              pgrep(1) , and pkill(1) and /proc/PID/cmdline.)
210
211       -appshare
212
213              Simple application sharing  based  on  the  -id/-sid  mechanism.
214              Every new toplevel window that the application creates induces a
215              new viewer window via a reverse connection.   The  -id/-sid  and
216              -connect options are required.  Run 'x11vnc -appshare -help' for
217              more info.
218
219       -clip WxH+X+Y
220
221              Only show the sub-region of the full display that corresponds to
222              the  rectangle  geometry with size WxH and offset +X+Y.  The VNC
223              display has size WxH (i.e. smaller than the full display).  This
224              also works for -id/-sid mode where the offset is relative to the
225              upper left corner of the selected window.   An  example  use  of
226              this  option  would  be to split a large (e.g. Xinerama) display
227              into two parts to be accessed via separate viewers by running  a
228              separate x11vnc on each part.
229
230              Use  '-clip  xinerama0' to clip to the first xinerama sub-screen
231              (if xinerama is active).  xinerama1 for the 2nd sub-screen, etc.
232              This way you don't need to figure out the WxH+X+Y of the desired
233              xinerama sub-screen.  screens are sorted in increasing  distance
234              from the (0,0) origin (I.e. not the Xserver's order).
235
236       -flashcmap
237
238              In  8bpp  indexed color, let the installed colormap flash as the
239              pointer moves from window to window (slow).  Also try the -8to24
240              option to avoid flash altogether.
241
242       -shiftcmap n
243
244              Rare  problem,  but  some 8bpp displays use less than 256 color‐
245              cells (e.g. 16-color grayscale, perhaps the other bits are  used
246              for double buffering) *and* also need to shift the pixels values
247              away from 0, .., ncells.  n indicates the shift to be applied to
248              the  pixel  values.  To see the pixel values set DEBUG_CMAP=1 to
249              print out a colormap histogram.  Example: -shiftcmap 240
250
251       -notruecolor
252
253              For 8bpp displays, force indexed color (i.e. a colormap) even if
254              it looks like 8bpp TrueColor (rare problem).
255
256       -advertise_truecolor
257
258              If  the  X11  display is indexed color, lie to clients when they
259              first connect by telling them it is  truecolor.   To  workaround
260              RealVNC:  inPF  has colourMap but not 8bpp Use '-advertise_true‐
261              color reset' to reset client fb too.
262
263       -visual n
264
265              This option probably does not do  what  you  think.   It  simply
266              *forces*  the visual used for the framebuffer; this may be a bad
267              thing... (e.g. messes up colors or cause a crash). It is  useful
268              for  testing  and for some workarounds.  n may be a decimal num‐
269              ber, or 0x hex.  Run xdpyinfo(1) for the values.  One  may  also
270              use  "TrueColor",  etc. see <X11/X.h> for a list.  If the string
271              ends in ":m" then for better or for worse the  visual  depth  is
272              forced  to  be  m.   You  may want to use -noshm when using this
273              option (so  XGetImage  may  automatically  translate  the  pixel
274              data).
275
276       -overlay
277
278              Handle  multiple depth visuals on one screen, e.g. 8+24 and 24+8
279              overlay visuals (the 32 bits per pixel are  packed  with  8  for
280              PseudoColor and 24 for TrueColor).
281
282              Currently  -overlay  only works on Solaris via XReadScreen(3X11)
283              and IRIX using XReadDisplay(3).  On Solaris there is  a  problem
284              with  image "bleeding" around transient popup menus (but not for
285              the menu itself): a workaround is to disable SaveUnders by pass‐
286              ing the "-su" argument to Xsun (in /etc/dt/config/Xservers).
287
288              Use  -overlay  as  a  workaround for situations like these: Some
289              legacy applications  require  the  default  visual  to  be  8bpp
290              (8+24),  or they will use 8bpp PseudoColor even when the default
291              visual is depth 24 TrueColor (24+8).  In these cases  colors  in
292              some  windows  will  be  incorrect  in x11vnc unless -overlay is
293              used.  Another use of -overlay is to enable  showing  the  exact
294              mouse cursor shape (details below).
295
296              Under  -overlay,  performance will be somewhat slower due to the
297              extra image transformations required.  For  optimal  performance
298              do  not  use -overlay, but rather configure the X server so that
299              the default visual is depth 24 TrueColor and  try  to  have  all
300              apps  use  that  visual  (e.g.  some apps have -use24 or -visual
301              options).
302
303       -overlay_nocursor
304
305              Sets -overlay, but does not try to draw the exact  mouse  cursor
306              shape using the overlay mechanism.
307
308       -8to24 [opts]
309
310              Try this option if -overlay is not supported on your OS, and you
311              have a legacy 8bpp app that you want to view  on  a  multi-depth
312              display  with default depth 24 (and is 32 bpp) OR have a default
313              depth 8 display with depth 24 overlay  windows  for  some  apps.
314              This  option  may not work on all X servers and hardware (tested
315              on XFree86/Xorg mga driver and Xsun).  The "opts" string is  not
316              required and is described below.
317
318              This  mode enables a hack where x11vnc monitors windows within 3
319              levels from the root window.  If it finds any that are  8bpp  it
320              extracts  the  indexed  color pixel values using XGetImage() and
321              then applies a transformation using the  colormap(s)  to  create
322              TrueColor  RGB  values that it in turn inserts into bits 1-24 of
323              the framebuffer.  This creates a depth 24 "view" of the  display
324              that is then exported via VNC.
325
326              Conversely,  for  default depth 8 displays, the depth 24 regions
327              are read  by  XGetImage()  and  everything  is  transformed  and
328              inserted into a depth 24 TrueColor framebuffer.
329
330              Note  that  even  if  there are *no* depth 24 visuals or windows
331              (i.e. pure 8bpp), this mode is potentially an  improvement  over
332              -flashcmap  because it avoids the flashing and shows each window
333              in the correct color.
334
335              This method works OK, but may still have bugs and  it  does  hog
336              resources.   If  there are multiple 8bpp windows using different
337              colormaps, one may have to iconify all but one for the colors to
338              be correct.
339
340              There  may be painting errors for clipping and switching between
341              windows of depths 8 and 24.  Heuristics are applied  to  try  to
342              minimize the painting errors.  One can also press 3 Alt_L's in a
343              row to refresh the screen if the error does not  repair  itself.
344              Also the option -fixscreen 8=3.0 or -fixscreen V=3.0 may be used
345              to periodically refresh the screen  at  the  cost  of  bandwidth
346              (every 3 sec for this example).
347
348              The  [opts] string can contain the following settings.  Multiple
349              settings are separated by commas.
350
351              For for some X servers with default depth 24 a  speedup  may  be
352              achieved  via  the  option  "nogetimage".  This enables a scheme
353              were  XGetImage()  is  not  used  to  retrieve  the  8bpp  data.
354              Instead,  it  assumes that the 8bpp data is in bits 25-32 of the
355              32bit X pixels.  There is  no  requirement  that  the  X  server
356              should put the data there for our poll requests, but some do and
357              so the extra steps to retrieve it can be skipped.   Tested  with
358              mga driver with XFree86/Xorg.  For the default depth 8 case this
359              option is ignored.
360
361              To adjust how often XGetImage() is used to poll the  non-default
362              visual regions for changes, use the option "poll=t" where "t" is
363              a floating point time.  (default: 0.05)
364
365              Setting the option "level2"  will  limit  the  search  for  non-
366              default  visual  windows to two levels from the root window.  Do
367              this on slow machines where you know  the  window  manager  only
368              imposes  one  extra  window  between the app window and the root
369              window.
370
371              Also for very slow machines use "cachewin=t" where t is a float‐
372              ing  point amount of time to cache XGetWindowAttributes results.
373              E.g. cachewin=5.0.  This may lead to the windows being unnoticed
374              for this amount of time when deiconifying, painting errors, etc.
375
376              While  testing  on  a very old SS20 these options gave tolerable
377              response: -8to24 poll=0.2,cachewin=5.0. For this machine  -over‐
378              lay is supported and gives better response.
379
380              Debugging  for  this  mode  can  be  enabled by setting "dbg=1",
381              "dbg=2", or "dbg=3".
382
383       -24to32
384
385              Very rare problem: if the framebuffer (X display or  -rawfb)  is
386              24bpp instead of the usual 32bpp, then dynamically transform the
387              pixels to 32bpp.  This will be slower, but can be used  to  work
388              around  problems  where  VNC  viewers  cannot handle 24bpp (e.g.
389              "main: setPF: not 8, 16 or 32 bpp?").   See  the  FAQ  for  more
390              info.
391
392              In  the case of -rawfb mode, the pixels are directly modified by
393              inserting a 0 byte to pad them out to 32bpp.  For X displays,  a
394              kludge  is  done  that  is  equivalent  to "-noshm -visual True‐
395              Color:32".  (If better performance is  needed  for  the  latter,
396              feel free to ask).
397
398       -scale fraction
399
400              Scale  the  framebuffer  by factor fraction.  Values less than 1
401              shrink the fb, larger ones expand it. Note: the image may not be
402              sharp  and response may be slower.  If fraction contains a deci‐
403              mal point "." it is taken as a floating point  number,  alterna‐
404              tively  the  notation  "m/n"  may  be  used  to denote fractions
405              exactly, e.g. -scale 2/3
406
407              To scale asymmetrically in the horizontal  and  vertical  direc‐
408              tions,  specify  a  WxH  geometry  to  stretch  to: e.g. '-scale
409              1024x768', or also '-scale 0.9x0.75'
410
411              Scaling Options: can be added after fraction via ":", to  supply
412              multiple  ":"  options  use  commas.   If you just want a quick,
413              rough scaling without blending, append ":nb" to  fraction  (e.g.
414              -scale  1/3:nb).   No  blending  is the default for 8bpp indexed
415              color, to force blending for this case use ":fb".
416
417              To disable -scrollcopyrect and -wirecopyrect  under  -scale  use
418              ":nocr".   If  you  need  to to enable them use ":cr" or specify
419              them explicitly  on  the  command  line.   If  a  slow  link  is
420              detected, ":nocr" may be applied automatically.  Default: :cr
421
422              More  esoteric  options:  for  compatibility with vncviewers the
423              scaled width is adjusted to be a multiple of 4: to disable  this
424              use  ":n4".  ":in" use interpolation scheme even when shrinking,
425              ":pad" pad scaled width and height to be  multiples  of  scaling
426              denominator (e.g. 3 for 2/3).
427
428       -geometry WxH
429
430              Same as -scale WxH
431
432       -scale_cursor frac
433
434              By  default  if -scale is supplied the cursor shape is scaled by
435              the same factor.  Depending on your usage, you may want to scale
436              the  cursor  independently  of the screen or not at all.  If you
437              specify -scale_cursor the cursor will be scaled by that  factor.
438              When  using -scale mode to keep the cursor at its "natural" size
439              use "-scale_cursor 1".  Most of the ":"  scaling  options  apply
440              here as well.
441
442       -viewonly
443
444              All VNC clients can only watch (default off).
445
446       -shared
447
448              VNC  display is shared, i.e. more than one viewer can connect at
449              the same time (default off).
450
451       -once
452
453              Exit after the first successfully connected viewer  disconnects,
454              opposite of -forever. This is the Default.
455
456       -forever
457
458              Keep  listening for more connections rather than exiting as soon
459              as the first client(s) disconnect. Same as -many
460
461              To get the standard non-shared VNC behavior where when a new VNC
462              client connects the existing VNC client is dropped use:  -never‐
463              shared -forever   This method can also be used to guard  against
464              hung TCP connections that do not go away.
465
466       -loop
467
468              Create  an  outer loop restarting the x11vnc process whenever it
469              terminates.  -bg and -inetd are ignored in  this  mode  (however
470              see -loopbg below).
471
472              Useful  for  continuing  even  if  the  X  server terminates and
473              restarts (at that moment the process  will  need  permission  to
474              reconnect to the new X server of course).
475
476              Use,  e.g.,  -loop100  to  sleep 100 millisecs between restarts,
477              etc.  Default is 2000ms (i.e. 2 secs) Use,  e.g.  -loop300,5  to
478              sleep 300 ms and only loop 5 times.
479
480              If  -loopbg  (plus  any numbers) is specified instead, the "-bg"
481              option is implied and the mode approximates  inetd(8)  usage  to
482              some  degree.  In this case when it goes into the background any
483              listening sockets (i.e. ports 5900, 5800)  are  closed,  so  the
484              next  one  in  the loop can use them.  This mode will only be of
485              use if a VNC client  (the  only  client  for  that  process)  is
486              already  connected  before the process goes into the background,
487              for example, usage of -display WAIT:.., -svc, and  -connect  can
488              make use of this "poor man's" inetd mode.  The default wait time
489              is 500ms in this mode.  This usage could use useful:   -svc  -bg
490              -loopbg
491
492       -timeout n
493
494              Exit  unless  a client connects within the first n seconds after
495              startup.
496
497              If there have been no connection attempts after n seconds x11vnc
498              exits immediately.  If a client is trying to connect but has not
499              progressed to the normal operating state, x11vnc gives it a  few
500              more  seconds  to finish and exits if it does not make it to the
501              normal state.
502
503              For reverse connections via -connect or -connect_or_exit a time‐
504              out  of  n seconds will be set for all reverse connects.  If the
505              connect timeout alarm goes off, x11vnc will exit immediately.
506
507       -sleepin n
508
509              At startup sleep n seconds  before  proceeding  (e.g.  to  allow
510              redirs and listening clients to start up)
511
512              If  a range is given: '-sleepin min-max', a random value between
513              min and max is slept. E.g. '-sleepin 0-20' and ´-sleepin 10-30'.
514              Floats are allowed too.
515
516       -inetd
517
518              Launched  by inetd(8): stdio instead of listening socket.  Note:
519              if you are not redirecting stderr to a log file (via shell 2> or
520              -o  option)  you  MUST also specify the -q option, otherwise the
521              stderr goes to the viewer which will cause it to abort.   Speci‐
522              fying  both -inetd and -q and no -o will automatically close the
523              stderr.
524
525              If the libvncserver used supports non AF_INET sockets  (the  one
526              bundled  in  x11vnc 0.9.13 and later does), then -inetd mode can
527              be used for a raw stdio  pipe.  For  example,  using  the  SSVNC
528              viewer exec=... mechanism:
529
530              ssvnc  -viewer  exec="ssh -tt -e none user@host \ ´x11vnc -inetd
531              -o log.txt -display :0'"
532
533              where the long cmdline has been split.  In the  above  the  only
534              TCP  connection is that of the ssh connection.  There is no port
535              redirection (-L), etc.; raw stdio is used on both sides  of  the
536              ssh.  In some cases the -tt option is not needed.
537
538       -tightfilexfer
539
540              Enable the TightVNC file transfer extension. Note that that when
541              the -viewonly option is supplied all  file  transfers  are  dis‐
542              abled.  Also clients that log in viewonly cannot transfer files.
543              However, if the remote control mechanism is used to  change  the
544              global or per-client viewonly state the filetransfer permissions
545              will NOT change.
546
547              IMPORTANT: please understand if -tightfilexfer is specified  and
548              you  run x11vnc as root for, say, inetd or display manager (gdm,
549              kdm, ...) access and you do not have it  switch  users  via  the
550              -users  option,  then  VNC  Viewers  that connect are able to do
551              filetransfer reads and writes as *root*.
552
553              Also, tightfilexfer is disabled in -unixpw mode.
554
555       -ultrafilexfer
556
557              Note: to enable UltraVNC filetransfer and to get it to work  you
558              probably need to supply these LibVNCServer options: "-rfbversion
559              3.6 -permitfiletransfer" "-ultrafilexfer" is an alias  for  this
560              combination.
561
562              IMPORTANT:  please understand if -ultrafilexfer is specified and
563              you run x11vnc as root for, say, inetd or display manager  (gdm,
564              kdm,  ...)  access  and  you do not have it switch users via the
565              -users option, then VNC Viewers that  connect  are  able  to  do
566              filetransfer reads and writes as *root*.
567
568              Note  that  sadly  you cannot do both -tightfilexfer and -ultra‐
569              filexfer at the same time because the  latter  requires  setting
570              the version to 3.6 and tightvnc will not do filetransfer when it
571              sees that version number.
572
573       -http
574
575              Instead of using -httpdir (see below) to specify where the  Java
576              vncviewer applet is, have x11vnc try to *guess* where the direc‐
577              tory is by looking relative to the program location and in stan‐
578              dard  locations  (/usr/local/share/x11vnc/classes,  etc).  Under
579              -ssl or -stunnel the ssl classes subdirectory is sought.
580
581       -http_ssl
582
583              As -http, but force lookup for ssl classes subdir.
584
585              Note that for HTTPS, single-port Java applet  delivery  you  can
586              set X11VNC_HTTPS_DOWNLOAD_WAIT_TIME to the max number of seconds
587              to wait for the applet download to finish.  The default is 15.
588
589       -avahi
590
591              Use the Avahi/mDNS  ZeroConf  protocol  to  advertise  this  VNC
592              server  to  the  local network. (Related terms: Rendezvous, Bon‐
593              jour).  Depending on your setup, you may need  to  start  avahi-
594              daemon and open udp port 5353 in your firewall.
595
596              You   can   set   X11VNC_AVAHI_NAME,  X11VNC_AVAHI_HOST,  and/or
597              X11VNC_AVAHI_PORT environment variables to override the  default
598              values.  For example: -env X11VNC_AVAHI_NAME=wally
599
600              If the avahi API cannot be found at build time, a helper program
601              like avahi- publish(1) or dns- sd(1) will be tried
602
603       -mdns
604
605              Same as -avahi.
606
607       -zeroconf
608
609              Same as -avahi.
610
611       -connect string
612
613              For use with "vncviewer -listen" reverse connections.  If string
614              has  the  form "host" or "host:port" the connection is made once
615              at startup.
616
617              Use commas for a list of host's and host:port's.  E.g.  -connect
618              host1,host2 or host1:0,host2:5678.  Note that to reverse connect
619              to multiple hosts at the same time you will likely need to  also
620              supply: -shared
621
622              Note  that  unlike most vnc servers, x11vnc will require a pass‐
623              word for reverse as well as for forward connections.   (provided
624              password  auth  has  been  enabled, -rfbauth, etc) If you do not
625              want  to  require  a  password  for  reverse   connections   set
626              X11VNC_REVERSE_CONNECTION_NO_AUTH=1  in  your environment before
627              starting x11vnc.
628
629              If string contains "/" it is instead interpreted as  a  file  to
630              periodically  check  for  new hosts.  The first line is read and
631              then the file is truncated.  Be careful about  the  location  of
632              this file if x11vnc is running as root (e.g. via gdm(1) , etc).
633
634              Repeater  mode:  Some  services  provide  an  intermediate  "vnc
635              repeater":  http://www.uvnc.com/addons/repeater.html  (and  also
636              http://koti.mbnet.fi/jtko/  for  linux  port)  that  acts  as  a
637              proxy/gateway.  Modes like these require an initial string to be
638              sent  for  the  reverse  connection  before  the VNC protocol is
639              started.  Here are the ways to do this:
640
641              -connect           pre=some_string+host:port            -connect
642              pre128=some_string+host:port -connect repeater=ID:1234+host:port
643              -connect repeater=23.45.67.89::5501+host:port
644
645              SSVNC notation is also supported:
646
647              -connect repeater://host:port+ID:1234
648
649              As with normal -connect usage, if the repeater port is not  sup‐
650              plied 5500 is assumed.
651
652              The  basic  idea is between the special tag, e.g. "pre=" and "+"
653              is the pre-string to be sent.  Note that in this case  host:port
654              is  the  repeater  server, NOT the vnc viewer.  Somehow the pre-
655              string tells the repeater server how to find the vnc viewer  and
656              connect you to it.
657
658              In  the  case pre=some_string+host:port, "some_string" is simply
659              sent. In the case preNNN=some_string+host:port "some_string"  is
660              sent  in  a  null padded buffer of length NNN.  repeater= is the
661              same as pre250=, this is the ultravnc repeater buffer size.
662
663              Strings like "\n" and "\r", etc. are  expanded  to  newline  and
664              carriage  return.   "\c"  is  expanded  to "," since the connect
665              string is comma separated.
666
667              See also the -proxy option below for additional  ways  to  plumb
668              reverse connections.
669
670              Reverse  SSL: using -connect in -ssl mode makes x11vnc act as an
671              SSL client (initiates SSL connection) rather than an SSL server.
672              The  idea is x11vnc might be connecting to stunnel on the viewer
673              side with the viewer in listening mode.  If you do not want this
674              behavior,  use -env X11VNC_DISABLE_SSL_CLIENT_MODE=1.  With this
675              the viewer side can act as the SSL client as  it  normally  does
676              for forward connections.
677
678              Reverse SSL Repeater mode:  This will work, but note that if the
679              VNC Client does any sort of a 'Fetch Cert'  action  before  con‐
680              necting,  then  the Repeater will likely drop the connection and
681              both sides will need to restart.   Consider  the  use  of  -con‐
682              nect_or_exit and -loop300,2 to have x11vnc reconnect once to the
683              repeater after the fetch.  You will probably also want to supply
684              -sslonly  to  avoid  x11vnc thinking the delay in response means
685              the  connection  is   VeNCrypt.    The   env   var   X11VNC_DIS‐
686              ABLE_SSL_CLIENT_MODE=1  discussed above may also be useful (i.e.
687              the viewer can do a forward connection as it normally does.)
688
689              IPv6: as of x11vnc 0.9.10 the -connect option should connect  to
690              IPv6 hosts properly.  If there are problems you can disable IPv6
691              by setting -DX11VNC_IPV6=0 in  CPPFLAGS  when  configuring.   If
692              there  problems  connecting  to IPv6 hosts consider a relay like
693              the included inet6to4 script or the -proxy option.
694
695       -connect_or_exit str
696
697              As with -connect, except if none of the reverse connections suc‐
698              ceed, then x11vnc shuts down immediately
699
700              An easier to type alias for this option is '-coe'
701
702              By the way, if you do not want x11vnc to listen on ANY interface
703              use -rfbport 0  which is handy for the -connect_or_exit mode.
704
705       -proxy string
706
707              Use proxy in string (e.g.  host:port)  as  a  proxy  for  making
708              reverse connections (-connect or -connect_or_exit options).
709
710              Web proxies are supported, but note by default most of them only
711              support destination connections to ports 443  or  563,  so  this
712              might  not  be  very  useful (the viewer would need to listen on
713              that port or the router would have to do a port redirection).
714
715              A  web  proxy  may  be  specified  by  either   "host:port"   or
716              "http://host:port"  (the port is required even if it is the com‐
717              mon choices 80 or 8080)
718
719              SOCKS4, SOCKS4a, and SOCKS5 are also supported.   SOCKS  proxies
720              normally  do  not have restrictions on the destination port num‐
721              ber.
722
723              Use a format like this: socks://host:port or socks5://host:port.
724              Note  that  ssh  -D  does not support SOCKS4a, so use socks5://.
725              For socks:// SOCKS4 is used on a numerical IP  and  "localhost",
726              otherwise  SOCKS4a is used (and so the proxy tries to do the DNS
727              lookup).
728
729              An experimental mode is "-proxy http://host:port/..."  Note  the
730              "/"  after  the  port  that  distinguishes  it from a normal web
731              proxy.  The port must be supplied even if it is the default  80.
732              For  this mode a GET is done to the supplied URL with the string
733              host=H&port=P appended.  H and P will be  the  -connect  reverse
734              connect  host and port.  Use the string "__END__" to disable the
735              appending.  The basic idea here is that maybe  some  cgi  script
736              provides  the actual viewer hookup and tunnelling.  How to actu‐
737              ally achieve this within cgi, php, etc. is not clear...  A  cus‐
738              tom web server or apache module would be straight-forward.
739
740              Another  experimental  mode is "-proxy ssh://user@host" in which
741              case a SSH tunnel is used for  the  proxying.   "user@"  is  not
742              needed  unless your unix username is different on "host".  For a
743              non-standard SSH port use ssh://user@host:port.  If proxies  are
744              chained  (see next paragraph) then the ssh one must be the first
745              one.  If ssh-agent is not active, then the ssh password needs to
746              be entered in the terminal where x11vnc is running.  Examples:
747
748              -connect localhost:0 -proxy ssh://me@friends-pc:2222
749
750              -connect snoopy:0 -proxy ssh://ssh.company.com
751
752              Multiple  proxies  may  be chained together in case one needs to
753              ricochet off of a number of  hosts  to  finally  reach  the  VNC
754              viewer.   Up to 3 may be chained, separate them by commas in the
755              order    they    are    to    be    connected     to.      E.g.:
756              http://host1:port1,socks5://host2:port2     or    three    like:
757              first,second,third
758
759              IPv6: as of x11vnc 0.9.10 the -proxy option  should  connect  to
760              IPv6 hosts properly.  If there are problems you can disable IPv6
761              by setting -DX11VNC_IPV6=0 in  CPPFLAGS  when  configuring.   If
762              there  problems  connecting  to IPv6 hosts consider a relay like
763              the included inet6to4 script.
764
765       -vncconnect, -novncconnect
766
767              Monitor the VNC_CONNECT X property set by the standard VNC  pro‐
768              gram  vncconnect(1).   When  the  property  is  set to "host" or
769              "host:port" establish  a  reverse  connection.   Using  xprop(1)
770              instead  of vncconnect may work (see the FAQ).  The -remote con‐
771              trol mechanism uses X11VNC_REMOTE channel, and this option  dis‐
772              ables/enables it as well.  Default: -vncconnect
773
774              To  use  different  names for these X11 properties (e.g. to have
775              separate communication channels for  multiple  x11vnc's  on  the
776              same display) set the VNC_CONNECT or X11VNC_REMOTE env. vars. to
777              the     string     you     want,     for      example:      -env
778              X11VNC_REMOTE=X11VNC_REMOTE_12345 Both sides of the channel must
779              use the same unique name.  The same can be done for the internal
780              X11VNC_TICKER property (heartbeat and timestamp) if desired.
781
782       -allow host1[,host2..]
783
784              Only allow client connections from hosts matching the comma sep‐
785              arated list of hostnames or IP addresses.  By ending in  a  ".",
786              it  can  also  be  a numerical IP prefix, e.g. "192.168.100." to
787              match a simple subnet, for more control build LibVNCServer  with
788              libwrap  support  (See  the FAQ).  If the list contains a "/" it
789              instead is a interpreted as a file containing addresses or  pre‐
790              fixes  that  is  re-read each time a new client connects.  Lines
791              can be commented out with the "#" character in the usual way.
792
793              -allow applies in -ssl mode, but not in -stunnel mode.
794
795              IPv6: as of x11vnc 0.9.10 a host can be specified in IPv6 numer‐
796              ical format, e.g. 2001:4860:b009::93
797
798              Env. vars: Set -env X11VNC_DEBUG_ACCESS=1 to print out debugging
799              info    during    the    check_access()    call.     Set    -env
800              X11VNC_ALLOW_FULLMATCH=1  to force a full string match, that is,
801              no subnet "." matching will be performed.
802
803              Unix sockets: if -unixsock is being used and you want  to  limit
804              TCP  access  also  you  must  also  include the path to the unix
805              socket prefixed with "unix=" in the  allow  list,  e.g.:  -allow
806              192.168.100.3,unix=/tmp/mysock If the socket is not a named one,
807              e.g. created via socketpair(2) with -inetd, then you must supply
808              the   generic   name   x11vnc   gives   to   it,   e.g.   -allow
809              192.168.100.3,UNNAMED_AF_UNIX In both cases it must be an  exact
810              string match to be allowed to connect.  Note that since you com‐
811              pletely control these local non-TCP access methods by file  sys‐
812              tem  permissions,  etc.,  it is not useful to guard against them
813              with -allow, however you still need to have them  in  the  allow
814              list to let them connect.
815
816       -localhost
817
818              Basically the same as "-allow 127.0.0.1".
819
820              Note:  if  you  want  to restrict which network interface x11vnc
821              listens on, see the -listen option below.  E.g. "-listen  local‐
822              host"  or "-listen 192.168.3.21".  As a special case, the option
823              "-localhost" implies "-listen localhost".
824
825              A rare case, but for non-localhost -listen usage, if you use the
826              remote  control  mechanism  (-R) to change the -listen interface
827              you may need to manually adjust the -allow list (and vice versa)
828              to  avoid  situations  where  no  connections  (or too many) are
829              allowed.
830
831              If you do not want x11vnc to listen on ANY TCP  interface  (evi‐
832              dently  you  are  using -connect or -connect_or_exit, or plan to
833              use remote control: -R connect:host, or to use -unixsock), spec‐
834              ify -rfbport 0
835
836              IPv6:  if  IPv6  is supported, this option automatically implies
837              the IPv6 loopback address '::1' as well.
838
839       -unixsock str
840
841              In addition to the regular TCP port, listen on the  unix  socket
842              (AF_UNIX)  'str'  for  incoming  connections.   This mode is for
843              either local connections or a tunnel endpoint  where  one  wants
844              the  file  permission  of the unix socket file to determine what
845              can connect to it.  Example: mkdir ~/s; chmod  700  ~/s;  x11vnc
846              -unixsock  ~/s/mysock -rfbport 0 ...  same as: x11vnc -unixsock‐
847              only ~/s/mysock ...  (see -unixsockonly below.)
848
849              This mode currently requires the modified  libvncserver  bundled
850              in the the x11vnc 0.9.13 tarball and later.
851
852              Note  that the SSVNC unix vncviewer can connect to unix sockets,
853              for example: ssvnc -viewer unix=./s/mysock
854
855              As a special mechanism, if 'str' for either -unixsock or  -unix‐
856              sockonly is of the form "fd=n" where n is a non-negative decimal
857              integer, then instead of  creating  a  unix  socket,  that  file
858              descriptor  (assumed already opened and O_RDWR) will be attached
859              as a VNC client.  Perhaps the program that execs x11vnc has cre‐
860              ated a socketpair(2) to communicate over.  Use this mechanism if
861              -inetd (which is basically fd=0) is not flexible enough for you.
862
863       -unixsockonly str
864
865              Listen on unix socket 'str' only, no TCP ports. First note  that
866              one  can disable all tcp listening ports by specifying '-rfbport
867              0'. The option '-unixsockonly str' is functionally equivalent to
868              '-unixsock str -rfbport 0'
869
870       -listen6 str
871
872              When in IPv6 listen mode "-6", listen only on the network inter‐
873              face with address str.  It also works for link  scope  addresses
874              (fe80::219:dbff:fee5:3f92%eth0)  and IPv6 hostname strings (e.g.
875              ipv6.google.com.)  Use LibVNCServer -listen option for the  IPv4
876              interface.
877
878       -nolookup
879
880              Do  not  use  gethostbyname() or gethostbyaddr() to look up host
881              names or IP numbers.  Use this if name resolution is incorrectly
882              set up and leads to long pauses as name lookups time out, etc.
883
884       -input string
885
886              Fine tuning of allowed user input.  If string does not contain a
887              comma "," the tuning applies only to normal clients.   Otherwise
888              the part before "," is for normal clients and the part after for
889              view-only clients.  "K" is for Keystroke input, "M"  for  Mouse-
890              motion  input,  "B" for Button-click input, "C" is for Clipboard
891              input, and "F" is for  File  transfer  (ultravnc  only).   Their
892              presence in the string enables that type of input.  E.g. "-input
893              M" means normal users can  only  move  the  mouse  and   "-input
894              KMBCF,M"  lets  normal  users  do anything and enables view-only
895              users to move the mouse.  This option is ignored when  a  global
896              -viewonly is in effect (all input is discarded in that case).
897
898       -grabkbd
899
900              When VNC viewers are connected, attempt to the grab the keyboard
901              so a (non-malicious) user sitting at the physical display is not
902              able  to enter keystrokes.  This method uses XGrabKeyboard(3X11)
903              and so it is not secure and does not rule out the person at  the
904              physical  display  injecting  keystrokes  by flooding the server
905              with them, grabbing the keyboard himself, etc.  Some  degree  of
906              cooperation  from the person at the display is assumed.  This is
907              intended for remote help-desk or educational usage modes.
908
909              Note: on  some  recent  (12/2010)  X  servers  and/or  desktops,
910              -grabkbd  no  longer  works: it prevents the window manager from
911              resizing windows and  similar  things.   Try  -ungrabboth  below
912              (might not work.)
913
914       -grabptr
915
916              As -grabkbd, but for the mouse pointer using XGrabPointer(3X11).
917              Unfortunately due to the way the X server works, the  mouse  can
918              still  be  moved around by the user at the physical display, but
919              he will not be able to change window focus with it.   Also  some
920              window  managers  that  call XGrabServer(3X11) for resizes, etc,
921              will act on the local user's input.  Again, some degree of coop‐
922              eration from the person at the display is assumed.
923
924       -ungrabboth
925
926              Whenever there is any input (either keyboard or pointer), ungrab
927              *both* the keyboard and the pointer  while  injecting  the  syn‐
928              thetic  input.   This is to allow window managers, etc. a chance
929              to grab.
930
931       -grabalways
932
933              Apply both -grabkbd and -grabptr even when no  VNC  viewers  are
934              connected.  If you only want one of them, use the -R remote con‐
935              trol to turn the other back on, e.g. -R nograbptr.
936
937              (PASSWORDS:  Note  that  the   LibVNCServer   password   options
938              "-rfbauth file" and "-passwd str" are described at the bottom of
939              the help output.)
940
941       -viewpasswd string
942
943              Supply a 2nd password for view-only logins.  The -passwd  (full-
944              access) password must also be supplied.
945
946       -passwdfile filename
947
948              Specify the LibVNCServer password via the first line of the file
949              filename (instead of via -passwd on the command line where  oth‐
950              ers might see it via ps(1) ).
951
952              See the descriptions below for how to supply multiple passwords,
953              view-only  passwords,  to  specify  external  programs  for  the
954              authentication, and other features.
955
956              If  the filename is prefixed with "rm:" it will be removed after
957              being read.  Perhaps this is useful in limiting the  readability
958              of  the file.  In general, the password file should not be read‐
959              able by untrusted users (BTW: neither should  the  VNC  -rfbauth
960              file: it is NOT encrypted, only obscured with a fixed key).
961
962              If the filename is prefixed with "read:" it will periodically be
963              checked for changes and reread.  It is guaranteed to  be  reread
964              just  when  a  new  client connects so that the latest passwords
965              will be used.
966
967              If filename is prefixed with "cmd:" then the  string  after  the
968              ":"  is  run  as  an external command: the output of the command
969              will be interpreted as if it were read from a password file (see
970              below).  If the command does not exit with 0, then x11vnc termi‐
971              nates immediately.  To specify more than 1000 passwords this way
972              set  X11VNC_MAX_PASSWDS before starting x11vnc.  The environment
973              variables are set as in -accept.
974
975              Note that due to the VNC protocol only the first 8 characters of
976              a password are used (DES key).
977
978              If  filename  is  prefixed with "custom:" then a custom password
979              checker is supplied as an external command  following  the  ":".
980              The  command  will  be  run when a client authenticates.  If the
981              command exits with 0 the client is  accepted,  otherwise  it  is
982              rejected.  The environment variables are set as in -accept.
983
984              The standard input to the custom command will be a decimal digit
985              "len" followed by a newline. "len" specifies the challenge  size
986              and  is usually 16 (the VNC spec).  Then follows len bytes which
987              is the random challenge string that was sent to the client. This
988              is then followed by len more bytes holding the client's response
989              (i.e. the challenge string encrypted via DES with the user pass‐
990              word in the standard situation).
991
992              The  "custom:"  scheme  can be useful to implement dynamic pass‐
993              words or to implement methods where longer passwords and/or dif‐
994              ferent  encryption algorithms are used.  The latter will require
995              customizing the VNC client as well.  One could create an  MD5SUM
996              based scheme for example.  See also -unixpw_cmd below.
997
998              File format for -passwdfile:
999
1000              If multiple non-blank lines exist in the file they are all taken
1001              as valid passwords.  Blank lines are  ignored.   Password  lines
1002              may  be "commented out" (ignored) if they begin with the charac‐
1003              ter "#" or the line contains the string "__SKIP__".   Lines  may
1004              be annotated by use of the "__COMM__" string: from it to the end
1005              of the line is ignored.  An empty password may be specified  via
1006              the  "__EMPTY__"  string  on  a line by itself (note your viewer
1007              might not accept empty passwords).
1008
1009              If the string "__BEGIN_VIEWONLY__" appears on a line by  itself,
1010              the  remaining passwords are used for viewonly access.  For com‐
1011              patibility, as a special case if  the  file  contains  only  two
1012              password  lines  the  2nd  one  is  automatically  taken  as the
1013              viewonly password.   Otherwise  the  "__BEGIN_VIEWONLY__"  token
1014              must be used to have viewonly passwords.  (tip: make the 3rd and
1015              last line be "__BEGIN_VIEWONLY__" to have  2  full-access  pass‐
1016              words)
1017
1018       -showrfbauth filename
1019
1020              Print  to  the  screen  the  obscured  VNC  password kept in the
1021              rfbauth file filename and then exit.
1022
1023       -usepw
1024
1025              If no other password method was supplied on  the  command  line,
1026              first  look for ~/.vnc/passwd and if found use it with -rfbauth;
1027              next, look for ~/.vnc/passwdfile and use  it  with  -passwdfile;
1028              otherwise,   prompt   the   user   for   a  password  to  create
1029              ~/.vnc/passwd and use it with the -rfbauth option.  If  none  of
1030              these succeed x11vnc exits immediately.
1031
1032       -storepasswd pass file
1033
1034              Store  password pass as the VNC password in the file file.  Once
1035              the password is stored the program exits.  Use the password  via
1036              "-rfbauth file"
1037
1038              If  called with no arguments, "x11vnc -storepasswd", the user is
1039              prompted  for  a  password  and  it  is  stored  in   the   file
1040              ~/.vnc/passwd.   Called with one argument, that will be the file
1041              to store the prompted password in.
1042
1043       -nopw
1044
1045              Disable the big warning message when you use x11vnc without some
1046              sort of password.
1047
1048       -accept string
1049
1050              Run  a  command (possibly to prompt the user at the X11 display)
1051              to decide whether an incoming client should be allowed  to  con‐
1052              nect or not.  string is an external command run via system(3) or
1053              some special cases described below.  Be sure to quote string  if
1054              it contains spaces, shell characters, etc.  If the external com‐
1055              mand returns 0 the client is accepted, otherwise the  client  is
1056              rejected.   See  below for an extension to accept a client view-
1057              only.
1058
1059              If x11vnc is running as root (say from inetd(8) or from  display
1060              managers xdm(1) , gdm(1) , etc), think about the security impli‐
1061              cations carefully before supplying this option (likewise for the
1062              -gone option).
1063
1064              Environment:  The RFB_CLIENT_IP environment variable will be set
1065              to the incoming client IP number and the port in RFB_CLIENT_PORT
1066              (or   -1   if   unavailable).    Similarly,   RFB_SERVER_IP  and
1067              RFB_SERVER_PORT (the x11vnc side of the connection), are set  to
1068              allow  identification  of  the  tcp virtual circuit.  The x11vnc
1069              process id will be in RFB_X11VNC_PID,  a  client  id  number  in
1070              RFB_CLIENT_ID,  and  the  number  of  other connected clients in
1071              RFB_CLIENT_COUNT.  RFB_MODE will be "accept".  RFB_STATE will be
1072              PROTOCOL_VERSION, SECURITY_TYPE, AUTHENTICATION, INITIALISATION,
1073              NORMAL, or UNKNOWN indicating up to which state the  client  has
1074              achieved.   RFB_LOGIN_VIEWONLY  will  be  0, 1, or -1 (unknown).
1075              RFB_USERNAME, RFB_LOGIN_TIME, and RFB_CURRENT_TIME may  also  be
1076              set.
1077
1078              If  string  is "popup" then a builtin popup window is used.  The
1079              popup will time out after 120 seconds, use "popup:N"  to  modify
1080              the timeout to N seconds (use 0 for no timeout).
1081
1082              In the case of "popup" and when the -unixpw option is specified,
1083              then a *second* window will be popped up after the user success‐
1084              fully logs in via his UNIX password.  This time the user will be
1085              identified as UNIX:username@hostname, the "UNIX:"  prefix  indi‐
1086              cates  which  user  the viewer logged as via -unixpw.  The first
1087              popup is only for whether to allow him to even  *try*  to  login
1088              via unix password.
1089
1090              If  string  is "xmessage" then an xmessage(1) invocation is used
1091              for the command.  xmessage must be installed on the machine  for
1092              this to work.
1093
1094              Both "popup" and "xmessage" will present an option for accepting
1095              the client "View-Only" (the client can only watch).  This option
1096              will  not be presented if -viewonly has been specified, in which
1097              case the entire display is view only.
1098
1099              If the user supplied command is  prefixed  with  something  like
1100              "yes:0,no:*,view:3  mycommand  ..."  then  this  associates  the
1101              numerical command return code with the actions: accept,  reject,
1102              and accept-view-only, respectively.  Use "*" instead of a number
1103              to indicate the default action (in case the command  returns  an
1104              unexpected value).  E.g. "no:*" is a good choice.
1105
1106              Note  that  x11vnc blocks while the external command or popup is
1107              running (other clients may see no updates during  this  period).
1108              So  a person sitting a the physical display is needed to respond
1109              to an popup prompt. (use a 2nd x11vnc if you lock yourself out).
1110
1111              More -accept tricks: use "popupmouse" to only allow mouse clicks
1112              in the builtin popup to be recognized.  Similarly use "popupkey"
1113              to only recognize keystroke responses.  These are to help  avoid
1114              the  user accidentally accepting a client by typing or clicking.
1115              All 3 of the popup keywords can be followed by +N+M to supply  a
1116              position  for  the  popup  window.  The default is to center the
1117              popup window.
1118
1119       -afteraccept string
1120
1121              As -accept, except to run a user supplied command after a client
1122              has  been  accepted  and  authenticated. RFB_MODE will be set to
1123              "afteraccept" and the other RFB_* variables are as  in  -accept.
1124              Unlike  -accept,  the  command return code is not interpreted by
1125              x11vnc.  Example: -afteraccept 'killall xlock &'
1126
1127       -gone string
1128
1129              As -accept, except to run a user supplied command when a  client
1130              goes away (disconnects).  RFB_MODE will be set to "gone" and the
1131              other RFB_* variables are as in -accept.   The  "popup"  actions
1132              apply  as  well.  Unlike -accept, the command return code is not
1133              interpreted by x11vnc.  Example: -gone 'xlock &'
1134
1135       -unixpw [list]
1136
1137              Use Unix username and password authentication.  x11vnc will  use
1138              the  su(1)  program to verify the user's password.  [list] is an
1139              optional comma separated list of allowed Unix usernames.  If the
1140              [list] string begins with the character "!" then the entire list
1141              is taken as an exclude list.  See  below  for  per-user  options
1142              that can be applied.
1143
1144              A  familiar  "login:" and "Password:" dialog is presented to the
1145              user on a black screen inside the vncviewer.  The connection  is
1146              dropped  if  the  user fails to supply the correct password in 3
1147              tries or does not send one before a 45 second timeout.  Existing
1148              clients are view-only during this period.
1149
1150              If  the first character received is "Escape" then the unix user‐
1151              name will not be displayed after "login:" as it is typed.   This
1152              could  be  of  use  for  VNC viewers that automatically type the
1153              username and password.
1154
1155              Since the detailed behavior of su(1) can vary from OS to OS  and
1156              for  local  configurations,  test  the mode before deployment to
1157              make sure it is working properly.  x11vnc  will  attempt  to  be
1158              conservative and reject a login if anything abnormal occurs.
1159
1160              One  case  to note: FreeBSD and the other BSD's by default it is
1161              impossible for the user running x11vnc  to  validate  his  *own*
1162              password  via  su(1)  (commenting  out  the pam_self.so entry in
1163              /etc/pam.d/su eliminates this behavior).  So  the  x11vnc  login
1164              will always *FAIL* for this case (even when the correct password
1165              is supplied).
1166
1167              A possible workaround for this on *BSD would be to start  x11vnc
1168              as  root  with the "-users +nobody" option to immediately switch
1169              to user nobody where the su'ing will proceed normally.
1170
1171              Another source of potential problems are PAM modules that prompt
1172              for  extra info, e.g. password aging modules.  These logins will
1173              fail as well even when the correct password is supplied.
1174
1175              **IMPORTANT**: to prevent the Unix password being sent in *clear
1176              text*  over the network, one of two schemes will be enforced: 1)
1177              the -ssl builtin SSL mode, or 2)  require  both  -localhost  and
1178              -stunnel be enabled.
1179
1180              Method  1)  ensures  the traffic is encrypted between viewer and
1181              server.  A PEM file will be required, see the  discussion  under
1182              -ssl  below  (under  some  circumstances  a temporary one can be
1183              automatically generated).
1184
1185              Method 2) requires the viewer connection to appear to come  from
1186              the  same  machine x11vnc is running on (e.g. from a ssh -L port
1187              redirection).  And that  the  -stunnel  SSL  mode  be  used  for
1188              encryption  over  the  network. (see the description of -stunnel
1189              below).
1190
1191              Note: as a convenience, if you ssh(1) in  and  start  x11vnc  it
1192              will check if the environment variable SSH_CONNECTION is set and
1193              appears reasonable.  If it  does,  then  the  -ssl  or  -stunnel
1194              requirement  will  be  dropped since it is assumed you are using
1195              ssh for the encrypted tunnelling.  -localhost is still enforced.
1196              Use  -ssl  or -stunnel to force SSL usage even if SSH_CONNECTION
1197              is set.
1198
1199              To override the above restrictions you can set environment vari‐
1200              ables before starting x11vnc:
1201
1202              Set  UNIXPW_DISABLE_SSL=1  to  disable  requiring either -ssl or
1203              -stunnel (as under SSH_CONNECTION.)  Evidently you will be using
1204              a different method to encrypt the data between the vncviewer and
1205              x11vnc: perhaps ssh(1) or an  IPSEC  VPN.  -localhost  is  still
1206              enforced (however, see the next paragraph.)
1207
1208              Set   UNIXPW_DISABLE_LOCALHOST=1   to   disable  the  -localhost
1209              requirement in -unixpw modes.  One should never  do  this  (i.e.
1210              allow  the  Unix  passwords to be sniffed on the network.)  This
1211              also disables the localhost requirement for reverse  connections
1212              (see below.)
1213
1214              Note  that  use  of  -localhost  with ssh(1) (and no -unixpw) is
1215              roughly the same as requiring a Unix user login  (since  a  Unix
1216              password or the user's public key authentication is used by sshd
1217              on the machine where x11vnc runs and only local connections from
1218              that machine are accepted).
1219
1220              Regarding reverse connections (e.g. -R connect:host and -connect
1221              host), when the -localhost constraint is in effect then  reverse
1222              connections  can  only  be  used  to connect to the same machine
1223              x11vnc is running on (default port 5500).  Please use a  ssh  or
1224              stunnel  port  redirection  to  the viewer machine to tunnel the
1225              reverse connection over an encrypted channel.
1226
1227              In -inetd mode the Method 1) will be enforced  (not  Method  2).
1228              With  -ssl  in  effect reverse connections are disabled.  If you
1229              override this via env. var, be sure to also use encryption  from
1230              the  viewer  to  inetd.  Tip: you can also have your own stunnel
1231              spawn x11vnc in -inetd mode (thereby bypassing inetd).  See  the
1232              FAQ for details.
1233
1234              The  user  names in the comma separated [list] may have per-user
1235              options after a ":", e.g. "fred:opts" where "opts" is a "+" sep‐
1236              arated   list  of  "viewonly",  "fullaccess",  "input=XXXX",  or
1237              "deny", e.g. "karl,wally:viewonly,boss:input=M".   For  "input="
1238              it is the K,M,B,C described under -input.
1239
1240              If  an item in the list is "*" that means those options apply to
1241              all users.  It ALSO implies all users  are  allowed  to  log  in
1242              after supplying a valid password.  Use "deny" to explicitly deny
1243              some users if you use "*" to set a  global  option.   If  [list]
1244              begins  with  the "!" character then "*" is ignored for checking
1245              if the user is allowed, but the option values associated with it
1246              do apply as normal.
1247
1248              There  are  also some utilities for checking passwords if [list]
1249              starts with the "%" character.  See the quick_pw() function  for
1250              more details.  Description: "%-" or "%stdin" means read one line
1251              from stdin of form user:pass. "%stdin2" means read the  username
1252              from the first stdin line and the password from the second stdin
1253              line.  "%pipe" means the first line of stdin  is  user:pass,  if
1254              UNIXPW_CMD_STDIN  is  set  then  that  string  is piped into the
1255              UNIXPW_CMD command (see next paragraph), otherwise the 2nd  line
1256              of  stdin  is  read, if it a positive number that many bytes are
1257              read from stdin and are piped into the command, if it is -1 then
1258              one more line, up to 8000 bytes, is read from stdin and piped to
1259              the command.  "%env" means user:pass is in UNIXPW  env  var.   A
1260              leading "%/" or "%." means read the first line from the filename
1261              that follows after the % character. % by itself means prompt for
1262              the username and password.  Otherwise: %user:pass   For example:
1263              -unixpw %fred:swordfish  For the other cases user:pass  is  read
1264              from  the indicated source.  If the password is correct 'Y user'
1265              is printed and the program exit code is 0.  If the  password  is
1266              incorrect  it  prints 'N user' and the exit code is 1.  If there
1267              is some other error the exit code is 2.   This  feature  enables
1268              x11vnc  to  be  a  general  unix user password checking tool; it
1269              could be used from scripts or other programs.  These %  password
1270              checks,  except  for  "%pipe", also apply to the -unixpw_nis and
1271              -unixpw_cmd options.
1272
1273              For the % password check, if the env. var. UNIXPW_CMD is set  to
1274              a  command  then it is run as the user (assuming the password is
1275              correct.)  The output of the command is not printed, the program
1276              or  script  must manage that by some other means.  The exit code
1277              of x11vnc will depend on the exit code of the  command  that  is
1278              run.
1279
1280              When  interacting  with /bin/su to login x11vnc tries to emulate
1281              typing in the pty, set X11VNC_SLOW_PW_MS to tune  this  (default
1282              50 ms between characters.)
1283
1284              Use  -nounixpw  to disable unixpw mode if it was enabled earlier
1285              in the cmd line (e.g. -svc mode)
1286
1287       -unixpw_nis [list]
1288
1289              As -unixpw above, however do not use su(1) but  rather  use  the
1290              traditional  getpwnam(3)  + crypt(3) method to verify passwords.
1291              All of the above -unixpw options and constraints apply.
1292
1293              This mode requires that the  encrypted  passwords  be  readable.
1294              Encrypted  passwords  stored in /etc/shadow will be inaccessible
1295              unless x11vnc is run as root.
1296
1297              This is called "NIS" mode simply because in most NIS setups user
1298              encrypted  passwords  are accessible (e.g. "ypcat passwd") by an
1299              ordinary user and so that user can authenticate ANY user.
1300
1301              NIS is not required for this mode to work (only that getpwnam(3)
1302              return  the  encrypted password is required), but it is unlikely
1303              it will work (as an ordinary user) for most modern  environments
1304              unless  NIS is available.  On the other hand, when x11vnc is run
1305              as root it will be able to to access /etc/shadow even if NIS  is
1306              not  available  (note running as root is often done when running
1307              x11vnc from inetd and xdm/gdm/kdm).
1308
1309              Looked at another way, if you do  not  want  to  use  the  su(1)
1310              method  provided  by  -unixpw  (i.e.  su_verify()),  you can run
1311              x11vnc as root and use -unixpw_nis.  Any users with passwords in
1312              /etc/shadow can then be authenticated.
1313
1314              In  -unixpw_nis  mode,  under  no circumstances is x11vnc's user
1315              password verifying function based on su called (i.e.  the  func‐
1316              tion su_verify() that runs /bin/su in a pseudoterminal to verify
1317              passwords.)  However, if -unixpw_nis is used in conjunction with
1318              the -find and -create -display WAIT:... modes then, if x11vnc is
1319              running as root, /bin/su may be called  externally  to  run  the
1320              find or create commands.
1321
1322       -unixpw_cmd cmd
1323
1324              As  -unixpw  above,  however do not use su(1) but rather run the
1325              externally supplied command cmd.  The first line  of  its  stdin
1326              will  be the username and the second line the received password.
1327              If the command exits with status 0 (success) the VNC  user  will
1328              be accepted.  It will be rejected for any other return status.
1329
1330              Dynamic  passwords  and  non-unix  passwords,  e.g. LDAP, can be
1331              implemented this way by providing your own  custom  helper  pro‐
1332              gram.  Note that the remote viewer is given 3 tries to enter the
1333              correct password, and so the program may be called in a row that
1334              many (or more) times.
1335
1336              If  a  list  of allowed users is needed to limit who can log in,
1337              use -unixpw [list] in addition to this option.
1338
1339              In FINDDISPLAY and FINDCREATEDISPLAY modes the cmd will also  be
1340              run  with the RFB_UNIXPW_CMD_RUN env. var.  non-empty and set to
1341              the corresponding display find/create command.   The  first  two
1342              lines of input are the username and passwd as in the normal case
1343              described above.  To support FINDDISPLAY and  FINDCREATEDISPLAY,
1344              cmd  should  run  the  requested  command  as the user (and most
1345              likely refusing to run it if the password is not correct.)  Here
1346              is  an  example  script  (note it has a hardwired bogus password
1347              "abc"!)
1348
1349              #!/bin/sh # Example x11vnc -unixpw_cmd script.  # Read the first
1350              two lines of stdin (user and passwd) read user read pass
1351
1352              debug=0  if  [  $debug  = 1 ]; then echo "user: $user" 1>&2 echo
1353              "pass: $pass" 1>&2 env | egrep -i 'rfb|vnc' 1>&2 fi
1354
1355              # Check if the password is valid.  # (A real example  would  use
1356              ldap  lookup, etc!)  if [ "X$pass" != "Xabc" ]; then exit 1    #
1357              incorrect password fi
1358
1359              if [ "X$RFB_UNIXPW_CMD_RUN" = "X" ]; then  exit  0    #  correct
1360              password  else  #  Run  the requested command (finddisplay) if [
1361              $debug = 1 ]; then echo "run: $RFB_UNIXPW_CMD_RUN" 1>&2 fi  exec
1362              /bin/su - "$user" -c "$RFB_UNIXPW_CMD_RUN" fi exit 1
1363
1364              In  -unixpw_cmd  mode,  under  no circumstances is x11vnc's user
1365              password verifying function based on su called (i.e.  the  func‐
1366              tion su_verify() that runs /bin/su in a pseudoterminal to verify
1367              passwords.)  It is up to the  supplied  unixpw_cmd  to  do  user
1368              switching if desired and if it has the permissions to do so.
1369
1370              See  also "-passwdfile custom:..." above for a non unix username
1371              based custom password checking interface.
1372
1373       -find
1374
1375              Find the user's display using FINDDISPLAY. This is an alias  for
1376              "-display WAIT:cmd=FINDDISPLAY".
1377
1378              Note:  if  a  -display  occurs later on the command line it will
1379              override the -find setting.
1380
1381              For this and the next few options see -display  WAIT:...   below
1382              for all of the details.
1383
1384       -finddpy
1385
1386              Run  the  FINDDISPLAY  program,  print out the found display (if
1387              any)   and   exit.    Output   is   like:   DISPLAY=:0.0    DIS‐
1388              PLAY=:0.0,XPID=12345  or DISPLAY=:0.0,VT=7.  XPID is the process
1389              ID of the found X server.  VT is the Linux virtual  terminal  of
1390              the X server.
1391
1392       -listdpy
1393
1394              Have the FINDDISPLAY program list all of your displays (i.e. all
1395              the X displays on the local machine that you have access  rights
1396              to).  x11vnc then exits.
1397
1398       -findauth [disp]
1399
1400              Apply the -find/-finddpy heuristics to try to guess the XAUTHOR‐
1401              ITY file for DISPLAY 'disp'.  If 'disp' is  not  supplied,  then
1402              the  value  in the -display on the cmdline is used; failing that
1403              $DISPLAY is used; and failing that ":0" is  used.   x11vnc  then
1404              exits.
1405
1406              If  nothing  is  printed out, that means no XAUTHORITY was found
1407              for 'disp'; i.e. failure.  If "XAUTHORITY=" is printed out, that
1408              means  use  the  default (i.e. do not set XAUTHORITY).  If "XAU‐
1409              THORITY=/path/to/file" is printed out, then use that file.
1410
1411              XDM/GDM/KDM: if you are running x11vnc as root and want to  find
1412              the  XAUTHORITY  before anyone has logged into an X session yet,
1413              use: x11vnc -env FD_XDM=1 -findauth ...  (This  will  also  find
1414              the  XAUTHORITY if a user is already logged into the X session.)
1415              When running as root, FD_XDM=1 will  be  tried  if  the  initial
1416              -findauth fails.
1417
1418       -create
1419
1420              First  try to find the user's display using FINDDISPLAY, if that
1421              doesn't succeed create an X session  via  the  FINDCREATEDISPLAY
1422              method.   This is an alias for "-display WAIT:cmd=FINDCREATEDIS‐
1423              PLAY-Xvfb".
1424
1425              Note: if a -display occurs later on the  command  line  it  will
1426              override the -create setting.
1427
1428              SSH  NOTE: for both -find and -create you can (should!)  add the
1429              "-localhost" option to force SSH tunnel access.
1430
1431       -xdummy
1432
1433              As in -create, except Xdummy instead of Xvfb.
1434
1435       -xvnc
1436
1437              As in -create, except Xvnc instead of Xvfb.
1438
1439       -xvnc_redirect
1440
1441              As in -create, except Xvnc.redirect instead of Xvfb.
1442
1443       -xdummy_xvfb
1444
1445              Sets WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb
1446
1447       -create_xsrv str
1448
1449              Sets WAIT:cmd=FINDCREATEDISPLAY-<str>  Can be on  cmdline  after
1450              anything that sets WAIT:.. and other things (e.g. -svc, -xdmsvc)
1451              to adjust the X server list.   Example:  -svc  ...  -create_xsrv
1452              Xdummy,X
1453
1454       -svc
1455
1456              Terminal  services mode based on SSL access.  Alias for -display
1457              WAIT:cmd=FINDCREATEDISPLAY-Xvfb -unixpw -users unixpw= -ssl SAVE
1458              Also "-service".
1459
1460              Note:  if  a  -display, -unixpw, -users, or -ssl occurs later on
1461              the command line it will override the -svc setting.
1462
1463       -svc_xdummy
1464
1465              As -svc except Xdummy instead of Xvfb.
1466
1467       -svc_xvnc
1468
1469              As -svc except Xvnc instead of Xvfb.
1470
1471       -svc_xdummy_xvfb
1472
1473              As -svc with Xdummy,Xvfb.
1474
1475       -xdmsvc
1476
1477              Display manager Terminal services mode based on SSL.  Alias  for
1478              -display  WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp  -unixpw  -users
1479              unixpw= -ssl SAVE  Also "-xdm_service".
1480
1481              Note: if a -display, -unixpw, -users, or -ssl  occurs  later  on
1482              the command line it will override the -xdmsvc setting.
1483
1484              To  create  a  session  a  user will have to first log in to the
1485              -unixpw dialog and then log in again to the XDM/GDM/KDM  prompt.
1486              Subsequent  re-connections  will  only require the -unixpw pass‐
1487              word.  See the  discussion  under  -display  WAIT:...  for  more
1488              details about XDM, etc configuration.
1489
1490              Remember  to  enable XDMCP in the xdm-config, gdm.conf, or kdmrc
1491              configuration file.  See -display WAIT: for more info.
1492
1493       -sshxdmsvc
1494
1495              Display manager Terminal services mode based on SSH.  Alias  for
1496              -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp -localhost.
1497
1498              The  -localhost  option  constrains connections to come in via a
1499              SSH tunnel (which will require a login).  To create a session  a
1500              user  will  also have to log into the XDM GDM KDM prompt. Subse‐
1501              quent re-connections will only only require the SSH login.   See
1502              the  discussion  under  -display WAIT:... for more details about
1503              XDM, etc configuration.
1504
1505              Remember to enable XDMCP in the xdm-config, gdm.conf,  or  kdmrc
1506              configuration file.  See -display WAIT: for more info.
1507
1508       -unixpw_system_greeter
1509
1510              Present a "Press 'Escape' for System Greeter" option to the con‐
1511              necting VNC client in combined -unixpw and xdmcp  FINDCREATEDIS‐
1512              PLAY modes (e.g. -xdmsvc).
1513
1514              Normally  in  a  -unixpw mode the VNC client must supply a valid
1515              username and password to gain access.  However, if  -unixpw_sys‐
1516              tem_greeter   is  supplied  AND  the  FINDCREATEDISPLAY  command
1517              matches 'xdmcp', then the user has the option  to  press  Escape
1518              and  then  get  a  XDM/GDM/KDM login/greeter panel instead. They
1519              will then  supply  a  username  and  password  directly  to  the
1520              greeter.
1521
1522              Otherwise,  in xdmcp FINDCREATEDISPLAY mode the user must supply
1523              his username and password TWICE.  First to  the  initial  unixpw
1524              login  dialog, and second to the subsequent XDM/GDM/KDM greeter.
1525              Note that if the user re-connects and supplies his username  and
1526              password  in  the unixpw dialog the xdmcp greeter is skipped and
1527              he is connected directly to his  existing  X  session.   So  the
1528              -unixpw_system_greeter  option  avoids  the  extra password at X
1529              session creation time.
1530
1531              Example:  x11vnc -xdmsvc -unixpw_system_greeter See -unixpw  and
1532              -display WAIT:... for more info.
1533
1534              The  special  options  after  a colon at the end of the username
1535              (e.g.  user:solid)  described  under  -display  WAIT:  are  also
1536              applied  in  this mode if they are typed in before the user hits
1537              Escape.  The username is ignored but the colon options are not.
1538
1539              The default message is 2 lines in a small  font,  set  the  env.
1540              var.  X11VNC_SYSTEM_GREETER1=true  for  a  1  line  message in a
1541              larger font.
1542
1543              If the user pressed Escape the FINDCREATEDISPLAY command will be
1544              run with the env. var. X11VNC_XDM_ONLY=1.
1545
1546              Remember  to  enable XDMCP in the xdm-config, gdm.conf, or kdmrc
1547              configuration file.  See -display WAIT: for more info.
1548
1549       -redirect port
1550
1551              As in FINDCREATEDISPLAY-Xvnc.redirect mode except redirect imme‐
1552              diately  (i.e.  without  X session finding or creation) to a VNC
1553              server listening on port. You can also supply host:port to redi‐
1554              rect to a different machine.
1555
1556              If  0  <= port < 200 it is taken as a VNC display (5900 is added
1557              to get the actual port), if port < 0 then -port is used.
1558
1559              Probably the only reason to use the -redirect option is in  con‐
1560              junction  with  SSL  support,  e.g. -ssl SAVE.  This provides an
1561              easy way to add SSL encryption to a VNC  server  that  does  not
1562              support SSL (e.g. Xvnc or vnc.so) In fact, the protocol does not
1563              even need to be VNC, and so "-rfbport port1 -ssl SAVE  -redirect
1564              host:port2" can act as a replacement for stunnel(1).
1565
1566              This  mode  only allows one redirected connection.  The -forever
1567              option does not apply.  Use -inetd or -loop for persistent  ser‐
1568              vice.
1569
1570       -display WAIT:...
1571
1572              A  special  usage  mode  for the normal -display option.  Useful
1573              with -unixpw, but can be used independently of it.  If the  dis‐
1574              play  string  begins  with  WAIT:  then x11vnc waits until a VNC
1575              client connects before opening the X display (or -rawfb device).
1576
1577              This could be useful for delaying opening the display  for  cer‐
1578              tain usage modes (say if x11vnc is started at boot time and no X
1579              server is running or users logged in yet).
1580
1581              If the string is, e.g. WAIT:0.0 or WAIT:1, i.e. "WAIT" in  front
1582              of a normal X display, then that indicated display is used.
1583
1584              One   can   also   insert   a   geometry  between  colons,  e.g.
1585              WAIT:1280x1024:... to set the size of the display the VNC client
1586              first  attaches to since some VNC viewers will not automatically
1587              adjust to a new framebuffer size.
1588
1589              A more interesting case is like this:
1590
1591              WAIT:cmd=/usr/local/bin/find_display
1592
1593              in which case the command after "cmd="  is  run  to  dynamically
1594              work  out  the  DISPLAY and optionally the XAUTHORITY data.  The
1595              first line of the command  output  must  be  of  the  form  DIS‐
1596              PLAY=<xdisplay>.   On  Linux  if  the  virtual terminal is known
1597              append ",VT=n" to this string and the chvt(1) program will  also
1598              be  run.   Any remaining output is taken as XAUTHORITY data.  It
1599              can be either of the form XAUTHORITY=<file>  or  raw  xauthority
1600              data for the display. For example;
1601
1602              xauth extract - $DISPLAY"
1603
1604              NOTE:  As  specified  in  the previous paragraph, you can supply
1605              your own WAIT:cmd=... program or script, BUT there are two  very
1606              useful  *BUILT-IN*  ones:  FINDDISPLAY  (alias  -find above) and
1607              FINDCREATEDISPLAY (alias -create above.)  Most people use  these
1608              instead of creating their own script.  Read the following (espe‐
1609              cially the BUILT-IN modes sections)  to  see  how  to  configure
1610              these two useful builtin -display WAIT: modes.
1611
1612              In  the  case of -unixpw (and -unixpw_nis only if x11vnc is run‐
1613              ning as root), then the cmd= command is run as the user who just
1614              authenticated via the login and password prompt.
1615
1616              In the case of -unixpw_cmd, the commands will also be run as the
1617              logged-in user, as long as the user-supplied helper program sup‐
1618              ports RFB_UNIXPW_CMD_RUN (see the -unixpw_cmd option.)
1619
1620              Also  in  the  case  of -unixpw, the user logging in can place a
1621              colon at the end of her  username  and  supply  a  few  options:
1622              scale=,  scale_cursor=  (or sc=), solid (or so), id=, clear_mods
1623              (or cm), clear_keys (or ck), clear_all (or ca), repeat,  speeds=
1624              (or  sp=),  readtimeout=  (or rd=), viewonly (or vo), nodisplay=
1625              (or nd=), rotate= (or ro=), or noncache (or nc),  all  separated
1626              by  commas  if  there  is more than one.  After the user logs in
1627              successfully, these options will be applied to the  VNC  screen.
1628              For example,
1629
1630              login: fred:scale=3/4,sc=1,repeat Password: ...
1631
1632              login: runge:sp=modem,rd=120,solid
1633
1634              for  convenience  m/n  implies scale= e.g. fred:3/4  If you type
1635              and enter your  password  incorrectly,  to  retrieve  your  long
1636              "login:"  line  press  the Up arrow once (before typing anything
1637              else).
1638
1639              Most of these colon options only apply to the  builtin  FINDDIS‐
1640              PLAY  and FINDCREATEDISPLAY modes, but note that they are passed
1641              to the extrenal command in the environment as well and so  could
1642              be used.
1643
1644              In  the  login  panel,  press  F1 to get a list of the available
1645              options that you can add after the username.
1646
1647              Another option is "geom=WxH" or "geom=WxHxD" (or ge=). This only
1648              has  an effect in FINDCREATEDISPLAY mode when a virtual X server
1649              such as Xvfb is going to be created.   It  sets  the  width  and
1650              height  of  the  new  display, and optionally the color depth as
1651              well.
1652
1653              You can  also  supply  "gnome",  "kde",  "twm",  "fvwm",  "mwm",
1654              "dtwm",  "wmaker",  "xfce", "lxde", "enlightenment", "Xsession",
1655              or "failsafe" (same as "xterm") to have the created display  use
1656              that mode for the user session.
1657
1658              Specify  "tag=..."  to set the unique FD_TAG desktop session tag
1659              described below.  Note: this  option  will  be  ignored  if  the
1660              FD_TAG  env.  var. is already set or if the viewer-side supplied
1661              value is not completely composed of alphanumeric or '_'  or  '-'
1662              characters.
1663
1664              User  preferences  file:  Instead  of  having  the  user type in
1665              geom=WxH,... etc. every time he logs in to find or create his  X
1666              session,  if you set FD_USERPREFS to a string that does not con‐
1667              tain the "/"  character,  then  the  user's  home  directory  is
1668              prepended  to  that string and if the file exists its first line
1669              is read and appended to any options he supplied  at  the  login:
1670              prompt.   For  example  -env FD_USERPREFS=.x11vnc_create and the
1671              user put "geom=1600x1200" in his ~/.x11vnc_create file.
1672
1673              To disable the  option  setting  set  the  environment  variable
1674              X11VNC_NO_UNIXPW_OPTS=1  before  starting  x11vnc.   To  set any
1675              other options, the user can use the gui (x11vnc -gui connect) or
1676              the  remote  control  method  (x11vnc -R opt:val) during his VNC
1677              session.
1678
1679              So we see the combination of -display WAIT:cmd=...  and  -unixpw
1680              allows  automatic pairing of an unix authenticated VNC user with
1681              his desktop.  This could be very useful on SunRays and also  any
1682              system  where  multiple  users  share a given machine.  The user
1683              does not need to remember special ports or passwords set up  for
1684              his desktop and VNC.
1685
1686              A  nice way to use WAIT:cmd=... is out of inetd(8) (it automati‐
1687              cally forks a new x11vnc for  each  user).   You  can  have  the
1688              x11vnc  inetd spawned process run as, say, root or nobody.  When
1689              run as root (for either inetd or display manager), you can  also
1690              supply  the  option  "-users unixpw=" to have the x11vnc process
1691              switch to the user as well.  Note:  there  will  be  a  2nd  SSL
1692              helper process that will not switch, but it is only encoding and
1693              decoding the encrypted stream at that point.
1694
1695              BUILT-IN modes:
1696
1697              -- Automatic Finding of User X Sessions --
1698
1699              As a special case, WAIT:cmd=FINDDISPLAY will run a  script  that
1700              works  on most Unixes to determine a user's DISPLAY variable and
1701              xauthority data (see who(1) ).
1702
1703              NOTE: The option "-find" is an alias for this mode.
1704
1705              To have this default script printed to  stdout  (e.g.  for  cus‐
1706              tomization)  run  with  WAIT:cmd=FINDDISPLAY-print  To  have the
1707              script run to print what display it would find use "-finddpy" or
1708              WAIT:cmd=FINDDISPLAY-run
1709
1710              The  standard script runs xdpyinfo(1) run on potential displays.
1711              If your X server(s) have a login greeter that exclusively  grabs
1712              the Xserver, then xdpyinfo blocks forever and this mode will not
1713              work.  See www.karlrunge.com/x11vnc/faq.html#faq-display-manager
1714              for  how to disable this for dtgreet on Solaris and possibly for
1715              other greeters.
1716
1717              In -find/cmd=FINDDISPLAY mode, if you set FD_XDM=1, e.g. 'x11vnc
1718              -env  FD_XDM=1  -find  ...'  and x11vnc is running as root (e.g.
1719              inetd) then it will try to find the XAUTHORITY file of a running
1720              XDM/GDM/KDM  login  greeter  (i.e.  no user has logged into an X
1721              session yet.)
1722
1723              As another special case, WAIT:cmd=HTTPONCE will allow x11vnc  to
1724              service one http request and then exit.  This is usually done in
1725              -inetd mode to run  on,  say,  port  5800  and  allow  the  Java
1726              vncviewer to be downloaded by client web browsers.  For example:
1727
1728              5815  stream tcp nowait root /usr/sbin/tcpd /.../x11vnc \ -inetd
1729              -q -http_ssl -prog /.../x11vnc \ -display WAIT:cmd=HTTPONCE
1730
1731              Where /.../x11vnc is the full path to x11vnc.  It is used in the
1732              Apache SSL-portal example (see FAQ).
1733
1734              In  this  mode  you can set X11VNC_SKIP_DISPLAY to a comma sepa‐
1735              rated list of displays (e.g. ":0,:1") to ignore in  the  finding
1736              process.  The ":" is optional.  Ranges n-m e.g. 0-20 can also be
1737              supplied. This string can also be set by the connecting user via
1738              "nd="  using  "+"  instead  of  ","   If  "nd=all"  or  you  set
1739              X11VNC_SKIP_DISPLAY=all then all display finding fails as if you
1740              set X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 (below.)
1741
1742              On  some  systems  lsof(1)  can be very slow.  Set the env. var.
1743              FIND_DISPLAY_NO_LSOF=1 to skip using lsof to  try  to  find  the
1744              Linux   VT   the   X   server  is  running  on.   set  FIND_DIS‐
1745              PLAY_NO_VT_FIND=1 to avoid looking at all.
1746
1747              -- Automatic Creation of User X Sessions --
1748
1749              An interesting option is WAIT:cmd=FINDCREATEDISPLAY that is like
1750              FINDDISPLAY  in that is uses the same method to find an existing
1751              display.  However, if it does  not  find  one  it  will  try  to
1752              *start*  up  an X server session for the user.  This is the only
1753              time x11vnc tries to actually start up an X server.
1754
1755              NOTE: The option "-create" is an alias for this mode.
1756
1757              It will start looking for an open display number at :20 Override
1758              via X11VNC_CREATE_STARTING_DISPLAY_NUMBER=n By default 80 X dis‐
1759              plays are allowed (i.e. going to :99) Override  via  X11VNC_CRE‐
1760              ATE_MAX_DISPLAYS=n
1761
1762              For  its  heuristics, the create display script sets LC_ALL=C so
1763              that command output is uniform.   By  default  it  will  try  to
1764              restore LC_ALL right before starting the user session.  However,
1765              if you don't  mind  it  keeping  LC_ALL=C  set  the  env.  var.:
1766              X11VNC_CREATE_LC_ALL_C_OK=1
1767
1768              By default FINDCREATEDISPLAY will try Xvfb and then Xdummy:
1769
1770              The   Xdummy   wrapper   is  part  of  the  x11vnc  source  code
1771              (x11vnc/misc/Xdummy)  It should be available in  PATH  and  have
1772              run "Xdummy -install" once to create the shared library.  Xdummy
1773              only works on Linux.  As of 12/2009 it no longer needs to be run
1774              as root, and the default is to not run as root.  In some circum‐
1775              stances permissions may require running it  as  root,  in  these
1776              cases  specify FD_XDUMMY_RUN_AS_ROOT=1, this is the same as sup‐
1777              plying -root to the Xdummy cmdline.
1778
1779              Xvfb is available on most platforms and does not require root.
1780
1781              An advantage of Xdummy over Xvfb is that Xdummy  supports  RANDR
1782              dynamic screen resizing.
1783
1784              When  x11vnc  exits (i.e. user disconnects) the X server session
1785              stays running in the background.  The FINDDISPLAY will  find  it
1786              directly  next  time.   The  user must exit the X session in the
1787              usual way for it to terminate (or kill the X server  process  if
1788              all else fails).
1789
1790              To troubleshoot the FINDCREATEDISPLAY mechanism, set the follow‐
1791              ing env. var. to  an  output  log  file,  e.g  -env  CREATE_DIS‐
1792              PLAY_OUTPUT=/tmp/mydebug.txt
1793
1794              So  this is a somewhat odd mode for x11vnc in that it will start
1795              up and poll virtual X servers!  This  can  be  used  from,  say,
1796              inetd(8)  to  provide  a  means  of definitely getting a desktop
1797              (either real or virtual) on the machine.  E.g.  a  desktop  ser‐
1798              vice:
1799
1800              5900 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc -inetd -q
1801              -http -ssl SAVE -unixpw -users  unixpw=\  -passwd  secret  -prog
1802              /.../x11vnc \ -display WAIT:cmd=FINDCREATEDISPLAY
1803
1804              Where /.../x11vnc is the full path to x11vnc.
1805
1806              See the -svc/-service option alias above.
1807
1808              If for some reason you do not want x11vnc to ever try to find an
1809              existing   display   set   the    env.    var    X11VNC_FINDDIS‐
1810              PLAY_ALWAYS_FAILS=1 (also -env ...)  This is the same as setting
1811              X11VNC_SKIP_DISPLAY=all or supplying "nd=all" after "username:"
1812
1813              Use WAIT:cmd=FINDCREATEDISPLAY-print to  print  out  the  script
1814              that is used for this.
1815
1816              You   can  specify  the  preferred  X  server  order  via  e.g.,
1817              WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb,X  and/or leave out  ones
1818              you do not want.  The the case "X" means try to start up a real,
1819              hardware X server using xinit(1)  or  startx(1).   If  there  is
1820              already  an  X  server running the X case may only work on Linux
1821              (see startx(1) ).
1822
1823              "Xvnc" will start up a VNC X server (real-  or  tight-vnc,  e.g.
1824              use  if Xvfb is not available).  "Xsrv" will start up the server
1825              program in the variable "FD_XSRV" if it is  non-empty.  You  can
1826              make  this  be  a wrapper script if you like (it must handle :N,
1827              -geometry, and -depth and other X server options).
1828
1829              You can set the environment  variable  FD_GEOM  (or  X11VNC_CRE‐
1830              ATE_GEOM)  to  WxH  or  WxHxD  to  set  the width and height and
1831              optionally the color depth of the created display.  You can also
1832              set  FD_SESS to be the session (short name of the windowmanager:
1833              kde, gnome, twm, failsafe, etc.). FD_OPTS contains extra options
1834              to pass to the X server. You can also set FD_PROG to be the full
1835              path to the session/windowmanager program.
1836
1837              More FD tricks:  FD_CUPS=port or FD_CUPS=host:port will set  the
1838              cups   printing   environment.   Similarly  for  FD_ESD=port  or
1839              FD_ESD=host:port for esddsp sound redirection.  Set FD_EXTRA  to
1840              a  command to be run a few seconds after the X server starts up.
1841              Set FD_TAG to be a unique name for the session, it is set as  an
1842              X  property, that makes FINDDISPLAY only find sessions with that
1843              tag value.
1844
1845              Set FD_XDMCP_IF to the network interface that the  display  man‐
1846              ager  is  running on; default is 'localhost' but you may need to
1847              set it to '::1' on some IPv6 only systems or misconfigured  dis‐
1848              play managers.
1849
1850              Set FD_NOLISTEN to override the default '-nolisten tcp'
1851
1852              If  you  want  the FINDCREATEDISPLAY session to contact an XDMCP
1853              login manager  (xdm/gdm/kdm)  on  the  same  machine,  then  use
1854              "Xvfb.xdmcp" instead of "Xvfb", etc.  The user will have to sup‐
1855              ply his username and password one more  time  (but  he  gets  to
1856              select  his  desktop  type  so that can be useful).  For this to
1857              work, you will need to enable localhost XDMCP (udp port 177) for
1858              the display manager.  This seems to be:
1859
1860              for gdm in gdm.conf:   Enable=true in section [xdmcp] for kdm in
1861              kdmrc:      Enable=true in section [Xdmcp] for xdm  in  xdm-con‐
1862              fig: DisplayManager.requestPort: 177
1863
1864              See   the   shorthand   options   above  "-svc",  "-xdmsvc"  and
1865              "-sshxdmsvc" that specify the  above  options  for  some  useful
1866              cases.
1867
1868              If  you  set the env. var WAITBG=1 x11vnc will go into the back‐
1869              ground once listening in wait mode.
1870
1871              Another special  mode  is  FINDCREATEDISPLAY-Xvnc.redirect,  (or
1872              FINDDISPLAY-Xvnc.redirect).   In this case it will start up Xvnc
1873              as above if needed, but instead of polling it in its normal way,
1874              it  simply does a socket redirection of the connected VNC viewer
1875              to the Xvnc.
1876
1877              So in Xvnc.redirect x11vnc does no VNC but merely transfers  the
1878              data  back  and  forth.   This  should  be  faster then x11vnc's
1879              polling method, but not as fast as connecting  directly  to  the
1880              Xvnc with the VNC Viewer.  The idea here is to take advantage of
1881              x11vnc's display finding/creating scheme, SSL, and perhaps a few
1882              others.  Most of x11vnc's options do not apply in this mode.
1883
1884              Xvnc.redirect  should  also  work for the vnc.so X server module
1885              for the h/w display however it will work only  for  finding  the
1886              display and the user must already be logged into the X console.
1887
1888       -vencrypt mode
1889
1890              The  VeNCrypt  extension  to  the  VNC protocol allows encrypted
1891              SSL/TLS connections.  If the -ssl mode is enabled, then VeNCrypt
1892              is  enabled  as well BY DEFAULT (they both use a SSL/TLS tunnel,
1893              only the protocol handshake is a little different.)
1894
1895              To control when and how  VeNCrypt  is  used,  specify  the  mode
1896              string.  If mode is "never", then VeNCrypt is not used.  If mode
1897              is "support" (the default) then VeNCrypt is supported.  If  mode
1898              is  "only",  then  the similar and older ANONTLS protocol is not
1899              simultaneously supported.  x11vnc's normal  SSL  mode  (vncs://)
1900              will be supported under -ssl unless you set mode to "force".
1901
1902              If  mode is prefixed with "nodh:", then Diffie Hellman anonymous
1903              key exchange is disabled.  If mode is prefixed  with  "nox509:",
1904              then X509 key exchange is disabled.
1905
1906              To  disable  all Anonymous Diffie-Hellman access (susceptible to
1907              Man-In-The-Middle attack) you will  need  to  supply  "-vencrypt
1908              nodh:support -anontls never" or "-vencrypt nodh:only"
1909
1910              If  mode  is  prefixed  with  "newdh:",  then new Diffie Hellman
1911              parameters are generated for each connection (this can  be  time
1912              consuming:  1-60  secs;  see  -dhparams  below for a faster way)
1913              rather than using the fixed values in the program.  Using fixed,
1914              publicly  known  values  is  not known to be a security problem.
1915              This setting applies to ANONTLS as well.
1916
1917              Long example: -vencrypt newdh:nox509:support
1918
1919              Also, if mode is prefixed with "plain:", then if -unixpw mode is
1920              active  the  VeNCrypt "*Plain" username+passwd method is enabled
1921              for Unix logins.  Otherwise in -unixpw  mode  the  normal  login
1922              panel is provided.
1923
1924              You  *MUST*  supply  the  -ssl option for VeNCrypt to be active.
1925              The -vencrypt option only fine-tunes its operation.
1926
1927       -anontls mode
1928
1929              The ANONTLS extension  to  the  VNC  protocol  allows  encrypted
1930              SSL/TLS  connections.  If the -ssl mode is enabled, then ANONTLS
1931              is enabled as well BY DEFAULT (they both use a  SSL/TLS  tunnel,
1932              only the protocol handshake is a little different.)
1933
1934              ANONTLS is an older SSL/TLS mode introduced by vino.
1935
1936              It  is referred to as 'TLS' for its registered VNC security-type
1937              name, but we use the more descriptive ´ANONTLS' here because  it
1938              provides  only  Anonymous  Diffie-Hellman encrypted connections,
1939              and hence no possibility for certificate authentication.
1940
1941              To control when and  how  ANONTLS  is  used,  specify  the  mode
1942              string.   If mode is "never", then ANONTLS is not used.  If mode
1943              is "support" (the default) then ANONTLS is supported.   If  mode
1944              is  "only", then the similar VeNCrypt protocol is not simultane‐
1945              ously supported.  x11vnc's normal SSL  mode  (vncs://)  will  be
1946              supported under -ssl unless you set mode to "force".
1947
1948              If  mode  is  prefixed  with  "newdh:",  then new Diffie Hellman
1949              parameters are generated for each connection (this can  be  time
1950              consuming:  1-60  secs;  see  -dhparams  below for a faster way)
1951              rather than using the fixed values in the program.  Using fixed,
1952              publicly  known  values  is  not known to be a security problem.
1953              This setting applies to VeNCrypt as well.  See  the  description
1954              of "plain:" under -vencrypt.
1955
1956              Long example: -anontls newdh:plain:support
1957
1958              You *MUST* supply the -ssl option for ANONTLS to be active.  The
1959              -anontls option only fine-tunes its operation.
1960
1961       -sslonly
1962
1963              Same as: "-vencrypt never -anontls never"  i.e. it disables  the
1964              VeNCrypt and ANONTLS encryption methods and only allows standard
1965              SSL tunneling.  You must also supply the -ssl  ...  option  (see
1966              below.)
1967
1968       -dhparams file
1969
1970              For  some  operations  a set of Diffie Hellman parameters (prime
1971              and generator) is needed.  If so, use the parameters in file. In
1972              particular,  the  VeNCrypt  and  ANONTLS  anonymous DH mode need
1973              them.  By default a fixed set is used. If you do not want to  do
1974              that  you  can  specify  "newdh:"  to the -vencrypt and -anontls
1975              options to generate a new set each session.  If that is too slow
1976              for  you,  use  -dhparams file to a set you created manually via
1977              "openssl dhparam -out file 1024"
1978
1979       -nossl
1980
1981              Disable the -ssl option  (see  below).  Since  -ssl  is  off  by
1982              default  -nossl  would  only be used on the commandline to unset
1983              any *earlier* -ssl option (or -svc...)
1984
1985       -ssl [pem]
1986
1987              Use the openssl library (www.openssl.org) to provide a  built-in
1988              encrypted  SSL/TLS  tunnel between VNC viewers and x11vnc.  This
1989              requires libssl support to be  compiled  into  x11vnc  at  build
1990              time.   If  x11vnc is not built with libssl support it will exit
1991              immediately when -ssl is prescribed.  See  the  -stunnel  option
1992              below for an alternative.
1993
1994              The  VNC Viewer-side needs to support SSL/TLS as well.  See this
1995              URL and also the discussion below for ideas on how to enable SSL
1996              support       for       the       viewer:       http://www.karl
1997              runge.com/x11vnc/faq.html#faq-ssl-tun nel-viewers .  x11vnc pro‐
1998              vides  an  SSL  enabled  Java  viewer  applet in the classes/ssl
1999              directory (-http or -httpdir options.)  The SSVNC viewer package
2000              supports SSL tunnels too.
2001
2002              If  the  VNC Viewer supports VeNCrypt or ANONTLS (vino's encryp‐
2003              tion mode) they are also supported by the  -ssl  mode  (see  the
2004              -vencrypt  and  -anontls  options for more info; use -sslonly to
2005              disable both of them.)
2006
2007              Use "-ssl /path/to/mycert.pem" to  specify  an  SSL  certificate
2008              file in PEM format to use to identify and provide a key for this
2009              server.  See  openssl(1)  for  more  info  about  PEMs  and  the
2010              -sslGenCert  and  "-ssl  SAVE"  options  below for how to create
2011              them.
2012
2013              The connecting VNC viewer SSL tunnel can (at its option) authen‐
2014              ticate this server if it has the public key part of the certifi‐
2015              cate (or a common certificate authority, CA, is a more sophisti‐
2016              cated  way  to  verify this server's cert, see -sslGenCA below).
2017              This  authentication  is  done  to   prevent   Man-In-The-Middle
2018              attacks.   Otherwise,  if  the  VNC  viewer  simply accepts this
2019              server's key WITHOUT verification, the traffic is protected from
2020              passive  sniffing on the network, but *NOT* from Man-In-The-Mid‐
2021              dle attacks. There are hacker tools like dsniff/webmitm and cain
2022              that implement SSL Man-In-The-Middle attacks.
2023
2024              If  [pem] is empty or the string "SAVE" then the openssl(1) com‐
2025              mand must be available to generate  the  certificate  the  first
2026              time.  A self-signed certificate is generated (see -sslGenCA and
2027              -sslGenCert for use of a Certificate  Authority.)   It  will  be
2028              saved  to the file ~/.vnc/certs/server.pem.  On subsequent calls
2029              if that file already exists it will be used directly.
2030
2031              Use "SAVE_NOPROMPT" to avoid being prompted to protect the  gen‐
2032              erated  key  with a passphrase.  However in -inetd and -bg modes
2033              there will be no prompting for a passphrase in either case.
2034
2035              If [pem] is "SAVE_PROMPT" the  server.pem  certificate  will  be
2036              created  based  on your answers to its prompts for all info such
2037              as OrganizationalName, CommonName, etc.
2038
2039              Use "SAVE-<string>" and "SAVE_PROMPT-<string>" to refer  to  the
2040              file ~/.vnc/certs/server-<string>.pem instead (it will be gener‐
2041              ated if it does not already exist).   E.g.  "SAVE-charlie"  will
2042              store to the file ~/.vnc/certs/server-charlie.pem
2043
2044              Examples:  x11vnc  -ssl  SAVE -display :0 ...  x11vnc -ssl SAVE-
2045              someother -display :0 ...
2046
2047              If [pem] is "TMP" and the openssl(1) utility command  exists  in
2048              PATH,  then  a temporary, self-signed certificate will be gener‐
2049              ated for this session.  If openssl(1) cannot be used to generate
2050              a temporary certificate x11vnc exits immediately.  The temporary
2051              cert will be discarded when x11vnc exits.
2052
2053              If successful in using openssl(1) to generate a  temporary  cer‐
2054              tificate  in  "SAVE" or "TMP" creation modes, the public part of
2055              it will be displayed to stderr (e.g. one could copy  it  to  the
2056              client-side to provide authentication of the server to VNC view‐
2057              ers.)
2058
2059              NOTE: In "TMP" mode, unless you safely copy the public  part  of
2060              the  temporary  Cert to the viewer for authenticate *every time*
2061              (unlikely...), then only passive sniffing attacks are  prevented
2062              and  you  are  still open to Man-In-The-Middle attacks.  This is
2063              why the default "SAVE" mode is preferred (and more sophisticated
2064              CA mode too).  Only with saved keys AND the VNC viewer authenti‐
2065              cating them (via the public certificate), are  Man-In-The-Middle
2066              attacks prevented.
2067
2068              If  [pem]  is  "ANON"  then  the  Diffie-Hellman  anonymous  key
2069              exchange method is used.  In this mode there are *no*  SSL  cer‐
2070              tificates  and  so it is not possible to authenticate either the
2071              VNC server or VNC client.  Thus only  passive  network  sniffing
2072              attacks are avoided: the "ANON" method is susceptible to Man-In-
2073              The-Middle attacks.  "ANON" is not recommended;  instead  use  a
2074              SSL PEM you created or the default "SAVE" method.
2075
2076              See  -ssldir  below  to  use  a  directory  besides  the default
2077              ~/.vnc/certs
2078
2079              If your x11vnc binary was not compiled with OpenSSL library sup‐
2080              port,  use  of  the -ssl option will induce an immediate failure
2081              and exit.  For such binaries, consider using the -stunnel option
2082              for SSL encrypted connections.
2083
2084              Misc  Info:  In temporary cert creation mode "TMP", set the env.
2085              var. X11VNC_SHOW_TMP_PEM=1 to have x11vnc print out  the  entire
2086              certificate,  including  the PRIVATE KEY part, to stderr.  There
2087              are better ways to get/save this info.   See  "SAVE"  above  and
2088              "-sslGenCert" below.
2089
2090       -ssltimeout n
2091
2092              Set  SSL read timeout to n seconds.  In some situations (i.e. an
2093              iconified viewer in Windows) the viewer stops  talking  and  the
2094              connection  is  dropped after the default timeout (25s for about
2095              the first minute, 43200s later).  Set to zero to  poll  forever.
2096              Set to a negative value to use the builtin setting.
2097
2098              Note  that  this  value does NOT apply to the *initial* ssl init
2099              connection.  The default timeout for that is  20sec.   Use  -env
2100              SSL_INIT_TIMEOUT=n to modify it.
2101
2102       -sslnofail
2103
2104              Exit  at the first SSL connection failure. Useful when scripting
2105              SSL connections (e.g. x11vnc is started via ssh) and you do  not
2106              want x11vnc waiting around for more connections, tying up ports,
2107              etc.
2108
2109       -ssldir dir
2110
2111              Use dir as an  alternate  ssl  certificate  and  key  management
2112              toplevel directory.  The default is ~/.vnc/certs
2113
2114              This  directory  is  used to store server and other certificates
2115              and keys and also other materials.  E.g. in the  simplest  case,
2116              "-ssl SAVE" will store the x11vnc server cert in dir/server.pem
2117
2118              Use  of  alternate  directories via -ssldir allows you to manage
2119              multiple VNC Certificate Authority (CA) keys.  Another use is if
2120              ~/.vnc/cert  is on an NFS share you might want your certificates
2121              and keys to be on a local filesystem to prevent network snooping
2122              (for example -ssldir /var/lib/x11vnc-certs).
2123
2124              -ssldir affects nearly all of the other -ssl* options, e.g. -ssl
2125              SAVE, -sslGenCert, etc..
2126
2127       -sslverify path
2128
2129              For either of the -ssl or -stunnel modes, use  path  to  provide
2130              certificates  to  authenticate incoming VNC *Client* connections
2131              (normally only the server is authenticated in SSL.)  This can be
2132              used  as a method to replace standard password authentication of
2133              clients.
2134
2135              If path is a directory it contains the client (or  CA)  certifi‐
2136              cates  in separate files.  If path is a file, it contains one or
2137              more certificates. See special tokens below.   These  correspond
2138              to  the "CApath = dir" and "CAfile = file" stunnel options.  See
2139              the stunnel(8) manpage for details.
2140
2141              Examples: x11vnc -ssl -sslverify ~/my.crt x11vnc -ssl -sslverify
2142              ~/my_pem_dir/
2143
2144              Note  that  if path is a directory, it must contain the certs in
2145              separate files named like <HASH>.0, where the value of <HASH> is
2146              found  by  running  the  command  "openssl x509 -hash -noout -in
2147              file.crt". Evidently one uses <HASH>.1  if  there  is  a  colli‐
2148              sion...
2149
2150              The   the   key-management  utility  "-sslCertInfo  HASHON"  and
2151              "-sslCertInfo HASHOFF" will create/delete these hashes  for  you
2152              automatically  (via  symlink)  in  the  HASH subdirs it manages.
2153              Then you can point -sslverify to the HASH subdir.
2154
2155              Special tokens: in -ssl mode, if path is not a file or a  direc‐
2156              tory,  it  is taken as a comma separated list of tokens that are
2157              interpreted as follows:
2158
2159              If a token is "CA" that means load the CA/cacert.pem  file  from
2160              the  ssl  directory.  If a token is "clients" then all the files
2161              clients/*.crt in the ssl directory are  loaded.   Otherwise  the
2162              file  clients/token.crt is attempted to be loaded.  As a kludge,
2163              use a token like ../server-foo to load a server cert if you find
2164              that necessary.
2165
2166              Use  -ssldir  to use a directory different from the ~/.vnc/certs
2167              default.
2168
2169              Note that if the "CA" cert is loaded you do not need to load any
2170              of the certs that have been signed by it.  You will need to load
2171              any additional self-signed certs however.
2172
2173              Examples: x11vnc  -ssl  -sslverify  CA  x11vnc  -ssl  -sslverify
2174              self:fred,self:jim x11vnc -ssl -sslverify CA,clients
2175
2176              Usually   "-sslverify  CA"  is  the  most  effective.   See  the
2177              -sslGenCA and -sslGenCert options below for how to  set  up  and
2178              manage the CA framework.
2179
2180              Note  that  if  the  Client's  (vncviewer)  certificate has been
2181              signed by a well-known CA then the CA's certificate may  already
2182              be  installed on the system.  So, for example, on a debian based
2183              system one could use: -sslverify /etc/ssl/certs.
2184
2185              NOTE:   the   following   utilities,   -sslGenCA,   -sslGenCert,
2186              -sslEncKey, -sslCertInfo, and -sslCRL are provided for complete‐
2187              ness, but for casual usage they are overkill.
2188
2189              They provide VNC Certificate Authority  (CA)  key  creation  and
2190              server  /  client key generation and signing.  So they provide a
2191              basic Public Key management framework for VNC-ing  with  x11vnc.
2192              (note that they require openssl(1) be installed on the system)
2193
2194              However, the simplest usage mode, "-ssl TMP" (where x11vnc auto‐
2195              matically generates its own, self-signed, temporary key and  the
2196              VNC  viewers  always accept it, e.g. accepting via a dialog box)
2197              is probably safe enough for most scenarios.   CA  management  is
2198              not needed.
2199
2200              To  protect against Man-In-The-Middle attacks the "TMP" mode can
2201              be improved by using "-ssl  SAVE"  (same  as  "-ssl",  i.e.  the
2202              default)  to  have  x11vnc create a longer term self-signed cer‐
2203              tificate, and then (safely) copy the  corresponding  public  key
2204              cert to the desired client machines (care must be taken the pri‐
2205              vate key part  is  not  stolen;  you  will  be  prompted  for  a
2206              passphrase).
2207
2208              So  keep in mind no CA key creation or management (-sslGenCA and
2209              -sslGenCert) is needed for either of the above two common  usage
2210              modes.
2211
2212              One  might  want  to  use -sslGenCA and -sslGenCert if you had a
2213              large number of VNC client and server  workstations.   That  way
2214              the  administrator could generate a single CA key with -sslGenCA
2215              and distribute its certificate part to all of the workstations.
2216
2217              Next, he could create signed VNC server keys (-sslGenCert server
2218              ...)  for each workstation or user that then x11vnc would use to
2219              authenticate itself to any VNC client that has the CA cert.
2220
2221              Optionally, the admin could also make  it  so  the  VNC  clients
2222              themselves  are authenticated to x11vnc (-sslGenCert client ...)
2223              For this -sslverify would be pointed  to  the  CA  cert  (and/or
2224              self-signed certs).
2225
2226              x11vnc  will be able to use all of these cert and key files.  On
2227              the VNC client side, they will need to  be  "imported"  somehow.
2228              Web browsers have "Manage Certificates" actions as does the Java
2229              applet plugin Control Panel.  stunnel can also use  these  files
2230              (see the ss_vncviewer example script in the FAQ and SSVNC.)
2231
2232       -sslCRL path
2233
2234              Set  the  Certificate Revocation Lists (CRL) to path.  This set‐
2235              ting applies for both -ssl and -stunnel modes.
2236
2237              If path is a file, the file contains one or  more  CRLs  in  PEM
2238              format.  If path is a directory, it contains hash named files of
2239              CRLs in the usual OpenSSL manner.  See  the  OpenSSL  and  stun‐
2240              nel(8) documentation for more info.
2241
2242              This  option  only  applies  if -sslverify has been supplied: it
2243              checks for revocation along the certificate chain used to verify
2244              the  VNC  client.   The  -sslCRL  setting  will  be ignored when
2245              -sslverify is not specified.
2246
2247              Note that if a CRL's expiration date has passed, all SSL connec‐
2248              tions will fail regardless of if they are related to the subject
2249              of the CRL or not.
2250
2251              Only rarely will one's x11vnc -ssl infrastructure  be  so  large
2252              that this option would be useful (since normally maintaining the
2253              contents of the -sslverify file or directory should be  enough.)
2254              However,  when  using  x11vnc  with a Certificate Authority (see
2255              -sslGenCA) to authenticate  Clients  via  SSL/TLS,  the  -sslCRL
2256              option  can  be  useful to revoke users' certs whose private SSL
2257              keys were lost or stolen (e.g.  laptop.)   This  way  a  new  CA
2258              cert+key  does not need to be created and new signed client keys
2259              generated and distributed to all users.
2260
2261              To create a CRL file  with  revoked  certificates  the  commands
2262              'openssl  ca  -revoke ...' and 'openssl ca -gencrl ...' are use‐
2263              ful.  (Run them in ~/.vnc/certs)
2264
2265       -sslGenCA [dir]
2266
2267              Generate your own Certificate Authority  private  key,  certifi‐
2268              cate, and other files in directory [dir].  x11vnc then exits.
2269
2270              If  [dir]  is not supplied, a -ssldir setting is used, or other‐
2271              wise ~/.vnc/certs is used.
2272
2273              This command also creates directories where  server  and  client
2274              certs  and  keys will be stored.  The openssl(1) program must be
2275              installed on the system and available in PATH.
2276
2277              After the CA files and directories are created the  x11vnc  com‐
2278              mand exits; the VNC server is not run.
2279
2280              You will be prompted for information to put into the CA certifi‐
2281              cate.  The info does not have to be accurate  just  as  long  as
2282              clients accept the cert for VNC connections.  You will also need
2283              to supply a passphrase of at least 4 characters for the CA  pri‐
2284              vate key.
2285
2286              Once  you  have generated the CA you can distribute its certifi‐
2287              cate part, [dir]/CA/cacert.pem, to other workstations where  VNC
2288              viewers will be run.  One will need to "import" this certificate
2289              in the applications, e.g. Web browser, Java applet plugin, stun‐
2290              nel,  etc.  Next, you can create and sign keys using the CA with
2291              the -sslGenCert option below.
2292
2293              Examples: x11vnc -sslGenCA x11vnc  -sslGenCA   ~/myCAdir  x11vnc
2294              -ssldir ~/myCAdir -sslGenCA
2295
2296              (the last two lines are equivalent)
2297
2298       -sslGenCert type name
2299
2300              Generate a VNC server or client certificate and private key pair
2301              signed  by  the  CA  created  previously  with  -sslGenCA.   The
2302              openssl(1) program must be installed on the system and available
2303              in PATH.
2304
2305              After the Certificate is generated x11vnc exits; the VNC  server
2306              is not run.
2307
2308              The  type  of  key  to  be  generated is the string type.  It is
2309              either "server" (i.e. for use by x11vnc) or "client" (for a  VNC
2310              viewer).   Note  that  typically  only "server" is used: the VNC
2311              clients authenticate themselves by a non-public-key method (e.g.
2312              VNC or unix password).  type is required.
2313
2314              An  arbitrary default name you want to associate with the key is
2315              supplied by the name string.  You can change it at  the  various
2316              prompts when creating the key.  name is optional.
2317
2318              If  name  is  left blank for clients keys then "nobody" is used.
2319              If left blank for server keys,  then  the  primary  server  key:
2320              "server.pem"  is  created  (this  is the saved one referenced by
2321              "-ssl SAVE" when the server is started)
2322
2323              If name begins with the string "self:" then a  self-signed  cer‐
2324              tificate is created instead of one signed by your CA key.
2325
2326              If name begins with the string "req:" then only a key (.key) and
2327              a certificate signing *request* (.req) are generated.   You  can
2328              then  send  the .req file to an external CA (even a professional
2329              one, e.g. Thawte) and then combine the  .key  and  the  received
2330              cert into the .pem file with the same basename.
2331
2332              The  distinction  between  "server"  and  "client" is simply the
2333              choice of output filenames and sub-directory.  This makes it  so
2334              the -ssl SAVE-name option can easily pick up the x11vnc PEM file
2335              this option generates.  And similarly  makes  it  easy  for  the
2336              -sslverify option to pick up your client certs.
2337
2338              There  is  nothing special about the filename or directory loca‐
2339              tion of either the "server" and "client" certs.  You can  rename
2340              the files or move them to wherever you like.
2341
2342              Precede  this option with -ssldir [dir] to use a directory other
2343              than the default ~/.vnc/certs You will need to run -sslGenCA  on
2344              that directory first before doing any -sslGenCert key creation.
2345
2346              Note  you  cannot recreate a cert with exactly the same distigu‐
2347              ished name (DN) as an existing one.  To do so, you will need  to
2348              edit the [dir]/CA/index.txt file to delete the line.
2349
2350              Similar  to  -sslGenCA,  you  will  be  prompted to fill in some
2351              information that will be recorded in the certificate when it  is
2352              created.
2353
2354              Tip:  if you know the fully-qualified hostname other people will
2355              be connecting to, you can use that as  the  CommonName  "CN"  to
2356              avoid some applications (e.g. web browsers and java plugin) com‐
2357              plaining that it does not match the hostname.
2358
2359              You will also need to supply the CA private  key  passphrase  to
2360              unlock the private key created from -sslGenCA.  This private key
2361              is used to sign the server or client certificate.
2362
2363              The "server" certs can be used by x11vnc directly by pointing to
2364              them  via  the  -ssl  [pem]  option.   The  default file will be
2365              ~/.vnc/certs/server.pem.  This one would be used by simply  typ‐
2366              ing  -ssl  SAVE.  The pem file contains both the certificate and
2367              the private key.  server.crt file contains the cert only.
2368
2369              The "client" cert + private key file will need to be copied  and
2370              imported  into  the  VNC  viewer side applications (Web browser,
2371              Java plugin, stunnel, etc.)  Once that is done  you  can  delete
2372              the  "client"  private key file on this machine since it is only
2373              needed    on    the    VNC    viewer    side.      The,     e.g.
2374              ~/.vnc/certs/clients/<name>.pem  contains both the cert and pri‐
2375              vate key.  The <name>.crt contains the certificate only.
2376
2377              NOTE: It is very important to know one should generate new  keys
2378              with  a  passphrase.   Otherwise if an untrusted user steals the
2379              key file he could use it to masquerade as the x11vnc server  (or
2380              VNC viewer client).  You will be prompted whether to encrypt the
2381              key with a passphrase or not.  It is recommended  that  you  do.
2382              One  inconvenience  to  a passphrase is that it must be typed in
2383              EVERY time x11vnc or the client app is started up.
2384
2385              Examples:
2386
2387              x11vnc -sslGenCert server x11vnc -ssl SAVE -display :0 ...
2388
2389              and then on viewer using ss_vncviewer stunnel wrapper  (see  the
2390              FAQ): ss_vncviewer -verify ./cacert.crt hostname:0
2391
2392              (this  assumes  the  cacert.crt  cert  from -sslGenCA was safely
2393              copied to the VNC viewer machine where ss_vncviewer is run)
2394
2395              Example using a name:
2396
2397              x11vnc -sslGenCert server charlie x11vnc -ssl SAVE-charlie -dis‐
2398              play :0 ...
2399
2400              Example for a client certificate (rarely used):
2401
2402              x11vnc         -sslGenCert        client        roger        scp
2403              ~/.vnc/certs/clients/roger.pem          somehost:.            rm
2404              ~/.vnc/certs/clients/roger.pem
2405
2406              x11vnc    is   then   started   with   the   option   -sslverify
2407              ~/.vnc/certs/clients/roger.crt (or simply -sslverify roger), and
2408              on the viewer user on somehost could do for example:
2409
2410              ss_vncviewer -mycert ./roger.pem hostname:0
2411
2412              If  you  set  the  env.  var REQ_ARGS='...' it will be passed to
2413              openssl req(1).  A common use would be REQ_ARGS='-days 1095'  to
2414              bump up the expiration date (3 years in this case).
2415
2416       -sslEncKey pem
2417
2418              Utility  to  encrypt  an existing PEM file with a passphrase you
2419              supply when prompted.  For that key to be used (e.g. by  x11vnc)
2420              the passphrase must be supplied each time.
2421
2422              The  "SAVE" notation described under -ssl applies as well. (pre‐
2423              cede this option with -ssldir [dir] to refer a directory besides
2424              the default ~/.vnc/certs)
2425
2426              The  openssl(1)  program  must  be  installed  on the system and
2427              available in PATH.  After the Key file is encrypted  the  x11vnc
2428              command exits; the VNC server is not run.
2429
2430              Examples:  x11vnc  -sslEncKey /path/to/foo.pem x11vnc -sslEncKey
2431              SAVE x11vnc -sslEncKey SAVE-charlie
2432
2433       -sslCertInfo pem
2434
2435              Prints out information about an existing PEM file.  In  addition
2436              the  public certificate is also printed.  The openssl(1) program
2437              must be in PATH. Basically the command "openssl x509  -text"  is
2438              run on the pem.
2439
2440              After  the  info  is  printed  the x11vnc command exits; the VNC
2441              server is not run.
2442
2443              The "SAVE" notation described under -ssl applies as well.
2444
2445              Using  "LIST" will give a list of all certs  being  managed  (in
2446              the  ~/.vnc/certs  dir,  use  -ssldir  to refer to another dir).
2447              "ALL" will print out the info for every managed key (this can be
2448              very  long).  Giving a client or server cert shortname will also
2449              try a lookup (e.g. -sslCertInfo charlie).  Use "LISTL"  or  "LL"
2450              for a long (ls -l style) listing.
2451
2452              Using  "HASHON"  will  create  subdirs [dir]/HASH and [dir]/HASH
2453              with OpenSSL hash filenames (e.g. 0d5fbbf1.0) symlinks  pointing
2454              up  to  the corresponding *.crt file.  ([dir] is ~/.vnc/certs or
2455              one given by -ssldir.)  This is a useful way for  other  OpenSSL
2456              applications  (e.g.  stunnel) to access all of the certs without
2457              having to concatenate them.  x11vnc will not use them unless you
2458              specifically  reference them.  "HASHOFF" removes these HASH sub‐
2459              dirs.
2460
2461              The LIST, LISTL, LL, ALL, HASHON, HASHOFF words can also be low‐
2462              ercase, e.g. "list".
2463
2464       -sslDelCert pem
2465
2466              Prompts  you  to delete all .crt .pem .key .req files associated
2467              with [pem].   x11vnc  then  exits.  "SAVE"  and  lookups  as  in
2468              -sslCertInfo apply as well.
2469
2470       -sslScripts
2471
2472              Prints out both the 'genCA' and 'genCert' x11vnc openssl wrapper
2473              scripts for you  to  examine,  modify,  etc.   The  scripts  are
2474              printed to stdout and then the x11vnc program exits.
2475
2476       -stunnel [pem]
2477
2478              Use  the  stunnel(8)  (stunnel.mirt.net) to provide an encrypted
2479              SSL tunnel between viewers and x11vnc.
2480
2481              This external tunnel method was implemented prior to  the  inte‐
2482              grated -ssl encryption described above.  It still works well and
2483              avoids the requirement of linking with  the  OpenSSL  libraries.
2484              This  mode  requires  stunnel  to be installed on the system and
2485              available via PATH (n.b. stunnel  is  often  installed  in  sbin
2486              directories).  Version 4.x of stunnel is assumed (but see -stun‐
2487              nel3 below.)
2488
2489              [pem] is optional, use "-stunnel /path/to/stunnel.pem" to  spec‐
2490              ify  a  PEM  certificate  file to pass to stunnel.  See the -ssl
2491              option for more info on certificate files.
2492
2493              Whether or not your stunnel has its own certificate  depends  on
2494              your  stunnel  configuration;  stunnel  often  generates  one at
2495              install time.  See your stunnel documentation for  details.   In
2496              any  event,  if you want to use this certificate you must supply
2497              the full path to it as [pem].  Note: the file may only be  read‐
2498              able by root.
2499
2500              [pem]  may  also  be  the  special  strings  "TMP",  "SAVE", and
2501              "SAVE..." as described in the -ssl option.  If [pem] is not sup‐
2502              plied, "SAVE" is assumed.
2503
2504              Note  that  the VeNCrypt, ANONTLS, and "ANON" modes are not sup‐
2505              ported in -stunnel mode.
2506
2507              stunnel is started up as a child process of x11vnc and  any  SSL
2508              connections  stunnel  receives  are decrypted and sent to x11vnc
2509              over a local socket.  The strings "The SSL VNC desktop  is  ..."
2510              and "SSLPORT=..."  are printed out at startup to indicate this.
2511
2512              The  -localhost  option  is  enforced by default to avoid people
2513              routing around the SSL channel.  Use -env STUNNEL_DISABLE_LOCAL‐
2514              HOST=1 to disable this security requirement.
2515
2516              Set -env STUNNEL_DEBUG=1 for more debugging printout.
2517
2518              Set  -env  STUNNEL_PROG=xxx  to the full path of stunnel program
2519              you want to be used (e.g. /usr/bin/stunnel4).
2520
2521              Set -env STUNNEL_LISTEN=xxx to the address of the network inter‐
2522              face  to listen on (the default is to listen on all interfaces),
2523              e.g. STUNNEL_LISTEN=192.168.1.100.
2524
2525              A simple way to add IPv6 support is STUNNEL_LISTEN=::
2526
2527              Your VNC viewer will also need to be able to  connect  via  SSL.
2528              Unfortunately  not  too many do this.  See the information about
2529              SSL viewers under the -ssl option.  The x11vnc  project's  SSVNC
2530              is an option.
2531
2532              Also,  in the x11vnc distribution, patched TightVNC and UltraVNC
2533              Java applet jar files are provided in the classes/ssl  directory
2534              that  do  SSL  connections.  Enable serving them with the -http,
2535              -http_ssl, or -httpdir (see the  option  descriptions  for  more
2536              info.)
2537
2538              Note  that  for the Java viewer applet usage the "?PORT=xxxx" in
2539              the various URLs printed at startup will need to be supplied  to
2540              the web browser to connect properly.
2541
2542              Currently  the automatic "single port" HTTPS mode of -ssl is not
2543              fully supported in -stunnel mode.  However, it can  be  emulated
2544              via:
2545
2546              % x11vnc -stunnel -http_ssl -http_oneport ...
2547
2548              In general, it is also not too difficult to set up an stunnel or
2549              other SSL tunnel on the viewer side.  A simple example  on  Unix
2550              using stunnel 3.x is:
2551
2552              %  stunnel  -c  -d localhost:5901 -r remotehost:5900 % vncviewer
2553              localhost:1
2554
2555              For Windows, stunnel has been ported to it and there are  proba‐
2556              bly  other such tools available.  See the FAQ and SSVNC for more
2557              examples.
2558
2559       -stunnel3 [pem]
2560
2561              Use version 3.x stunnel command line syntax instead  of  version
2562              4.x.   The  -http/-httpdir  Java applet serving is currently not
2563              available in this mode.
2564
2565       -enc cipher:keyfile
2566
2567              Use symmetric encryption with cipher  "cipher"  and  secret  key
2568              data  in  "keyfile".  If keyfile is pw=<string> then "string" is
2569              used as the key data.
2570
2571              NOTE: It is recommended that you use SSL  via  the  -ssl  option
2572              instead  of this option because SSL is well understood and takes
2573              great care to establish unique session keys and is more compati‐
2574              ble  with other software.  Use this option if you do not want to
2575              deal with SSL certificates for authentication and do not want to
2576              use  SSH  but  want some encryption for your VNC session.  Or if
2577              you must interface with a symmetric key tunnel that you  do  not
2578              have control over.
2579
2580              Note  that this mode will NOT work with the UltraVNC DSM plugins
2581              because they alter the RFB protocol in  addition  to  tunnelling
2582              with  the symmetric cipher (an unfortunate choice of implementa‐
2583              tion...)
2584
2585              cipher can be one of:  arc4, aesv2, aes-cfb,  blowfish,  aes256,
2586              or 3des.  See the OpenSSL documentation for more info.  The key‐
2587              size is 128 bits (except for aes256).  Here is one way to make a
2588              keyfile with that many bits:
2589
2590              dd if=/dev/random of=./my.key bs=16 count=1
2591
2592              you  will need to securely share this key with the other side of
2593              the VNC connection (See SSVNC for examples).
2594
2595              Example:    -enc   blowfish:./my.key   Example:    -enc    blow‐
2596              fish:pw=swordfish
2597
2598              By  default 16 bytes of random salt followed by 16 bytes of ran‐
2599              dom initialization vector are sent at the very beginning of  the
2600              stream.   The  other  side  must read these and initialize their
2601              cipher with them.  These values  make  the  session  key  unique
2602              (without  them  the  security is minimal).  Similarly, the other
2603              side must send us  its  random  salt  and  IV  with  those  same
2604              lengths.
2605
2606              The salt and key data are combined to create a session key using
2607              an md5 hash as described in EVP_BytesToKey(3).
2608
2609              The exact call is: EVP_BytesToKey(Cipher, EVP_md5(), salt,  key‐
2610              data,  len,  1, keystr, NULL);  where salt is the random data as
2611              described above, and keydata is  the  shared  secret  key  data.
2612              keystr  is the resulting session key.  The cipher is then seeded
2613              with keystr and uses the random  initialization  vector  as  its
2614              first block.
2615
2616              To  modify  the  amount of random salt and initialization vector
2617              use cipher@n,m where n is the salt length and m the  initializa‐
2618              tion vector length.  E.g.
2619
2620              -enc aes-cfb@8,16:./my.key
2621
2622              It  is  not  a good idea to set either one to zero, although you
2623              may be forced to if the other side of the tunnel  is  not  under
2624              your control.
2625
2626              To  skip the salt and EVP_BytesToKey MD5 entirely (no hashing is
2627              done: the keydata is directly inserted into the cipher)  specify
2628              "-1" for the salt, e.g.
2629
2630              -enc blowfish@-1,16:./my.key
2631
2632              The  message digest can also be changed to something besides the
2633              default MD5.  Use cipher@md+n,m where "md" can be  one  of  sha,
2634              sha1, md5, or ripe.  For example:
2635
2636              -enc arc4@sha+8,16:./my.key
2637
2638              The  SSVNC  vnc  viewer  project supplies a symmetric encryption
2639              tool named "ultravnc_dsm_helper" that can be used on the  viewer
2640              side.  For example:
2641
2642              ssvncviewer exec='ultravnc_dsm_helper arc4 my.key 0 h:p'
2643
2644              (or replace 'ssvncviewer' with 'ssvnc -viewer') where h:p is the
2645              hostname and port of the x11vnc server.  ultravnc_dsm_helper may
2646              also be used standalone to provide a symmetric encryption tunnel
2647              for any viewer or server (VNC or  otherwise.)  The  cipher  (1st
2648              arg) is basically the same syntax as we use above.
2649
2650              Also  see the 'Non-Ultra DSM' SSVNC option for the ´UltraVNC DSM
2651              Encryption Plugin' advanced option.
2652
2653              For both ways of using the viewer, you can specify the salt,ivec
2654              sizes (in GUI or, e.g. arc4@8,16).
2655
2656       -https [port]
2657
2658              Use  a  special,  separate  HTTPS  port (-ssl and -stunnel modes
2659              only) for HTTPS Java viewer applet downloading.  I.e.  not  5900
2660              and not 5800 (the defaults.)
2661
2662              BACKGROUND:  In  -ssl  mode, it turns out you can use the single
2663              VNC port (e.g. 5900) for both VNC and HTTPS connections.  (HTTPS
2664              is  used  to  retrieve  a SSL-aware VncViewer.jar applet that is
2665              provided with x11vnc).  Since both use  SSL  the  implementation
2666              was  extended  to  detect  if  HTTP traffic (i.e. GET) is taking
2667              place and handle it accordingly.  The URL would be, e.g.:
2668
2669              https://mymachine.org:5900/
2670
2671              This is convenient for firewalls, etc,  because  only  one  port
2672              needs to be allowed in.  However, this heuristic adds a few sec‐
2673              onds delay to each connection and can be unreliable  (especially
2674              if the user takes much time to ponder the Certificate dialogs in
2675              his browser, Java VM, or VNC Viewer applet.  That's right 3 sep‐
2676              arate "Are you sure you want to connect?" dialogs!)
2677
2678              END OF BACKGROUND.
2679
2680              USAGE:  So  use  the  -https  option to provide a separate, more
2681              reliable HTTPS port that x11vnc will listen on.   If  [port]  is
2682              not  provided (or is 0), one is autoselected.  The URL to use is
2683              printed out at startup.
2684
2685              The SSL Java applet directory  is  specified  via  the  -httpdir
2686              option.  If not supplied, -https will try to guess the directory
2687              as though the -http option was supplied.
2688
2689       -httpsredir [port]
2690
2691              In -ssl mode with the Java applet retrieved via HTTPS, when  the
2692              HTML   file   containing   applet   parameters  ('index.vnc'  or
2693              'proxy.vnc') is sent do NOT set the applet PORT parameter to the
2694              actual  VNC port but set it to "port" instead.  If "port" is not
2695              supplied, then the port number is guessed from  the  Host:  HTTP
2696              header.
2697
2698              This  is  useful  when an incoming TCP connection redirection is
2699              performed by a  router/gateway/firewall  from  one  port  to  an
2700              internal  machine where x11vnc is listening on a different port.
2701              The Java applet needs to connect to  the  firewall/router  port,
2702              not  the  VNC port on the internal workstation. For example, one
2703              could redir from mygateway.com:443 to workstation:5900.
2704
2705              This spares the user from  having  to  type  in  https://mygate
2706              way.com/?PORT=443  into their web browser. Note that port 443 is
2707              the default https port; other ports  must  be  explicitly  indi‐
2708              cated,  for  example: https://mygateway.com:8000/?PORT=8000.  To
2709              avoid having to include the PORT= in  the  browser  URL,  simply
2710              supply "-httpsredir" to x11vnc.
2711
2712              This option does not work in -stunnel mode.
2713
2714              More  tricks:  set  the  env var X11VNC_EXTRA_HTTPS_PARAMS to be
2715              extra URL parameters to use.  This way you do not need to  spec‐
2716              ify  extra  PARAMS  in  the  index.vnc  file.   E.g. x11vnc -env
2717              X11VNC_EXTRA_HTTPS_PARAMS='?GET=1' ...
2718
2719              If you do not want to expose the non-SSL HTTP port to  the  net‐
2720              work  (i.e.  you just want the single VNC/HTTPS port, e.g. 5900,
2721              open   for   connections)   then   specify   the   option   -env
2722              X11VNC_HTTP_LISTEN_LOCALHOST=1   This  way the connection to the
2723              LibVNCServer httpd server will only be  available  on  localhost
2724              (note  that in -ssl mode, HTTPS requests are redirected from SSL
2725              to the non-SSL LibVNCServer HTTP server.)
2726
2727       -http_oneport
2728
2729              For UN-encrypted connections mode (i.e. no  -ssl,  -stunnel,  or
2730              -enc options), allow the Java VNC Viewer applet to be downloaded
2731              thru the VNC port via HTTP.
2732
2733              That is to say, you can use a single port for Java applet viewer
2734              connections  by  using  a URL in your web browser like this, for
2735              example:
2736
2737              http://hostname:5900
2738
2739              The regular, two-port mode, URL http://hostname:5800  will  con‐
2740              tinue to work as well.
2741
2742              As  mentioned  above,  this  mode  will  NOT work with the -ssl,
2743              -stunnel, or -enc encryption options.  Note that is  it  equiva‐
2744              lent  to  '-enc none' (i.e. it uses the same detection mechanism
2745              as for HTTPS, but with no encryption.)
2746
2747              HTTPS single-port is on by default in -ssl encrypted  mode  (and
2748              -enc  too),  so  you  only need -http_oneport when doing non-SSL
2749              encrypted connections.
2750
2751              This mode could also be useful for SSH tunnels  since  it  means
2752              only one port needs to be redirected.
2753
2754              The  -httpsredir  option  may  also be useful for this mode when
2755              using an SSH tunnel as well as for router port redirections.
2756
2757              Note  that  the   -env   X11VNC_HTTP_LISTEN_LOCALHOST=1   option
2758              described  above  under -httpsredir applies for the LibVNCServer
2759              httpd server in all cases (ssl or not.)
2760
2761       -ssh user@host:disp
2762
2763              Create a remote listening port on machine "host" via a SSH  tun‐
2764              nel using the -R rport:localhost:lport method. lport will be the
2765              local  x11vnc  listening  port,  so  a   connection   to   rport
2766              (5900+disp) on "host" will reach x11vnc.  E.g. fred@snoopy.com:0
2767
2768              This could be useful if a firewall/router prevents incoming con‐
2769              nections to the x11vnc machine, but the ssh machine  "host"  can
2770              be  reached  by the VNC viewer. "user@" is not needed unless the
2771              remote unix username differs from the current one.
2772
2773              By default the remote sshd is usually configured to listen  only
2774              on  localhost  for rport, so the viewer may need to ssh -L redir
2775              to "host" as well (See SSVNC to automate this).  The  sshd  set‐
2776              ting GatewayPorts enables listening on all interfaces for rport;
2777              viewers can reach it more easily.
2778
2779              "disp" is the VNC display for the remote SSH side, e.g. 0 corre‐
2780              sponds to port 5900, etc.  If disp is greater than 200 the value
2781              is used as the port.  Use a negative value to force a low  port,
2782              e.g. host:-80 will use port 80.
2783
2784              If  ssh-agent  is  not active, then the ssh password needs to be
2785              entered in the terminal where x11vnc is running.
2786
2787              By default the remote ssh will issue a 'sleep 300' to  wait  for
2788              the  incoming  connection  for  5  mins.   To  modify  this  use
2789              user@host:disp+secs.
2790
2791              If the remote SSH server is on a non-standard port (i.e. not 22)
2792              use user@host:port:disp+secs.
2793
2794              Note  that  the ssh process MAY NOT be killed when x11vnc exits.
2795              It tries by looking at ps(1) output.
2796
2797       -users list
2798
2799              If x11vnc is started as root (say from inetd(8) or from  display
2800              managers  xdm(1) , gdm(1) , etc), then as soon as possible after
2801              connections to the X display are established try  to  switch  to
2802              one  of the users in the comma separated list.  If x11vnc is not
2803              running as root this option is ignored.
2804
2805              Why use this option?  In general it is not needed  since  x11vnc
2806              is  already  connected to the X display and can perform its pri‐
2807              mary functions.  The option  was  added  to  make  some  of  the
2808              *external*  utility commands x11vnc occasionally runs work prop‐
2809              erly.  In particular  under  GNOME  and  KDE  to  implement  the
2810              "-solid  color" feature external commands (gconftool-2 and dcop)
2811              unfortunately must be run as the user owning  the  desktop  ses‐
2812              sion.   Since  this  option  switches userid it also affects the
2813              userid used to run the  processes  for  the  -accept  and  -gone
2814              options.   It also affects the ability to read files for options
2815              such as -connect, -allow, and -remap  and  also  the  ultra  and
2816              tight  filetransfer  feature if enabled.  Note that the -connect
2817              file is also sometimes written to.
2818
2819              So be careful with this option since in some situations its  use
2820              can decrease security.
2821
2822              In general the switch to a user will only take place if the dis‐
2823              play can still be successfully opened as that user (this is pri‐
2824              marily  to  try to guess the actual owner of the session). Exam‐
2825              ple: "-users fred,wilma,betty".  Note  that  a  malicious  local
2826              user  "barney"  by  quickly  using "xhost +" when logging in may
2827              possibly get the x11vnc process to switch to user "fred".   What
2828              happens next?
2829
2830              Under  display  managers it may be a long time before the switch
2831              succeeds (i.e. a user logs in).  To instead make it switch imme‐
2832              diately  regardless  if  the  display can be reopened prefix the
2833              username with the "+" character. E.g. "-users +bob"  or  "-users
2834              +nobody".
2835
2836              The  latter (i.e. switching immediately to user "nobody") is the
2837              only obvious use of the -users option that increases security.
2838
2839              Use the following notation to associate a  group  with  a  user:
2840              user1.group1,user2.group2,...    Note  that  initgroups(2)  will
2841              still be called first to try to switch to ALL of a user's groups
2842              (primary  and  additional  groups).  Only if that fails or it is
2843              not available then the single group specified as above  (or  the
2844              user's  primary group if not specified) is switched to with set‐
2845              gid(2).  Use -env X11VNC_SINGLE_GROUP=1 to prevent trying  init‐
2846              groups(2)  and  only  switch  to the single group.  This sort of
2847              setting is only really needed to make the ultra or  tight  file‐
2848              transfer  permissions  work properly. This format applies to any
2849              comma separated list  of  users,  even  the  special  "="  modes
2850              described below.
2851
2852              In  -unixpw  mode,  if "-users unixpw=" is supplied then after a
2853              user authenticates himself via  the  -unixpw  mechanism,  x11vnc
2854              will try to switch to that user as though "-users +username" had
2855              been supplied.  If you want to limit which users  this  will  be
2856              done for, provide them as a comma separated list after "unixpw="
2857              Groups can also be specified as described above.
2858
2859              Similarly, in -ssl mode, if "-users sslpeer=" is  supplied  then
2860              after  an SSL client authenticates with his cert (the -sslverify
2861              option is required for this) x11vnc will extract a UNIX username
2862              from  the  "emailAddress"  field  (username@hostname.com) of the
2863              "Subject" of the x509 SSL cert and then try to  switch  to  that
2864              user  as  though  "-users  +username" had been supplied.  If you
2865              want to limit which users this will be done for, provide them as
2866              a  comma  separated  list  after  "sslpeer=".   Set the env. var
2867              X11VNC_SSLPEER_CN to use the Common Name (normally  a  hostname)
2868              instead of the Email field.
2869
2870              NOTE:  for sslpeer= mode the x11vnc administrator must take care
2871              that any client certs he adds to -sslverify  have  the  intended
2872              UNIX  username  in the "emailAddress" field of the cert.  Other‐
2873              wise a user may be able to log in as another.  This command  can
2874              be  of  use  in checking: "openssl x509 -text -in file.crt", see
2875              the "Subject:" line.  Also, along with  the  normal  RFB_*  env.
2876              vars.   (see   -accept)   passed   to  external  cmd=  commands,
2877              RFB_SSL_CLIENT_CERT will be set to the client's x509 certificate
2878              string.
2879
2880              The sslpeer= mode can aid finding X sessions via the FINDDISPLAY
2881              and FINDCREATEDISPLAY mechanisms.
2882
2883              To immediately switch to a user *before* connections  to  the  X
2884              display  are  made  or  any  files opened use the "=" character:
2885              "-users =bob".  That user needs to be able to open the X display
2886              and any files of course.
2887
2888              The  special  user  "guess=" means to examine the utmpx database
2889              (see who(1) ) looking for a user attached to the display  number
2890              (from DISPLAY or -display option) and try him/her.  To limit the
2891              list of guesses, use: "-users guess=bob,betty".
2892
2893              Even more sinister is the special user "lurk=" that means to try
2894              to  guess the DISPLAY from the utmpx login database as well.  So
2895              it "lurks" waiting for anyone to log into an X session and  then
2896              connects  to  it.   Specify a list of users after the = to limit
2897              which users will be tried.   To  enable  a  different  searching
2898              mode,  if  the  first user in the list is something like ":0" or
2899              ":0-2" that indicates a range of DISPLAY numbers  that  will  be
2900              tried (regardless of whether they are in the utmpx database) for
2901              all users that are logged in.  Also see the "-display  WAIT:..."
2902              functionality.    Examples:  "-users  lurk="  and  also  "-users
2903              lurk=:0-1,bob,mary"
2904
2905              Be especially careful using  the  "guess="  and  "lurk="  modes.
2906              They  are not recommended for use on machines with untrustworthy
2907              local users.
2908
2909       -noshm
2910
2911              Do not use the MIT-SHM extension for the polling.   Remote  dis‐
2912              plays  can  be  polled  this  way: be careful this can use large
2913              amounts of network bandwidth.  This is also of use if the  local
2914              machine has a limited number of shm segments and -onetile is not
2915              sufficient.
2916
2917       -flipbyteorder
2918
2919              Sometimes needed if remotely polled host has  different  endian‐
2920              ness.  Ignored unless -noshm is set.
2921
2922       -onetile
2923
2924              Do  not use the new copy_tiles() framebuffer mechanism, just use
2925              1 shm tile for polling.  Limits shm segments used to 3.
2926
2927              To disable  any  automatic  shm  reduction  set  the  env.  var.
2928              X11VNC_NO_LIMIT_SHM.
2929
2930       -solid [color]
2931
2932              To  improve  performance,  when VNC clients are connected try to
2933              change the desktop background to a solid color.  The [color]  is
2934              optional:  the  default  color  is "cyan4".  For a different one
2935              specify the X color (rgb.txt name, e.g. "darkblue" or  numerical
2936              "#RRGGBB").
2937
2938              Currently  this  option only works on GNOME, KDE, CDE, XFCE, and
2939              classic X (i.e. with the background image on the  root  window).
2940              The  "gconftool-2",  "dcop" and "xfconf-query" external commands
2941              are run for GNOME, KDE, and XFCE respectively.  This also  works
2942              on  native  MacOSX.   (There is no color selection for MacOSX or
2943              XFCE.)  Other desktops won't work, (send  us  the  corresponding
2944              commands  if  you  find  them).   If x11vnc is running as root (
2945              inetd(8) or gdm(1) ), the -users option may be needed for GNOME,
2946              KDE,  XFCE.  If x11vnc guesses your desktop incorrectly, you can
2947              force it by  prefixing  color  with  "gnome:",  "kde:",  "cde:",
2948              "xfce:", or "root:".
2949
2950              Update: -solid no longer works on KDE4.
2951
2952              This  mode  works  in a limited way on the Mac OS X Console with
2953              one color ('kelp') using the screensaver writing  to  the  back‐
2954              ground.  Look in "~/Library/Screen Savers" for VncSolidColor.png
2955              to change the color.
2956
2957       -blackout string
2958
2959              Black out rectangles on the screen. string is a comma  separated
2960              list  of  WxH+X+Y type geometries for each rectangle.  If one of
2961              the items on the list is the string "noptr"  the  mouse  pointer
2962              will not be allowed to go into a blacked out region.
2963
2964       -xinerama, -noxinerama
2965
2966              If  your  screen is composed of multiple monitors glued together
2967              via XINERAMA, and that screen is not  a  rectangle  this  option
2968              will  try  to  guess  the areas to black out (if your system has
2969              libXinerama).  default: -xinerama
2970
2971              In general, we have noticed on XINERAMA displays you may need to
2972              use  the  "-xwarppointer" option if the mouse pointer misbehaves
2973              and it is enabled by default. Use "-noxwarppointer"  if  you  do
2974              not want this.
2975
2976       -xtrap
2977
2978              Use the DEC-XTRAP extension for keystroke and mouse input inser‐
2979              tion.  For use on legacy systems, e.g. X11R5, running an  incom‐
2980              plete  or missing XTEST extension.  By default DEC-XTRAP will be
2981              used if XTEST server grab control is missing, use -xtrap  to  do
2982              the keystroke and mouse insertion via DEC-XTRAP as well.
2983
2984       -xrandr [mode]
2985
2986              If the display supports the XRANDR (X Resize, Rotate and Reflec‐
2987              tion) extension, and you expect XRANDR events to  occur  to  the
2988              display  while  x11vnc is running, this options indicates x11vnc
2989              should try to respond to them (as opposed to simply crashing  by
2990              assuming  the  old  screen size).  See the xrandr(1) manpage and
2991              run ´xrandr -q' for more info.  [mode] is optional and described
2992              below.
2993
2994              Since  watching  for XRANDR events and trapping errors increases
2995              polling overhead, only use this option  if  XRANDR  changes  are
2996              expected.   For  example on a rotatable screen PDA or laptop, or
2997              using a XRANDR-aware Desktop where you resize often.  It is best
2998              to  be  viewing  with  a  vncviewer  that supports the NewFBSize
2999              encoding, since it knows how to react to  screen  size  changes.
3000              Otherwise,  LibVNCServer tries to do so something reasonable for
3001              viewers that cannot do this  (portions  of  the  screen  may  be
3002              clipped, unused, etc).
3003
3004              Note:  the default now is to check for XRANDR events, but do not
3005              trap every X call that may fail due  to  resize.   If  a  resize
3006              event is received, the full -xrandr mode is enabled.  To disable
3007              even checking for events supply: -noxrandr.
3008
3009              "mode" defaults to "resize", which means create a new,  resized,
3010              framebuffer  and  hope  all  viewers  can  cope with the change.
3011              "newfbsize" means first disconnect all viewers that do not  sup‐
3012              port  the  NewFBSize  VNC  encoding,  and then resize the frame‐
3013              buffer.  "exit" means disconnect all viewer  clients,  and  then
3014              terminate x11vnc.
3015
3016       -rotate string
3017
3018              Rotate  and/or  flip the framebuffer view exported by VNC.  This
3019              transformation is independent of XRANDR and is done in  software
3020              in  main memory and so may be slower.  This mode could be useful
3021              on a handheld with portrait or landscape modes that do not  cor‐
3022              respond to the scanline order of the actual framebuffer.  string
3023              can be:
3024
3025              x     flip along x-axis y      flip  along  y-axis  xy      flip
3026              along  x-  and  y-axes  +90      rotate 90 degrees clockwise -90
3027              rotate 90 degrees counter-clockwise +90x     rotate  90  degrees
3028              CW,  then  flip along x +90y     rotate 90 degrees CW, then flip
3029              along y
3030
3031              these give all possible rotations and reflections.
3032
3033              Aliases: same as xy:  yx, +180, -180, 180 same as -90: +270, 270
3034              same as +90: 90, (ditto for 90x, 90y)
3035
3036              Like  -scale,  this transformation is applied at the very end of
3037              any chain of framebuffer transformations and so any options with
3038              geometries,  e.g.  -blackout,  -clip,  etc.  are relative to the
3039              original X (or -rawfb) framebuffer, not the final  one  sent  to
3040              VNC viewers.
3041
3042              If  you do not want the cursor shape to be rotated prefix string
3043              with "nc:", e.g. "nc:+90", "nc:xy", etc.
3044
3045       -padgeom WxH
3046
3047              Whenever a new vncviewer connects, the framebuffer  is  replaced
3048              with  a  fake,  solid black one of geometry WxH.  Shortly after‐
3049              wards the framebuffer is replaced with the real  one.   This  is
3050              intended  for  use with vncviewers that do not support NewFBSize
3051              and one wants to make sure the initial viewer geometry  will  be
3052              big enough to handle all subsequent resizes (e.g. under -xrandr,
3053              -remote id:windowid, rescaling, etc.)
3054
3055              In -unixpw mode this sets the size of  the  login  screen.   Use
3056              "once:WxH" it ignore padgeom after the login screen is set up.
3057
3058       -o logfile
3059
3060              Write  stderr  messages to file logfile instead of to the termi‐
3061              nal.  Same as "-logfile file".  To append to the file  use  "-oa
3062              file"  or  "-logappend  file".   If  logfile contains the string
3063              "%VNCDISPLAY" it is expanded to the vnc display  (the  name  may
3064              need to be guessed at.)  "%HOME" works too.
3065
3066       -flag file
3067
3068              Write  the  "PORT=NNNN" (e.g. PORT=5900) string to file in addi‐
3069              tion to stdout.  This option could be useful by  wrapper  script
3070              to detect when x11vnc is ready.
3071
3072       -rmflag file
3073
3074              Remove  file at exit to signal when x11vnc is done.  The file is
3075              created at startup if it does not already exist or  if  file  is
3076              prefixed with "create:".  If the file is created, the x11vnc PID
3077              is placed in the file.  Otherwise  the  files  contents  is  not
3078              changed.  Use prefix "nocreate:" to prevent creation.
3079
3080       -rc filename
3081
3082              Use filename instead of $HOME/.x11vncrc for rc file.
3083
3084       -norc
3085
3086              Do not process any .x11vncrc file for options.
3087
3088       -env VAR=VALUE
3089
3090              Set  the  environment  variable 'VAR' to value 'VALUE' at x11vnc
3091              startup.  This is a convenience utility to  avoid  shell  script
3092              wrappers,  etc. to set the env. var.  You may specify as many of
3093              these as needed on the command line.
3094
3095       -prog /path/to/x11vnc
3096
3097              Set the full path to the x11vnc program for cases when it cannot
3098              be determined from argv[0] (e.g. tcpd/inetd)
3099
3100       -h, -help
3101
3102              Print  this  help  text.   -?,  -opts              Only list the
3103              x11vnc options.
3104
3105       -V, -version
3106
3107              Print program version and last modification date.
3108
3109       -license
3110
3111              Print out license information.  Same as -copying and -warranty.
3112
3113       -dbg
3114
3115              Instead of exiting after cleaning up, run a simple "debug  crash
3116              shell" when fatal errors are trapped.
3117
3118       -q, -quiet
3119
3120              Be  quiet  by printing less informational output to stderr. (use
3121              -noquiet to undo an earlier -quiet.)
3122
3123              The -quiet option does not eliminate all  informational  output,
3124              it  only  reduces  it.   It  is  ignored in most auxiliary usage
3125              modes,  e.g.  -storepasswd.   To  eliminate  all   output   use:
3126              2>/dev/null 1>&2, etc.
3127
3128       -v, -verbose
3129
3130              Print out more information to stderr.
3131
3132       -bg
3133
3134              Go  into  the background after screen setup.  Messages to stderr
3135              are lost unless -o logfile is used.  Something like  this  could
3136              be useful in a script:
3137
3138              port=`ssh -t $host "x11vnc -display :0 -bg" | grep PORT`
3139
3140              port=`echo "$port" | sed -e 's/PORT=//'`
3141
3142              port=`expr $port - 5900`
3143
3144              vncviewer $host:$port
3145
3146       -modtweak, -nomodtweak
3147
3148              Option  -modtweak  automatically  tries  to adjust the AltGr and
3149              Shift modifiers for differing language keyboards between  client
3150              and  host.  Otherwise, only a single key press/release of a Key‐
3151              code is simulated (i.e. ignoring the  state  of  the  modifiers:
3152              this  usually  works  for  identical keyboards).  Also useful in
3153              resolving cases where a Keysym is bound to multiple  keys  (e.g.
3154              "<" + ">" and "," + "<" keys).  Default: -modtweak
3155
3156              If you are having trouble with with keys and -xkb or -noxkb, and
3157              similar things don't help, try -nomodtweak.
3158
3159              On some HP-UX systems it is been noted that  they  have  an  odd
3160              keymapping  where a single keycode will have a keysym, e.g. "#",
3161              up to three times.  You can check via "xmodmap -pk" or  the  -dk
3162              option.   The failure is when you try to type "#" it yields "3".
3163              If you see this problem try  setting  the  environment  variable
3164              MODTWEAK_LOWEST=1 to see if it helps.
3165
3166       -xkb, -noxkb
3167
3168              When  in  modtweak  mode,  use the XKEYBOARD extension (if the X
3169              display supports it) to do the modifier tweaking.  This is  pow‐
3170              erful and should be tried if there are still keymapping problems
3171              when using -modtweak by itself.  The default is to check whether
3172              some  common keysyms, e.g. !, @, [, are only accessible via -xkb
3173              mode and if so then automatically enable the mode.   To  disable
3174              this automatic detection use -noxkb.
3175
3176              When  -xkb  mode  is  active  you can set these env. vars.  They
3177              apply only when there is ambiguity as to  which  key  to  choose
3178              (i.e the mapping is not one-to-one).  NOKEYHINTS=1: for up ascii
3179              keystrokes do not use score hints saved when the key was pressed
3180              down.  NOANYDOWN=1: for up keystrokes do not resort to searching
3181              through keys  that  are  currently  pressed  down.   KEYSDOWN=N:
3182              remember  the last N keys press down for tie-breaking when an up
3183              keystroke comes in.
3184
3185       -capslock
3186
3187              When in -modtweak (the default) or -xkb mode, if a keysym in the
3188              range A-Z comes in check the X server to see if the Caps_Lock is
3189              set.  If it is do not artificially press Shift to  generate  the
3190              keysym.   This  will enable the CapsLock key to behave correctly
3191              in some circumstances: namely *both* the VNC viewer machine  and
3192              the  x11vnc  X server are in the CapsLock on state.  If one side
3193              has CapsLock on and the other off and the keyboard is not behav‐
3194              ing  as  you  think  it  should  you should correct the CapsLock
3195              states (hint: pressing CapsLock inside and outside of the viewer
3196              can  help  toggle them both to the correct state).  However, for
3197              best results do not use this option, but  rather  *only*  enable
3198              CapsLock  on the VNC viewer side (i.e. by pressing CapsLock out‐
3199              side of the viewer window, also -skip_lockkeys below).  Also try
3200              -nomodtweak for a possible workaround.
3201
3202       -skip_lockkeys, -noskip_lockkeys
3203
3204              Have   x11vnc   ignore   all  Caps_Lock,  Shift_Lock,  Num_Lock,
3205              Scroll_Lock keysyms received from  viewers.   The  idea  is  you
3206              press  Caps_Lock on the VNC Viewer side but that does not change
3207              the lock state in the x11vnc-side X server.   Nevertheless  your
3208              capitalized  letters  come in over the wire and are applied cor‐
3209              rectly to the x11vnc-side X server.   Note  this  mode  probably
3210              won't  do what you want in -nomodtweak mode.  Also, a kludge for
3211              KP_n digits is always done in this mode: they are mapped to reg‐
3212              ular  digit  keysyms.  See also -capslock above.  The default is
3213              -noskip_lockkeys.
3214
3215       -skip_keycodes string
3216
3217              Ignore the comma separated list of  decimal  keycodes.   Perhaps
3218              these are keycodes not on your keyboard but your X server thinks
3219              exist.  Currently only applies to -xkb mode.  Use this option to
3220              help  x11vnc in the reverse problem it tries to solve: Keysym ->
3221              Keycode(s) when ambiguities exist (more  than  one  Keycode  per
3222              Keysym).   Run  'xmodmap  -pk' to see your keymapping.  Example:
3223              "-skip_keycodes 94,114"
3224
3225       -sloppy_keys
3226
3227              Experimental option that tries  to  correct  some  "sloppy"  key
3228              behavior.   E.g.  if  at the viewer you press Shift+Key but then
3229              release the Shift before Key  that  could  give  rise  to  extra
3230              unwanted characters (usually only between keyboards of different
3231              languages).  Only use this option if you observe  problems  with
3232              some keystrokes.
3233
3234       -skip_dups, -noskip_dups
3235
3236              Some  VNC viewers send impossible repeated key events, e.g. key-
3237              down, key-down, key-up, key-up all for the same key, or 20 downs
3238              in a row for the same modifier key!  Setting -skip_dups means to
3239              skip these duplicates and just process the  first  event.  Note:
3240              some  VNC viewers assume they can send down's without the corre‐
3241              sponding up's and so you should not set this  option  for  these
3242              viewers   (symptom:   some  keys  do  not  autorepeat)  Default:
3243              -noskip_dups
3244
3245       -add_keysyms, -noadd_keysyms
3246
3247              If a Keysym is received from a VNC viewer and that  Keysym  does
3248              not exist in the X server, then add the Keysym to the X server's
3249              keyboard mapping on  an  unused  key.   Added  Keysyms  will  be
3250              removed  periodically  and  also  when  x11vnc  exits.  Default:
3251              -add_keysyms
3252
3253       -clear_mods
3254
3255              At startup and exit clear the modifier keys  by  sending  KeyRe‐
3256              lease  for  each  one.  The Lock modifiers are skipped.  Used to
3257              clear the state if the display was accidentally  left  with  any
3258              pressed down.
3259
3260       -clear_keys
3261
3262              As  -clear_mods,  except  try  to release ANY pressed key.  Note
3263              that this option and -clear_mods can  interfere  with  a  person
3264              typing at the physical keyboard.
3265
3266       -clear_all
3267
3268              As  -clear_keys,  except  try  to release any CapsLock, NumLock,
3269              etc. locks as well.
3270
3271       -remap string
3272
3273              Read Keysym remappings from file named string.   Format  is  one
3274              pair of Keysyms per line (can be name or hex value) separated by
3275              a space.  If no file named string exists, it is  instead  inter‐
3276              preted    as    this    form:    key1-key2,key3-key4,...     See
3277              <X11/keysymdef.h> header file for a list of Keysym names, or use
3278              xev(1).
3279
3280              To  map a key to a button click, use the fake Keysyms "Button1",
3281              ..., etc. E.g: "-remap Super_R-Button2" (useful for pasting on a
3282              laptop)
3283
3284              I  use  these  if  the machine I am viewing from does not have a
3285              scrollwheel or I don't like using the one it has:
3286
3287              -remap    Super_R-Button4,Menu-Button5    -remap     KP_Add-But‐
3288              ton4,KP_Enter-Button5
3289
3290              the former would be used on a PC, the latter on a MacBook.  This
3291              way those little used keys can be used to generate  bigger  hops
3292              than  the  Up  and  Down arrows provide.  One can scroll through
3293              text or web pages more quickly this way  (especially  if  x11vnc
3294              scroll detection is active.)
3295
3296              Use Button44, Button12, etc. for multiple clicks.
3297
3298              To  disable  a keysym (i.e. make it so it will not be injected),
3299              remap it to "NoSymbol" or "None".
3300
3301              Dead keys: "dead" (or silent, mute) keys are keys  that  do  not
3302              produce  a  character  but  must be followed by a 2nd keystroke.
3303              This is often used for accenting characters, e.g. to put "`"  on
3304              top  of  "a"  by  pressing the dead key and then "a".  Note that
3305              this interpretation is not part of core X11, it  is  up  to  the
3306              toolkit  or  application to decide how to react to the sequence.
3307              The X11 names for these keysyms are "dead_grave",  "dead_acute",
3308              etc.  However some VNC viewers send the keysyms "grave", "acute"
3309              instead thereby disabling the accenting.  To  work  around  this
3310              -remap can be used.  For example "-remap grave-dead_grave,acute-
3311              dead_acute"
3312
3313              As a convenience, "-remap DEAD" applies these remaps:
3314
3315                    g     grave-dead_grave
3316                    a     acute-dead_acute
3317                    c     asciicircum-dead_circumflex
3318                    t     asciitilde-dead_tilde
3319                    m     macron-dead_macron
3320                    b     breve-dead_breve
3321                    D     abovedot-dead_abovedot
3322                    d     diaeresis-dead_diaeresis
3323                    o     degree-dead_abovering
3324                    A     doubleacute-dead_doubleacute
3325                    r     caron-dead_caron
3326                    e     cedilla-dead_cedilla
3327
3328              If you just want a subset  use  the  first  letter  label,  e.g.
3329              "-remap  DEAD=ga"  to  get the first two.  Additional remaps may
3330              also be supplied via commas, e.g.  "-remap  DEAD=ga,Super_R-But‐
3331              ton2".   Finally, "DEAD=missing" means to apply all of the above
3332              as long as the left hand  member  is  not  already  in  the  X11
3333              keymap.
3334
3335       -norepeat, -repeat
3336
3337              Option  -norepeat  disables  X  server  key auto repeat when VNC
3338              clients are connected and VNC keyboard input  is  not  idle  for
3339              more  than  5 minutes.  This works around a repeating keystrokes
3340              bug (triggered by long processing delays between  key  down  and
3341              key  up  client events: either from large screen changes or high
3342              latency).  Default: -norepeat
3343
3344              You can set the env. var. X11VNC_IDLE_TIMEOUT to the  number  of
3345              idle seconds you want (5min = 300secs).
3346
3347              Note: your VNC viewer side will likely do autorepeating, so this
3348              is no loss unless someone is simultaneously at the real  X  dis‐
3349              play.
3350
3351              Use  "-norepeat  N" to set how many times norepeat will be reset
3352              if something else (e.g.  X  session  manager)  undoes  it.   The
3353              default is 2.  Use a negative value for unlimited resets.
3354
3355       -nofb
3356
3357              Ignore  video  framebuffer:  only  process keyboard and pointer.
3358              Intended for use with Win2VNC and x2vnc dual-monitor setups.
3359
3360       -nobell
3361
3362              Do not watch for XBell events. (no beeps will  be  heard)  Note:
3363              XBell monitoring requires the XKEYBOARD extension.
3364
3365       -nosel
3366
3367              Do  not  manage  exchange  of  X selection/cutbuffer between VNC
3368              viewers and the X server at all.
3369
3370       -noprimary
3371
3372              Do not poll the PRIMARY selection for changes to  send  back  to
3373              clients.  (PRIMARY is still set on received changes, however).
3374
3375       -nosetprimary
3376
3377              Do  not  set the PRIMARY selection for changes received from VNC
3378              clients.
3379
3380       -noclipboard
3381
3382              Do not poll the CLIPBOARD selection for changes to send back  to
3383              clients.  (CLIPBOARD is still set on received changes, however).
3384
3385       -nosetclipboard
3386
3387              Do not set the CLIPBOARD selection for changes received from VNC
3388              clients.
3389
3390       -seldir string
3391
3392              If direction string is "send", only send the selection to  view‐
3393              ers,  and if it is "recv" only receive it from viewers.  To work
3394              around apps setting the selection too frequently and messing  up
3395              the  other  end.  You can actually supply a comma separated list
3396              of directions, including "debug" to turn on debugging output.
3397
3398       -cursor [mode], -nocursor
3399
3400              Sets how the pointer cursor shape  (little  icon  at  the  mouse
3401              pointer)  should  be handled.  The "mode" string is optional and
3402              is described below.  The default is to show some sort of  cursor
3403              shape(s).   How this is done depends on the VNC viewer and the X
3404              server.  Use -nocursor to disable cursor shapes completely.
3405
3406              Some VNC viewers support the TightVNC CursorPosUpdates and  Cur‐
3407              sorShapeUpdates  extensions (cuts down on network traffic by not
3408              having to send the  cursor  image  every  time  the  pointer  is
3409              moved),  in which case these extensions are used (see -nocursor‐
3410              shape and -nocursorpos below to disable).  For other viewers the
3411              cursor  shape  is written directly to the framebuffer every time
3412              the pointer is moved or changed and gets  sent  along  with  the
3413              other framebuffer updates.  In this case, there will be some lag
3414              between the vnc viewer pointer and the remote cursor position.
3415
3416              If the X display supports retrieving the cursor  shape  informa‐
3417              tion  from  the  X server, then the default is to use that mode.
3418              On Solaris this can be done with  the  SUN_OVL  extension  using
3419              -overlay  (see  also  the  -overlay_nocursor option).  A similar
3420              overlay scheme is used on IRIX.  Xorg (e.g.  Linux)  and  recent
3421              Solaris  Xsun  servers  support the XFIXES extension to retrieve
3422              the exact cursor shape from the X server.  If XFIXES is  present
3423              it  is  preferred over Overlay and is used by default (see -nox‐
3424              fixes below).  This can be disabled  with  -nocursor,  and  also
3425              some values of the "mode" option below.
3426
3427              Note that under XFIXES cursors with transparency (alpha channel)
3428              will usually not be exactly represented and one may find Overlay
3429              preferable.  See also the -alphacut and -alphafrac options below
3430              as fudge factors to try to improve  the  situation  for  cursors
3431              with transparency for a given theme.
3432
3433              The  "mode"  string  can  be used to fine-tune the displaying of
3434              cursor shapes.  It can be used the following ways:
3435
3436              "-cursor arrow" - just show the standard arrow nothing  more  or
3437              nothing less.
3438
3439              "-cursor none" - same as "-nocursor"
3440
3441              "-cursor  X" - when the cursor appears to be on the root window,
3442              draw the familiar X shape.  Some desktops such as GNOME cover up
3443              the root window completely, and so this will not work, try "X1",
3444              etc, to try to shift the tree depth.  On high latency  links  or
3445              slow  machines there will be a time lag between expected and the
3446              actual cursor shape.
3447
3448              "-cursor some" - like "X" but use additional heuristics  to  try
3449              to  guess if the window should have a windowmanager-like resizer
3450              cursor or a text input I-beam cursor.  This is a complete  hack,
3451              but  may be useful in some situations because it provides a lit‐
3452              tle more feedback about the cursor shape.
3453
3454              "-cursor most" - try to show as many cursors as possible.  Often
3455              this  will  only  be  the  same as "some" unless the display has
3456              overlay visuals or XFIXES extensions available.  On Solaris  and
3457              IRIX   if  XFIXES  is  not  available,  -overlay  mode  will  be
3458              attempted.
3459
3460       -cursor_drag
3461
3462              Show cursor shape changes even when the mouse is  being  dragged
3463              with a mouse button down.  This is useful if you want to be able
3464              to see Drag-and-Drop cursor icons, etc.
3465
3466       -arrow n
3467
3468              Choose an alternate "arrow" cursor from a  set  of  some  common
3469              ones.   n  can  be 1 to 6.  Default is: 1 Ignored when in XFIXES
3470              cursor-grabbing mode.
3471
3472       -noxfixes
3473
3474              Do not use the XFIXES extension to draw the exact  cursor  shape
3475              even if it is available.
3476
3477              Note:  To  work around a crash in Xorg 1.5 and later some people
3478              needed to use -noxfixes.  The Xorg crash occurred right after  a
3479              Display Manager (e.g. GDM) login.  Starting with x11vnc 0.9.9 it
3480              tries to automatically avoid using XFIXES until  it  is  sure  a
3481              window manager is running.  See the -reopen option for more info
3482              and how to use X11VNC_AVOID_WINDOWS=never to disable it.
3483
3484       -alphacut n
3485
3486              When using the XFIXES extension for the  cursor  shape,  cursors
3487              with  transparency  will  not  usually be displayed exactly (but
3488              opaque ones will).  This option sets n as a cutoff  for  cursors
3489              that have transparency ("alpha channel" with values ranging from
3490              0 to 255) Any cursor pixel with alpha value less than n  becomes
3491              completely  transparent.   Otherwise  the  pixel  is  completely
3492              opaque.  Default 240
3493
3494       -alphafrac fraction
3495
3496              With the threshold in -alphacut some cursors will become  almost
3497              completely  transparent  because their alpha values are not high
3498              enough.  For those cursors  adjust  the  alpha  threshold  until
3499              fraction  of  the  non-zero  alpha channel pixels become opaque.
3500              Default 0.33
3501
3502       -alpharemove
3503
3504              By default, XFIXES cursors pixels  with  transparency  have  the
3505              alpha  factor  multiplied  into  the RGB color values (i.e. that
3506              corresponding to blending the cursor with a  black  background).
3507              Specify  this  option  to  remove  the alpha factor. (useful for
3508              light colored semi-transparent cursors).
3509
3510       -noalphablend
3511
3512              In XFIXES mode do not send cursor alpha channel data to  LibVNC‐
3513              Server.   The default is to send it.  The alphablend effect will
3514              only be visible in -nocursorshape mode or for clients with  cur‐
3515              sorshapeupdates  turned  off. (However there is a hack for 32bpp
3516              with depth 24, it uses the extra 8 bits to store  cursor  trans‐
3517              parency  for use with a hacked vncviewer that applies the trans‐
3518              parency locally.  See the FAQ for more info).
3519
3520       -nocursorshape
3521
3522              Do not use the TightVNC  CursorShapeUpdates  extension  even  if
3523              clients support it.  See -cursor above.
3524
3525       -cursorpos, -nocursorpos
3526
3527              Option  -cursorpos enables sending the X cursor position back to
3528              all vnc  clients  that  support  the  TightVNC  CursorPosUpdates
3529              extension.   Other  clients  will  be  able  to  see the pointer
3530              motions. Default: -cursorpos
3531
3532       -xwarppointer, -noxwarppointer
3533
3534              Move the pointer with  XWarpPointer(3X)  instead  of  the  XTEST
3535              extension.   Use  this  as  a  workaround  if the pointer motion
3536              behaves incorrectly, e.g.  on touchscreens or other non-standard
3537              setups.
3538
3539              It  is also sometimes needed on XINERAMA displays and is enabled
3540              by default if XINERAMA is found to be active.  To prevent  this,
3541              use -noxwarppointer.
3542
3543              Also since 2009 there is an Xorg bug where the pointer cannot be
3544              moved properly on multiscreen displays.   If  x11vnc  detects  a
3545              multiscreen  display it activates this option.  To prevent this,
3546              use -noxwarppointer.
3547
3548       -always_inject
3549
3550              Even if there is no displacement (dx = dy = 0) for a  VNC  mouse
3551              event  force  the  pointer to the indicated x,y position anyway.
3552              Recent (2009) gui toolkits (gnome) have problems  with  x11vnc's
3553              original  mouse input injection method.  So x11vnc's mouse input
3554              injection method has been modified.  To regain the OLD  behavior
3555              use  this option: -always_inject.  Then x11vnc will always force
3556              positioning the mouse to the x,y position even if that  position
3557              has not changed since the previous VNC input event.
3558
3559              The  first place this problem was noticed was in gnome terminal:
3560              if you pressed and released mouse button 3, a  menu  was  posted
3561              and  then its first element 'New Terminal Window' was activated.
3562              This was because x11vnc injected the mouse position twice:  once
3563              on  ButtonPress  and again on ButtonRelease.  The toolkit inter‐
3564              preted the 2nd one as mouse motion even though the mouse  hadn't
3565              moved.   So  now  by default x11vnc tries to avoid injecting the
3566              2nd one.
3567
3568              Note that with the new  default  x11vnc  will  be  oblivious  to
3569              applications  moving  the  pointer  (warping) or the user at the
3570              physical display moving it.  So it might, e.g., inject ButtonRe‐
3571              lease  at  the  wrong  position.  If this (or similar scenarios)
3572              causes problems in your environment, specify -always_inject  for
3573              the old method.
3574
3575       -buttonmap string
3576
3577              String  to remap mouse buttons.  Format: IJK-LMN, this maps but‐
3578              tons I -> L, etc., e.g.  -buttonmap 13-31
3579
3580              Button presses can also be mapped to keystrokes: replace a  but‐
3581              ton   digit   on   the   right  of  the  dash  with  :<sym>:  or
3582              :<sym1>+<sym2>: etc. for multiple  keys.  For  example,  if  the
3583              viewing  machine  has a mouse-wheel (buttons 4 5) but the x11vnc
3584              side does not, these will do scrolls:
3585
3586              -buttonmap 12345-123:Prior::Next:
3587
3588              -buttonmap 12345-123:Up+Up+Up::Down+Down+Down:
3589
3590              See <X11/keysymdef.h> header file for a list of Keysyms, or  use
3591              the  xev(1)  program.  Note: mapping of button clicks to Keysyms
3592              may not work if -modtweak or -xkb is needed for the Keysym.
3593
3594              If you include a modifier like "Shift_L" the modifier's  up/down
3595              state is toggled, e.g. to send "The" use :Shift_L+t+Shift_L+h+e:
3596              (the 1st one is shift down and the 2nd one is shift up).  (note:
3597              the  initial  state of the modifier is ignored and not reset) To
3598              include button events use "Button1", ... etc.
3599
3600              -buttonmap currently does not  work  on  MacOSX  console  or  in
3601              -rawfb mode.
3602
3603              Workaround:  use -buttonmap IJ...-LM...=n to limit the number of
3604              mouse buttons to n, e.g. 123-123=3.  This  will  prevent  x11vnc
3605              from  crashing  if the X server reports there are 5 buttons (4/5
3606              scroll wheel), but there are only really 3.
3607
3608       -nodragging
3609
3610              Do not update the display during mouse  dragging  events  (mouse
3611              button  held  down).   Greatly improves response on slow setups,
3612              but you lose all visual feedback for drags, text selection,  and
3613              some menu traversals.  It overrides any -pointer_mode setting.
3614
3615       -ncache n
3616
3617              Client-side  caching  scheme.  Framebuffer memory n (an integer)
3618              times that of the full display is  allocated  below  the  actual
3619              framebuffer  to cache screen contents for rapid retrieval.  So a
3620              W x H frambuffer is expanded to a W x (n+1)*H  one.   Use  0  to
3621              disable.
3622
3623              The n is actually optional, the default is 10.
3624
3625              For this and the other -ncache* options below you can abbreviate
3626              "-ncache" with "-nc".  Also, "-nonc" is the same as "-ncache 0"
3627
3628              This is an experimental option, currently implemented in an awk‐
3629              ward  way  in that in the VNC Viewer you can see the pixel cache
3630              contents if you scroll down, etc.   So  you  will  have  to  set
3631              things  up so you can't see that region.  If this method is suc‐
3632              cessful, the changes required for clients to do this  less  awk‐
3633              wardly will be investigated.
3634
3635              The  SSVNC  viewer  does  a good job at automatically hiding the
3636              pixel cache region.  Or use SSVNC's -ycrop option to  explicitly
3637              hide the region.
3638
3639              Note  that  this  mode consumes a huge amount of memory, both on
3640              the x11vnc server side and on the VNC Viewer side.  If n=2  then
3641              the  amount  of  RAM used is roughly tripled for both x11vnc and
3642              the VNC Viewer.  As a rule of  thumb,  note  that  1280x1024  at
3643              depth 24 is about 5MB of pixel data.
3644
3645              For  reasonable response when cycling through 4 to 6 large (e.g.
3646              web browser) windows a value  n  of  6  to  12  is  recommended.
3647              (that's right: ~10X more memory...)
3648
3649              Because of the way window backingstore and saveunders are imple‐
3650              mented, n must be even.  It will be incremented by 1  if  it  is
3651              not.
3652
3653              This  mode  also  works  for  native  MacOS X, but may not be as
3654              effective as the X version.  This is due to a number of  things,
3655              one  is the drop-shadow compositing that leaves extra areas that
3656              need to be repaired (see -ncache_pad).  Another  is  the  window
3657              iconification  animations need to be avoided (see -macicontime).
3658              It appears the that the  'Scale'  animation  mode  gives  better
3659              results  than the 'Genie' one.  Also, window event detection not
3660              as accurate as the X version.
3661
3662       -ncache_cr
3663
3664              In -ncache mode, try to do copyrect  opaque  window  moves/drags
3665              instead  of  wireframes  (this can induce painting errors).  The
3666              wireframe will still be used when moving a  window  whose  save-
3667              unders has not yet been set or has been invalidated.
3668
3669              Some  VNC  Viewers provide better response than others with this
3670              option.  On Unix,  realvnc  viewer  gives  smoother  drags  than
3671              tightvnc viewer.  Response may also be choppy if the server side
3672              machine is too slow.
3673
3674              Sometimes on very slow modem connections, this actually gives an
3675              improvement  because no pixel data at all (not even the box ani‐
3676              mation) is sent during the drag.
3677
3678       -ncache_no_moveraise
3679
3680              In -ncache mode, do not assume that moving a window  will  cause
3681              the  window  manager  to  raise it to the top of the stack.  The
3682              default is to assume it does, and so at  the  beginning  of  any
3683              wireframe, etc, window moves the window will be pushed to top in
3684              the VNC viewer.
3685
3686       -ncache_no_dtchange
3687
3688              In -ncache mode, do not try to guess when the desktop (viewport)
3689              changes  to another one (i.e. another workarea).  The default is
3690              to try to guess and when detected try to  make  the  transistion
3691              more smoothly.
3692
3693       -ncache_no_rootpixmap
3694
3695              In  -ncache  mode, do not try to snapshot the desktop background
3696              to use in guessing or reconstructing window save-unders.
3697
3698       -ncache_keep_anims
3699
3700              In -ncache mode, do not try to disable window manager animations
3701              and  other  effects  (that usually degrade ncache performance or
3702              cause painting errors).  The default is to try to  disable  them
3703              on KDE (but not GNOME) when VNC clients are connected.
3704
3705              For  other  window managers or desktops that provide animations,
3706              effects, compositing, translucency, etc. that interfere with the
3707              -ncache method you will have to disable them manually.
3708
3709       -ncache_old_wm
3710
3711              In  -ncache  mode,  enable  some heuristics for old style window
3712              managers such as fvwm and twm.
3713
3714       -ncache_pad n
3715
3716              In -ncache mode, pad each window with n pixels for  the  caching
3717              rectangles.   This  can  be used to try to improve the situation
3718              with dropshadows or other compositing (e.g. MacOS X window  man‐
3719              ager), although it could make things worse.  The default is 0 on
3720              Unix and 24 on MacOS X.
3721
3722       -debug_ncache
3723
3724              Turn on debugging and profiling output under -ncache.
3725
3726       -wireframe [str], -nowireframe
3727
3728              Try to detect window moves or resizes when  a  mouse  button  is
3729              held  down  and show a wireframe instead of the full opaque win‐
3730              dow.  This is based completely on heuristics and may not  always
3731              work:  it  depends  on your window manager and even how you move
3732              things around.  See -pointer_mode below for  discussion  of  the
3733              "bogging down" problem this tries to avoid.  Default: -wireframe
3734
3735              Shorter aliases:  -wf [str]  and -nowf
3736
3737              The  value "str" is optional and, of course, is packed with many
3738              tunable parameters for this scheme:
3739
3740              Format: shade,linewidth,percent,T+B+L+R,mod,t1+t2+t3+t4 Default:
3741              0xff,2,0,32+8+8+8,all,0.15+0.30+5.0+0.125
3742
3743              If  you  leave nothing between commas: ",," the default value is
3744              used.  If you don't specify enough commas, the trailing  parame‐
3745              ters are set to their defaults.
3746
3747              "shade"  indicate  the  "color"  for  the  wireframe,  usually a
3748              greyscale: 0-255, however for 16 and 32bpp you  can  specify  an
3749              rgb.txt  X color (e.g. "dodgerblue") or a value > 255 is treated
3750              as RGB (e.g. red is 0xff0000).  "linewidth" sets  the  width  of
3751              the  wireframe  in pixels.  "percent" indicates to not apply the
3752              wireframe scheme to windows with area less than this percent  of
3753              the full screen.
3754
3755              "T+B+L+R"  indicates  four  integers for how close in pixels the
3756              pointer has to be from the Top, Bottom, Left, or Right edges  of
3757              the  window  to  consider  wireframing.   This  is  a speedup to
3758              quickly exclude a window from being wireframed: set them all  to
3759              zero  to  not try the speedup (scrolling and selecting text will
3760              likely be slower).
3761
3762              "mod" specifies if a button down event in the  interior  of  the
3763              window  with a modifier key (Alt, Shift, etc.) down should indi‐
3764              cate a wireframe opportunity.  It can be "0" or "none"  to  skip
3765              it, "1" or "all" to apply it to any modifier, or "Shift", "Alt",
3766              "Control", "Meta", "Super", or "Hyper" to only  apply  for  that
3767              type of modifier key.
3768
3769              "t1+t2+t3+t4"  specify  four floating point times in seconds: t1
3770              is how long to wait for the pointer to move, t2 is how  long  to
3771              wait  for  the window to start moving or being resized (for some
3772              window managers this can be rather long), t3 is how long to keep
3773              a wireframe moving before repainting the window. t4 is the mini‐
3774              mum time between sending wireframe "animations".  If a slow link
3775              is  detected, these values may be automatically changed to some‐
3776              thing better for a slow link.
3777
3778       -nowireframelocal
3779
3780              By default, mouse motion and button presses of a user sitting at
3781              the  LOCAL  display  are monitored for wireframing opportunities
3782              (so that the  changes  will  be  sent  efficiently  to  the  VNC
3783              clients).  Use this option to disable this behavior.
3784
3785       -wirecopyrect mode, -nowirecopyrect
3786
3787              Since  the  -wireframe mechanism evidently tracks moving windows
3788              accurately, a speedup can be obtained by telling the VNC viewers
3789              to  locally  copy the translated window region.  This is the VNC
3790              CopyRect encoding: the framebuffer update doesn't need  to  send
3791              the actual new image data.
3792
3793              Shorter aliases:  -wcr [mode]  and -nowcr
3794
3795              "mode" can be "never" (same as -nowirecopyrect) to never try the
3796              copyrect, "top" means only do it if the window was  not  covered
3797              by  any  other  windows,  and  "always"  means  to translate the
3798              orginally unobscured region (this may look odd as the  remaining
3799              pieces come in, but helps on a slow link).  Default: "always"
3800
3801              Note:  there  can be painting errors or slow response when using
3802              -scale so you may want to disable CopyRect in this case  "-wire‐
3803              copyrect  never"  on  the command line or by remote-control.  Or
3804              you can also use the "-scale xxx:nocr" scale option.
3805
3806       -debug_wireframe
3807
3808              Turn on debugging info printout for  the  wireframe  heuristics.
3809              "-dwf" is an alias.  Specify multiple times for more output.
3810
3811       -scrollcopyrect mode, -noscrollcopyrect
3812
3813              Like -wirecopyrect, but use heuristics to try to guess if a win‐
3814              dow has scrolled its contents  (either  vertically  or  horizon‐
3815              tally).   This  requires  the RECORD X extension to "snoop" on X
3816              applications (currently for certain XCopyArea and XConfigureWin‐
3817              dow  X protocol requests).  Examples: Hitting <Return> in a ter‐
3818              minal window when the cursor was at the bottom, the text scrolls
3819              up  one line.  Hitting <Down> arrow in a web browser window, the
3820              web page scrolls up a small amount.  Or scrolling with a scroll‐
3821              bar or mouse wheel.
3822
3823              Shorter aliases:  -scr [mode]  and -noscr
3824
3825              This  scheme  will  not  always detect scrolls, but when it does
3826              there is a nice speedup from using  the  VNC  CopyRect  encoding
3827              (see  -wirecopyrect).   The  speedup  is both in reduced network
3828              traffic and reduced X framebuffer polling/copying.  On the other
3829              hand, it may induce undesired transients (e.g. a terminal cursor
3830              being scrolled up when it  should  not  be)  or  other  painting
3831              errors  (window tearing, bunching-up, etc).  These are automati‐
3832              cally repaired in a short period of time.  If this is  unaccept‐
3833              able disable the feature with -noscrollcopyrect.
3834
3835              Screen  clearing  kludges:  for testing at least, there are some
3836              "magic key sequences" (must be done in less than  1  second)  to
3837              aid  repairing  painting errors that may be seen when using this
3838              mode:
3839
3840              3 Alt_L's   in a row: resend whole screen, 4 Alt_L's   in a row:
3841              reread and resend whole screen, 3 Super_L's in a row: mark whole
3842              screen for polling, 4 Super_L's in a row: reset RECORD  context,
3843              5 Super_L's in a row: try to push a black screen
3844
3845              note:  Alt_L is the Left "Alt" key (a single key) Super_L is the
3846              Left "Super" key (Windows flag).  Both  of  these  are  modifier
3847              keys,  and  so  should  not  generate characters when pressed by
3848              themselves.  Also, your VNC viewer may have its own refresh hot-
3849              key or button.
3850
3851              "mode"  can  be "never" (same as -noscrollcopyrect) to never try
3852              the copyrect, "keys" means to try it in response  to  keystrokes
3853              only,  "mouse" means to try it in response to mouse events only,
3854              "always" means to do both. Default: "always"
3855
3856              Note: there can be painting errors or slow response  when  using
3857              -scale  so  you  may  want  to  disable  CopyRect  in  this case
3858              "-scrollcopyrect never" on the command line  or  by  remote-con‐
3859              trol.  Or you can also use the "-scale xxx:nocr" scale option.
3860
3861       -scr_area n
3862
3863              Set  the minimum area in pixels for a rectangle to be considered
3864              for the -scrollcopyrect detection  scheme.   This  is  to  avoid
3865              wasting  the  effort  on  small rectangles that would be quickly
3866              updated the normal way.  E.g. suppose an app updated  the  posi‐
3867              tion  of  its  skinny scrollbar first and then shifted the large
3868              panel it controlled.  We want to  be  sure  to  skip  the  small
3869              scrollbar and get the large panel. Default: 60000
3870
3871       -scr_skip list
3872
3873              Skip  scroll detection for applications matching the comma sepa‐
3874              rated list of strings  in  list.   Some  applications  implement
3875              their  scrolling  in strange ways where the XCopyArea, etc, also
3876              applies to invisible portions of  the  window:  if  we  CopyRect
3877              those  areas  it  looks awful during the scroll and there may be
3878              painting errors left after the scroll.  Soffice.bin is the worst
3879              known offender.
3880
3881              Use  "##"  to  denote  the  start of the application class (e.g.
3882              "##XTerm") and "++" to  denote  the  start  of  the  application
3883              instance name (e.g. "++xterm").  The string your list is matched
3884              against is of the form "^^WM_NAME##Class++Instance<same-for-any-
3885              subwindows>"  The  "xlsclients  -la"  command  will provide this
3886              info.
3887
3888              If a pattern is prefixed with "KEY:" it  only  applies  to  Key‐
3889              stroke  generated  scrolls  (e.g.  Up arrow).  If it is prefixed
3890              with "MOUSE:" it only applies to  Mouse  induced  scrolls  (e.g.
3891              dragging  on  a  scrollbar).   Default:  ##Soffice.bin,##StarOf‐
3892              fice,##OpenOffice
3893
3894       -scr_inc list
3895
3896              Opposite of -scr_skip: this list is consulted first and if there
3897              is  a  match the window will be monitored via RECORD for scrolls
3898              irrespective of -scr_skip.  Use -scr_skip '*' to  skip  anything
3899              that  does not match your -scr_inc.  Use -scr_inc '*' to include
3900              everything.
3901
3902       -scr_keys list
3903
3904              For keystroke scroll detection, only apply the RECORD heuristics
3905              to  the  comma  separated list of keysyms in list.  You may find
3906              the RECORD overhead for every one of  your  keystrokes  disrupts
3907              typing  too  much,  but you don't want to turn it off completely
3908              with "-scr mouse" and -scr_parms does not work or is too confus‐
3909              ing.
3910
3911              The  listed  keysyms  can  be numeric or the keysym names in the
3912              <X11/keysymdef.h> header file or from the xev(1) program.  Exam‐
3913              ple:  "-scr_keys  Up,Down,Return".   One  probably wants to have
3914              application specific lists (e.g. for terminals, etc) but that is
3915              too icky to think about for now...
3916
3917              If  list  begins  with the "-" character the list is taken as an
3918              exclude list: all keysyms except those list will be  considered.
3919              The  special  string  "builtin"  expands  to an internal list of
3920              keysyms that are likely to cause scrolls.  BTW, by default modi‐
3921              fier  keys,  Shift_L,  Control_R,  etc,  are  skipped since they
3922              almost never induce scrolling by themselves.
3923
3924       -scr_term list
3925
3926              Yet another cosmetic kludge.  Apply shell/terminal heuristics to
3927              applications   matching   comma  separated  list  (same  as  for
3928              -scr_skip/-scr_inc).  For example an  annoying  transient  under
3929              scroll  detection  is  if you hit Enter in a terminal shell with
3930              full text window, the solid text cursor block will  be  scrolled
3931              up.   So  for a short time there are two (or more) block cursors
3932              on the screen.  There are similar  scenarios,  (e.g.  an  output
3933              line is duplicated).
3934
3935              These  transients  are  induced  by  the approximation of scroll
3936              detection (e.g. it detects the scroll, but not the fact that the
3937              block cursor was cleared just before the scroll).  In nearly all
3938              cases these transient errors are repaired when the true X frame‐
3939              buffer  is  consulted  by the normal polling.  But they are dis‐
3940              tracting, so what this option provides is extra  "padding"  near
3941              the  bottom  of  the terminal window: a few extra lines near the
3942              bottom will not be scrolled, but rather updated from the  actual
3943              X  framebuffer.   This  usually  reduces the annoying artifacts.
3944              Use "none" to disable.  Default: "term"
3945
3946       -scr_keyrepeat lo-hi
3947
3948              If a key is held down (or otherwise repeats  rapidly)  and  this
3949              induces  a rapid sequence of scrolls (e.g. holding down an Arrow
3950              key) the "scrollcopyrect" detection and overhead may not be able
3951              to  keep up.  A time per single scroll estimate is performed and
3952              if that estimate predicts a sustainable scrollrate of  keys  per
3953              second  between  "lo"  and  "hi" then repeated keys will be DIS‐
3954              CARDED to maintain the scrollrate. For example your key  autore‐
3955              peat  may  be  25  keys/sec, but for a large window or slow link
3956              only 8 scrolls per second can be sustained, then roughly  2  out
3957              of  every  3 repeated keys will be discarded during this period.
3958              Default: "4-20"
3959
3960       -scr_parms string
3961
3962              Set various parameters for the scrollcopyrect mode.  The  format
3963              is similar to that for -wireframe and packed with lots of param‐
3964              eters:
3965
3966              Format:         T+B+L+R,t1+t2+t3,s1+s2+s3+s4+s5         Default:
3967              0+64+32+32,0.02+0.10+0.9,0.03+0.06+0.5+0.1+5.0
3968
3969              If  you  leave nothing between commas: ",," the default value is
3970              used.  If you don't specify enough commas, the trailing  parame‐
3971              ters are set to their defaults.
3972
3973              "T+B+L+R"  indicates  four  integers for how close in pixels the
3974              pointer has to be from the Top, Bottom, Left, or Right edges  of
3975              the  window  to consider scrollcopyrect.  If -wireframe overlaps
3976              it takes precedence.  This is a speedup  to  quickly  exclude  a
3977              window  from  being  watched for scrollcopyrect: set them all to
3978              zero to not try the speedup (things  like  selecting  text  will
3979              likely be slower).
3980
3981              "t1+t2+t3"  specify  three  floating point times in seconds that
3982              apply to scrollcopyrect detection with *Keystroke* input: t1  is
3983              how long to wait after a key is pressed for the first scroll, t2
3984              is how long to keep looking after a Keystroke  scroll  for  more
3985              scrolls.   t3  is  how  frequently  to try to update surrounding
3986              scrollbars outside of the scrolling area (0.0 to disable)
3987
3988              "s1+s2+s3+s4+s5" specify five floating point  times  in  seconds
3989              that apply to scrollcopyrect detection with *Mouse* input: s1 is
3990              how long to wait after a mouse button is pressed for  the  first
3991              scroll,  s2  is  how long to keep waiting for additional scrolls
3992              after the first Mouse scroll was detected.  s3 is how frequently
3993              to try to update surrounding scrollbars outside of the scrolling
3994              area (0.0 to disable).  s4 is how long to buffer pointer  motion
3995              (to  try  to get fewer, bigger mouse scrolls). s5 is the maximum
3996              time to spend just updating the scroll window  without  updating
3997              the rest of the screen.
3998
3999       -fixscreen string
4000
4001              Periodically  "repair"  the  screen based on settings in string.
4002              Hopefully you won't need this option, it is intended  for  cases
4003              when  the  -scrollcopyrect  or  -wirecopyrect features leave too
4004              many painting errors, but it can be used for any scenario.  This
4005              option  periodically  performs costly operations and so interac‐
4006              tive response may be reduced when it  is  on.   You  can  use  3
4007              Alt_L's  (the  Left "Alt" key) taps in a row (as described under
4008              -scrollcopyrect) instead to manually request  a  screen  repaint
4009              when it is needed.
4010
4011              string  is  a comma separated list of one or more of the follow‐
4012              ing: "V=t", "C=t", "X=t", and "8=t".  In these "t" stands for  a
4013              time  in  seconds (it is a floating point even though one should
4014              usually use values > 2 to avoid wasting resources).  V sets  how
4015              frequently  the  entire  screen should be sent to viewers (it is
4016              like the 3 Alt_L's).  C sets how long to wait after  a  CopyRect
4017              to repaint the full screen.  X sets how frequently to reread the
4018              full X11 framebuffer from the X server and push it out  to  con‐
4019              nected viewers.  Use of X should be rare, please report a bug if
4020              you find you need it. 8= applies only for -8to24 mode:  it  sets
4021              how  often  the  non-default  visual regions of the screen (e.g.
4022              8bpp  windows)  are  refreshed.    Examples:   -fixscreen   V=10
4023              -fixscreen C=10
4024
4025       -debug_scroll
4026
4027              Turn  on  debugging  info  printout  for  the scroll heuristics.
4028              "-ds" is an alias.  Specify it multiple times for more output.
4029
4030       -noxrecord
4031
4032              Disable any use of the RECORD extension.  This is currently used
4033              by the -scrollcopyrect scheme and to monitor X server grabs.
4034
4035       -grab_buster, -nograb_buster
4036
4037              Some  of the use of the RECORD extension can leave a tiny window
4038              for XGrabServer deadlock.  This  is  only  if  the  whole-server
4039              grabbing  application  expects  mouse  or  keyboard input before
4040              releasing the grab.  It is usually a window  manager  that  does
4041              this.   x11vnc  takes  care  to avoid the problem, but if caught
4042              x11vnc will freeze.  Without -grab_buster, the only solution  is
4043              to go the physical display and give it some input to satisfy the
4044              grabbing app.  Or manually kill and restart the  window  manager
4045              if  that  is  feasible.   With  -grab_buster, x11vnc will fork a
4046              helper thread and if x11vnc appears to be stuck in a grab  after
4047              a  period  of  time  (20-30  sec)  then it will inject some user
4048              input: button clicks, Escape, mouse motion, etc to try to  break
4049              the  grab.   If  you  experience  a lot of grab deadlock, please
4050              report a bug.
4051
4052       -debug_grabs
4053
4054              Turn on debugging info printout with  respect  to  XGrabServer()
4055              deadlock for -scrollcopyrect__mode_.
4056
4057       -debug_sel
4058
4059              Turn  on  debugging info printout with respect to PRIMARY, CLIP‐
4060              BOARD, and CUTBUFFER0 selections.
4061
4062       -pointer_mode n
4063
4064              Various pointer motion update schemes. "-pm" is an  alias.   The
4065              problem is pointer motion can cause rapid changes on the screen:
4066              consider the rapid changes when you drag a large  window  around
4067              opaquely.   Neither  x11vnc's screen polling and vnc compression
4068              routines nor the bandwidth to the vncviewers can keep  up  these
4069              rapid  screen changes: everything will bog down when dragging or
4070              scrolling.  So a scheme has to be used to  "eat"  much  of  that
4071              pointer  input  before  re-polling  the  screen  and sending out
4072              framebuffer updates. The mode number n can be 0 to 4 and selects
4073              one of the schemes desribed below.
4074
4075              Note  that the -wireframe and -scrollcopyrect__mode_s complement
4076              -pointer_mode by detecting (and improving)  certain  periods  of
4077              "rapid screen change".
4078
4079              n=0:  does  the same as -nodragging. (all screen polling is sus‐
4080              pended if a mouse button is pressed.)
4081
4082              n=1: was the original scheme used to about Jan  2004:  it  basi‐
4083              cally  just  skips -input_skip keyboard or pointer events before
4084              repolling the screen.
4085
4086              n=2 is an improved scheme: by watching the current rate of input
4087              events  it  tries to detect if it should try to "eat" additional
4088              pointer events before continuing.
4089
4090              n=3 is basically a dynamic -nodragging mode: it detects when the
4091              mouse motion has paused and then refreshes the display.
4092
4093              n=4  attempts  to  measures network rates and latency, the video
4094              card read rate, and how many tiles  have  been  changed  on  the
4095              screen.   From  this,  it  aggressively  tries  to  push  screen
4096              "frames" when it decides it has enough resources to do so.   NOT
4097              FINISHED.
4098
4099              The  default  n  is  2.  Note  that  modes  2,  3,  4  will skip
4100              -input_skip keyboard events  (but  it  will  not  count  pointer
4101              events).   Also  note  that  these  modes  are  not available in
4102              -threads mode which has its own pointer  event  handling  mecha‐
4103              nism.
4104
4105              To  try  out  the different pointer modes to see which one gives
4106              the best response for your usage, it is convenient  to  use  the
4107              remote  control  function,  for  example "x11vnc -R pm:4" or the
4108              tcl/tk gui (Tuning -> pointer_mode -> n).
4109
4110       -input_skip n
4111
4112              For the pointer handling when non-threaded: try to read  n  user
4113              input  events  before  scanning  display.  n < 0 means to act as
4114              though there is always user input.  Default: 10
4115
4116       -allinput
4117
4118              Have x11vnc read and process all available client  input  before
4119              proceeding.
4120
4121       -input_eagerly
4122
4123              Similar  to  -allinput but use the handleEventsEagerly mechanism
4124              built into LibVNCServer.
4125
4126       -speeds rd,bw,lat
4127
4128              x11vnc tries to estimate some speed parameters that are used  to
4129              optimize  scheduling (e.g. -pointer_mode 4, -wireframe, -scroll‐
4130              copyrect) and other things.  Use the -speeds option to set these
4131              manually.   The  triple  rd,bw,lat corresponds to video h/w read
4132              rate in MB/sec, network bandwidth to clients in KB/sec, and net‐
4133              work  latency  to  clients  in milliseconds, respectively.  If a
4134              value is left blank, e.g. "-speeds ,100,15", then  the  internal
4135              scheme is used to estimate the empty value(s).
4136
4137              Typical  PC  video cards have read rates of 5-10 MB/sec.  If the
4138              framebuffer is in main memory instead of video h/w (e.g. SunRay,
4139              shadowfb, dummy driver, Xvfb), the read rate may be much faster.
4140              "x11perf -getimage500" can be used to get a lower bound  (remem‐
4141              ber to factor in the bytes per pixel).  It is up to you to esti‐
4142              mate the network bandwith  and  latency  to  clients.   For  the
4143              latency the ping(1) command can be used.
4144
4145              For  convenience  there are some aliases provided, e.g. "-speeds
4146              modem".   The  aliases  are:  "modem"  for  6,4,200;  "dsl"  for
4147              6,100,50; and "lan" for 6,5000,1
4148
4149       -wmdt string
4150
4151              For  some  features, e.g. -wireframe and -scrollcopyrect, x11vnc
4152              has to work around issues for certain window managers  or  desk‐
4153              tops  (currently  kde  and  xfce).  By default it tries to guess
4154              which one, but it can guess incorrectly.   Use  this  option  to
4155              indicate  which  wm/dt.   string  can  be "gnome", "kde", "cde",
4156              "xfce", or "root" (classic X wm).  Anything else is  interpreted
4157              as "root".
4158
4159       -debug_pointer
4160
4161              Print debugging output for every pointer event.
4162
4163       -debug_keyboard
4164
4165              Print debugging output for every keyboard event.
4166
4167       Same as -dp and -dk, respectively.  Use multiple times for more output.
4168
4169       -defer time
4170
4171              Time in ms to delay sending updates to connected clients (defer‐
4172              UpdateTime)  Default: 20
4173
4174       -wait time
4175
4176              Time in ms to pause between screen polls.  Used to cut  down  on
4177              load.  Default: 20
4178
4179       -extra_fbur n
4180
4181              Perform  extra  FrameBufferUpdateRequests checks to try to be in
4182              better sync with the client's requests.  What this does is  per‐
4183              form  extra polls of the client socket at critical times (before
4184              '-defer' and '-wait' calls.)  The default  is  n=1.   Set  to  a
4185              larger number to insert more checks or set to n=0 to disable.  A
4186              downside of these extra calls is that more mouse  input  may  be
4187              processed than desired.
4188
4189       -wait_ui factor
4190
4191              Factor  by  which to cut the -wait time if there has been recent
4192              user  input  (pointer  or  keyboard).   Improves  response,  but
4193              increases  the load whenever you are moving the mouse or typing.
4194              Default: 2.00
4195
4196       -setdefer n
4197
4198              When the -wait_ui mechanism cuts down the wait time ms, set  the
4199              defer  time  to  the same ms value. n=1 to enable, 0 to disable,
4200              and -1 to set defer to 0 (no delay).  Similarly, 2 and -2  indi‐
4201              cate  'urgent_update'  mode  should  be used to push the updates
4202              even sooner.  Default: 1
4203
4204       -nowait_bog
4205
4206              Do not detect if the screen polling is "bogging down" and  sleep
4207              more.  Some activities with no user input can slow things down a
4208              lot: consider a large terminal window with a long build  running
4209              in  it  continuously  streaming  text output.  By default x11vnc
4210              will try to detect this (3 screen polls in  a  row  each  longer
4211              than  0.25  sec with no user input), and sleep up to 1.5 secs to
4212              let things "catch up".  Use this option to disable  that  detec‐
4213              tion.
4214
4215       -slow_fb time
4216
4217              Floating point time in seconds to delay all screen polling.  For
4218              special purpose usage where a low frame rate is  acceptable  and
4219              desirable,  but  you want the user input processed at the normal
4220              rate so you cannot use -wait.
4221
4222       -xrefresh time
4223
4224              Floating point time in seconds to indicate how often to  do  the
4225              equivalent  of xrefresh(1) to force all windows (in the viewable
4226              area if -id, -sid, or -clip is used) to repaint themselves.  Use
4227              this only if applications misbehave by not repainting themselves
4228              properly.  See also -noxdamage.
4229
4230       -nap, -nonap
4231
4232              Monitor activity and if it  is  low  take  longer  naps  between
4233              screen  polls  to really cut down load when idle.  Default: take
4234              naps
4235
4236       -sb time
4237
4238              Time in seconds after NO activity (e.g. screen blank) to  really
4239              throttle  down the screen polls (i.e. sleep for about 1.5 secs).
4240              Use 0 to disable.  Default: 60 Set the env. var.  X11VNC_SB_FAC‐
4241              TOR to scale it.
4242
4243       -readtimeout n
4244
4245              Set  LibVNCServer  rfbMaxClientWait  to n seconds. On slow links
4246              that take a long time to paint the first screen LibVNCServer may
4247              hit the timeout and drop the connection.  Default: 20 seconds.
4248
4249       -ping n
4250
4251              Send  a  1x1  framebuffer  update to all clients every n seconds
4252              (e.g. to try to keep a network connection alive)
4253
4254       -nofbpm, -fbpm
4255
4256              If the system supports the FBPM (Frame Buffer Power  Management)
4257              extension  (i.e.  some  Sun systems), then prevent the video h/w
4258              from going into a reduced power state when VNC clients are  con‐
4259              nected.
4260
4261              FBPM  capable video h/w save energy when the workstation is idle
4262              by going into low power states (similar to DPMS  for  monitors).
4263              This interferes with x11vnc's polling of the framebuffer data.
4264
4265              "-nofbpm"  means  prevent  FBPM  low  power  states whenever VNC
4266              clients are connected, while "-fbpm" means to  not  monitor  the
4267              FBPM  state at all.  See the xset(1) manpage for details.  -nof‐
4268              bpm is basically the same as running "xset fbpm force on"  peri‐
4269              odically.  Default: -fbpm
4270
4271       -nodpms, -dpms
4272
4273              If  the  system supports the DPMS (Display Power Management Sig‐
4274              naling) extension, then prevent the monitor from  going  into  a
4275              reduced power state when VNC clients are connected.
4276
4277              DPMS  reduced power monitor states are a good thing and you nor‐
4278              mally want the power down to take place (usually x11vnc  has  no
4279              problem exporting the display in this state).  You probably only
4280              want to use "-nodpms" to work around problems with Screen Savers
4281              kicking  on  in  DPMS  low power states.  There is known problem
4282              with kdesktop_lock on KDE where the screen saver  keeps  kicking
4283              in  every time user input stops for a second or two.  Specifying
4284              "-nodpms" works around it.
4285
4286              "-nodpms" means prevent  DPMS  low  power  states  whenever  VNC
4287              clients  are  connected,  while "-dpms" means to not monitor the
4288              DPMS state  at  all.   See  the  xset(1)  manpage  for  details.
4289              -nodpms  is  basically  the same as running "xset dpms force on"
4290              periodically.  Default: -dpms
4291
4292       -forcedpms
4293
4294              If the system supports the DPMS (Display Power  Management  Sig‐
4295              naling) extension, then try to keep the monitor in a powered off
4296              state.  This is to prevent nosey people at the physical  display
4297              from  viewing what is on the screen.  Be sure to lock the screen
4298              before disconnecting.
4299
4300              This method is far  from  bullet  proof,  e.g.  suppose  someone
4301              attaches  a non-DPMS monitor, or loads the machine so that there
4302              is a gap of time before x11vnc restores the powered  off  state?
4303              On  many  machines if he floods it with keyboard and mouse input
4304              he can see flashes of what is on the screen before the DPMS  off
4305              state  is  reestablished.  For this to work securely there would
4306              need to be support in the X server to  do  this  exactly  rather
4307              than approximately with DPMS.
4308
4309       -clientdpms
4310
4311              As -forcedpms but only when VNC clients are connected.
4312
4313       -noserverdpms
4314
4315              The  UltraVNC  ServerInput  extension is supported.  This allows
4316              the VNC viewer to click a button  that  will  cause  the  server
4317              (x11vnc) to try to disable keyboard and mouse input at the phys‐
4318              ical display and put the monitor in dpms powered off state.  Use
4319              this option to skip powering off the monitor.
4320
4321       -noultraext
4322
4323              Disable  the  following  UltraVNC  extensions:  SingleWindow and
4324              ServerInput.  The others managed by LibVNCServer (textchat,  1/n
4325              scaling, rfbEncodingUltra) are not.
4326
4327       -chatwindow
4328
4329              Place  a  local  UltraVNC  chat  window  on the X11 display that
4330              x11vnc is polling.  That way the person on the  VNC  viewer-side
4331              can  chat  with  the  person  at the physical X11 console. (e.g.
4332              helpdesk w/o telephone)
4333
4334              For this to work the SSVNC package  (version  1.0.21  or  later)
4335              MUST  BE  installed  on  the  system  where  x11vnc runs and the
4336              'ssvnc' command must be available in $PATH.  The ssvncviewer  is
4337              used   as   a   chat   window   helper.    See  http://www.karl
4338              runge.com/x11vnc/ssvnc.html
4339
4340              This option implies '-rfbversion 3.6' so as  to  trick  UltraVNC
4341              viewers,  otherwise they assume chat is not available.  To spec‐
4342              ify a different  rfbversion,  place  it  after  the  -chatwindow
4343              option on the cmdline.
4344
4345              See  also  the  remote  control  'chaton' and 'chatoff' actions.
4346              These can also be set from the tkx11vnc GUI.
4347
4348       -noxdamage
4349
4350              Do not use the X DAMAGE extension to detect framebuffer  changes
4351              even  if  it  is  available.  Use -xdamage if your default is to
4352              have it off.
4353
4354              x11vnc's use of the DAMAGE extension: 1)  significantly  reduces
4355              the  load  when  the screen is not changing much, and 2) detects
4356              changed areas (small ones by default) more quickly.
4357
4358              Currently the DAMAGE extension is overly conservative and  often
4359              reports large areas (e.g. a whole terminal or browser window) as
4360              damaged even though the actual changed region  is  much  smaller
4361              (sometimes just a few pixels).  So heuristics were introduced to
4362              skip large areas and use the damage rectangles only  as  "hints"
4363              for  the  traditional  scanline  polling.   The following tuning
4364              parameters are introduced to adjust this behavior:
4365
4366       -xd_area A
4367
4368              Set the largest DAMAGE rectangle area  A  (in  pixels:  width  *
4369              height)  to trust as truly damaged: the rectangle will be copied
4370              from the framebuffer (slow) no matter  what.   Set  to  zero  to
4371              trust *all* rectangles. Default: 20000
4372
4373       -xd_mem f
4374
4375              Set  how  long  DAMAGE rectangles should be "remembered", f is a
4376              floating point number and is in units  of  the  scanline  repeat
4377              cycle  time  (32  iterations).  The default (1.0) should give no
4378              painting problems. Increase it if there are problems or decrease
4379              it to live on the edge (perhaps useful on a slow machine).
4380
4381       -sigpipe string
4382
4383              Broken  pipe  (SIGPIPE)  handling.   string  can  be "ignore" or
4384              "exit".  For "ignore" LibVNCServer will handle the  abrupt  loss
4385              of  a  client  and  continue, for "exit" x11vnc will cleanup and
4386              exit at the 1st broken connection.
4387
4388              This option is not really needed since LibVNCServer is doing the
4389              correct thing now for quite some time.  However, for convenience
4390              you  can  use  it  to  ignore  other  signals,  e.g.   "-sigpipe
4391              ignore:HUP,INT,TERM"  in case that would be useful for some sort
4392              of application.  You can also put "exit:.." in the list to  have
4393              x11vnc  cleanup  on  the  listed signals. "-sig" is an alias for
4394              this  option  if  you  don't  like  the  'pipe'.  Example:  -sig
4395              ignore:INT,TERM,exit:USR1
4396
4397       -threads, -nothreads
4398
4399              Whether  or  not  to  use  the  threaded  LibVNCServer algorithm
4400              [rfbRunEventLoop] if libpthread is available.  In this mode  new
4401              threads (one for input and one for output) are created to handle
4402              each new client.  Default: -nothreads.
4403
4404              Thread stability is much improved in version 0.9.8.
4405
4406              Multiple clients in threaded mode should be stable for the  ZRLE
4407              encoding  on  all  platforms.   The Tight and Zlib encodings are
4408              currently only stable on Linux for  multiple  clients.   Compile
4409              with  -DTLS=__thread  if your OS and compiler and linker support
4410              it.
4411
4412              For resizes (randr, etc.) set this env. var. to  the  number  of
4413              milliseconds  to  sleep:  X11VNC_THREADS_NEW_FB_SLEEP at various
4414              places in the do_new_fb() action.  This is to let various activ‐
4415              ities settle.  Default is about 500ms.
4416
4417              Multiple clients in threaded mode could yield better performance
4418              for 'class-room' broadcasting usage; also in -appshare broadcast
4419              mode.  See also the -reflect option.
4420
4421       -fs f
4422
4423              If  the  fraction  of changed tiles in a poll is greater than f,
4424              the whole screen is updated.  Default: 0.75
4425
4426       -gaps n
4427
4428              Heuristic to fill in gaps in rows or cols of n  or  less  tiles.
4429              Used to improve text paging.  Default: 4
4430
4431       -grow n
4432
4433              Heuristic  to grow islands of changed tiles n or wider by check‐
4434              ing the tile near the boundary.  Default: 3
4435
4436       -fuzz n
4437
4438              Tolerance in pixels to mark a tiles edges as changed.   Default:
4439              2
4440
4441       -debug_tiles
4442
4443              Print debugging output for tiles, fb updates, etc.
4444
4445       -snapfb
4446
4447              Instead  of  polling the X display framebuffer (fb) for changes,
4448              periodically copy all of X display fb into main memory and exam‐
4449              ine that copy for changes.  (This setting also applies for non-X
4450              -rawfb modes).   Under  some  circumstances  this  will  improve
4451              interactive response, or at least make things look smoother, but
4452              in others (most!) it will make the response worse.  If the video
4453              h/w  fb  is such that reading small tiles is very slow this mode
4454              could help.  To keep the "framerate" up the screen  size  x  bpp
4455              cannot  be  too  large.  Note that this mode is very wasteful of
4456              memory I/O resources (it makes full screen copies even if  noth‐
4457              ing  changes).   It may be of use in video capture-like applica‐
4458              tions, webcams, or where window tearing is a problem.
4459
4460       -rawfb string
4461
4462              Instead of polling  X,  poll  the  memory  object  specified  in
4463              string.
4464
4465              For   file   polling,   to   memory  map  mmap(2)  a  file  use:
4466              "map:/path/to/a/file@WxHxB", with framebuffer Width, Height, and
4467              Bits per pixel.  "mmap:..." is the same.
4468
4469              If  there  is  trouble  with  mmap,  use "file:/..."  for slower
4470              lseek(2) based reading.
4471
4472              Use "snap:..." to imply -snapfb  mode  and  the  "file:"  access
4473              (this  is for unseekable devices that only provide the fb all at
4474              once, e.g. a video camera provides the whole frame).
4475
4476              For shared memory segments string is of the form:  "shm:N@WxHxB"
4477              which specifies a shmid N and with WxHxB as above.  See shmat(1)
4478              and ipcs(1)
4479
4480              If you do not supply a type "map" is assumed if the file  exists
4481              (see the next paragraphs for some exceptions to this.)
4482
4483              If  string is "setup:cmd", then the command "cmd" is run and the
4484              first line from it is read and used as string.  This allows ini‐
4485              tializing  the  device,  determining WxHxB, etc. These are often
4486              done as root so take care.
4487
4488              If the string begins with "video", see the  VIDEO4LINUX  discus‐
4489              sion  below  where  the  device may be queried for (and possibly
4490              set) the framebuffer parameters.
4491
4492              If the string begins with "console", "/dev/fb", "fb",  or  "vt",
4493              see  the  LINUX  CONSOLE  discussion below where the framebuffer
4494              device is opened and keystrokes (and possibly mouse events)  are
4495              inserted into the console.
4496
4497              If  the  string  begins  with "vnc", see the VNC HOST discussion
4498              below where the framebuffer is taken as that of  another  remote
4499              VNC server.
4500
4501              Optional  suffixes  are ":R/G/B" and "+O" to specify red, green,
4502              and blue masks (in hex) and an offset into  the  memory  object.
4503              If  the  masks are not provided x11vnc guesses them based on the
4504              bpp (if the colors look wrong, you need to provide the masks.)
4505
4506              Another optional suffix is the Bytes  Per  Line  which  in  some
4507              cases   is   not   WxB/8.    Specify   it   as   WxHxB-BPL  e.g.
4508              800x600x16-2048.  This could be a normal width 1024 at 16bpp fb,
4509              but only width 800 shows up.
4510
4511              So the full format is: mode:file@WxHxB:R/G/B+O-BPL
4512
4513              Examples:
4514
4515              -rawfb shm:210337933@800x600x32:ff/ff00/ff0000
4516
4517              -rawfb map:/dev/fb0@1024x768x32
4518
4519              -rawfb map:/tmp/Xvfb_screen0@640x480x8+3232
4520
4521              -rawfb file:/tmp/my.pnm@250x200x24+37
4522
4523              -rawfb             file:/dev/urandom@128x128x8            -rawfb
4524              snap:/dev/video0@320x240x24 -24to32 -rawfb video0  -rawfb  video
4525              -pipeinput VID -rawfb console -rawfb vt2 -rawfb vnc:somehost:0
4526
4527              (see ipcs(1) and fbset(1) for the first two examples)
4528
4529              In  general  all  user  input  is  discarded by default (see the
4530              -pipeinput option for how to use a helper  program  to  insert).
4531              Most  of  the  X11 (screen, keyboard, mouse) options do not make
4532              sense and many will cause this mode to crash,  so  please  think
4533              twice before setting or changing them in a running x11vnc.
4534
4535              If  you DO NOT want x11vnc to close the X DISPLAY in rawfb mode,
4536              prepend a "+" e.g. +file:/dev/fb0...  Keeping the  display  open
4537              enables  the default remote-control channel, which could be use‐
4538              ful.  Alternatively, if you specify -noviewonly, then the  mouse
4539              and  keyboard  input are STILL sent to the X display, this usage
4540              should be very rare, i.e. doing something strange with /dev/fb0.
4541
4542              If the device is not "seekable" (e.g. webcam) try reading it all
4543              at  once  in  full  snaps  via the "snap:" mode (note: this is a
4544              resource hog).  If you are using file: or map:  AND  the  device
4545              needs  to be reopened for *every* snapfb snapshot, set the envi‐
4546              ronment variable: SNAPFB_RAWFB_RESET=1 as well.
4547
4548              If you want x11vnc to dynamically transform  a  24bpp  rawfb  to
4549              32bpp  (note  that  this will be slower) also supply the -24to32
4550              option.  This would be useful for,  say,  a  video  camera  that
4551              delivers  the  pixel  data  as  24bpp  packed  RGB.  This is the
4552              default under "video" mode if the bpp is 24.
4553
4554              Normally the bits per pixel, B, is 8, 16, or 32 (or rarely  24),
4555              however  there is also some support for B < 8 (e.g. old graphics
4556              displays 4 bpp or 1 bpp).  In this case you certainly must  sup‐
4557              ply  the  masks as well: WxHxB:R/G/B.  The pixels will be padded
4558              out to 8 bpp using depth 8 truecolor.  The scheme currently does
4559              not  work with snap fb (ask if interested.) B=1 monochrome exam‐
4560              ple: file:/dev/urandom@128x128x1:1/1/1 Some other like this  are
4561              128x128x2:3/3/3 128x128x4:7/7/7
4562
4563              For B < 8 framebuffers you can also set the env. var RAWFB_CGA=1
4564              to try a CGA mapping for B=4 (e.g. linux vga16fb driver.)   Note
4565              with  low bpp and/or resolution VGA and VGA16 modes on the Linux
4566              console one's attempt to export them via  x11vnc  can  often  be
4567              thwarted due to special color palettes, pixel packings, and even
4568              video painting buffering.  OTOH, often  experimenting  with  the
4569              RGB masks can yield something recognizable.
4570
4571              VIDEO4LINUX:  on  Linux  some  attempt  is  made to handle video
4572              devices (webcams or TV tuners) automatically.  The idea  is  the
4573              WxHxB  will  be  extracted from the device itself.  So if you do
4574              not supply "@WxHxB...  parameters x11vnc will try  to  determine
4575              them.   It first tries the v4l API if that support has been com‐
4576              piled in.  Otherwise it will run the v4l- info(1) external  pro‐
4577              gram if it is available.
4578
4579              The  simplest  examples  are  "-rawfb video" and "-rawfb video1"
4580              which imply the device file /dev/video and /dev/video1,  respec‐
4581              tively.   You can also supply the /dev if you like, e.g. "-rawfb
4582              /dev/video0"
4583
4584              Since the video capture device framebuffer usually changes  con‐
4585              tinuously  (e.g.  brightness  fluctuations), you may want to use
4586              the -wait, -slow_fb, or -defer options to lower the  "framerate"
4587              to cut down on network VNC traffic.
4588
4589              A more sophisticated video device scheme allows initializing the
4590              device's settings using:
4591
4592              -rawfb video:<settings>
4593
4594              The prefix could also be, as above, e.g.  "video1:"  to  specify
4595              the  device  file.   The  v4l  API must be available for this to
4596              work.  Otherwise, you will need to try to initialize the  device
4597              with  an  external  program, e.g. xawtv, spcaview, and hope they
4598              persist when x11vnc re-opens the device.
4599
4600              <settings> is a comma separated list of  key=value  pairs.   The
4601              device's brightness, color, contrast, and hue can be set to per‐
4602              centages, e.g. br=80,co=50,cn=44,hu=60.
4603
4604              The device filename can be set too if needed  (if  it  does  not
4605              start with "video"), e.g. fn=/dev/qcam.
4606
4607              The  width,  height  and  bpp of the framebuffer can be set via,
4608              e.g., w=160,h=120,bpp=16.
4609
4610              Related to the bpp above, the pixel format can be  set  via  the
4611              fmt=XXX,  where  XXX can be one of: GREY, HI240, RGB555, RGB565,
4612              RGB24, and RGB32 (with bpp 8, 8, 16,  16,  24,  and  32  respec‐
4613              tively).  See http://www.linuxtv.org for more info (V4L api).
4614
4615              For  TV/rf  tuner  cards one can set the tuning mode via tun=XXX
4616              where XXX can be one of PAL, NTSC, SECAM, or AUTO.
4617
4618              One can switch the input channel by the inp=XXX  setting,  where
4619              XXX is the name of the input channel (Television, Composite1, S-
4620              Video, etc).  Use the name that is in the information about  the
4621              device that is printed at startup.
4622
4623              For  input channels with tuners (e.g. Television) one can change
4624              which station is selected by the sta=XXX setting.   XXX  is  the
4625              station  number.   Currently  only  the ntsc-cable-us (US cable)
4626              channels are built into x11vnc.  See the -freqtab  option  below
4627              to supply one from xawtv. If XXX is greater than 500, then it is
4628              interpreted as a raw frequency in KHz.
4629
4630              Example:
4631
4632              -rawfb video:br=80,w=320,h=240,fmt=RGB32,tun=NTSC,sta=47
4633
4634              one might need to add inp=Television too for the  input  channel
4635              to be TV if the card doesn't come up by default in that one.
4636
4637              Note  that not all video capture devices will support all of the
4638              above settings.
4639
4640              See the -pipeinput VID option below for a  way  to  control  the
4641              settings  through the VNC Viewer via keystrokes.  As a shortcut,
4642              if  the  string  begins  "Video.."  instead  of  "video.."  then
4643              -pipeinput VID is implied.
4644
4645              As  above,  if  you  specify  a "@WxHxB..." after the <settings>
4646              string they are used verbatim: the device is not queried for the
4647              current values.  Otherwise the device will be queried.
4648
4649              LINUX  CONSOLE:   The  following describes some ways to view and
4650              possibly interact with the Linux text/graphics console (i.e. not
4651              X11 XFree86/Xorg)
4652
4653              Note: If the LibVNCServer LinuxVNC program is on your system you
4654              may want to use that instead of the following method because  it
4655              will  be faster and more accurate for the Linux text console and
4656              includes mouse support.  There is, however, the  basic  LinuxVNC
4657              functionality  in  x11vnc  if you replace "console" with "vt" in
4658              the examples below.
4659
4660              If the rawfb string begins with "console" the framebuffer device
4661              /dev/fb0  is  opened and /dev/tty0 is opened too.  The latter is
4662              used to inject keystrokes (not all are supported, but the  basic
4663              ones  are).   You will need to be root to inject keystrokes, but
4664              not necessarily to  open  /dev/fb0.   /dev/tty0  refers  to  the
4665              active VT, to indicate one explicitly, use, e.g., "console2" for
4666              /dev/tty2, etc. by indicating the specific VT number.
4667
4668              For the Linux framebuffer device, /dev/fb0,  (fb1,  etc)  to  be
4669              enabled  the  appropriate  kernel  drivers must be loaded.  E.g.
4670              vesafb or  vga16fb  and  also  by  setting  the  boot  parameter
4671              vga=0x301  (or  0x314,  0x317, etc.)  (The vga=... method is the
4672              preferred way; set your machines up that way.)  Otherwise  there
4673              will  be  a  ´No  such device' error.  You can also load a Linux
4674              framebuffer driver specific to your make of video card for  more
4675              functionality.   Once  the machine is booted one can often 'mod‐
4676              probe' the fb driver as root to obtain a framebuffer device.
4677
4678              If you cannot get /dev/fb0 working on Linux, try using the  Lin‐
4679              uxVNC  emulation  mode by "-rawfb vtN" where N = 1, ... 6 is the
4680              Linux Virtual Terminal (aka virtual console) you wish  to  view,
4681              e.g.  "-rawfb  vt2".   Unlike  /dev/fb  mode, it need not be the
4682              active Virtual Terminal.  Note that this mode can only show text
4683              and not graphics.  x11vnc polls the text in /dev/vcsaN
4684
4685              Set the env. var. RAWFB_VCSA_BW=1 to disable colors in the "vtN"
4686              mode (i.e. black and white only.)  If  you  do  not  prefer  the
4687              default  16bpp  set  RAWFB_VCSA_BPP  to 8 or 32.  If you need to
4688              tweak the rawfb parameters by using the  'console_guess'  string
4689              printed at startup, be sure to indicate the snap: method.
4690
4691              uinput:  If the Linux version appears to be 2.6 or later and the
4692              "uinput" module appears to be present  (modprobe  uinput),  then
4693              the  uinput  method  will  be used instead of /dev/ttyN.  uinput
4694              allows insertion of BOTH keystrokes and mouse input  and  so  it
4695              preferred when accessing graphical (e.g. QT-embedded) linux con‐
4696              sole apps.  It also provides more accurate keystroke  insertion.
4697              See  -pipeinput  UINPUT below for more information on this mode;
4698              you will have to use -pipeinput if you want to tweak any  UINPUT
4699              parameters.   You  may also want to also use the -nodragging and
4700              -cursor none options.  Use "console0", etc  or  -pipeinput  CON‐
4701              SOLE to force the /dev/ttyN method.
4702
4703              Note you can change the Linux VT remotely using the chvt(1) com‐
4704              mand to make the one you want be the active one (e.g. 'chvt 3').
4705              Sometimes  switching  out  and  back  corrects the framebuffer's
4706              graphics state.  For the "-rawfb vtN" mode there is no  need  to
4707              switch the VT's.
4708
4709              To skip input injecting entirely use "consolex" or "vtx".
4710
4711              The  string  "/dev/fb0"  (1,  etc.) can be used instead of "con‐
4712              sole".  This can be used  to  specify  a  different  framebuffer
4713              device,  e.g.  /dev/fb1.   As  a  shortcut  the  "/dev/"  can be
4714              dropped.  If  the  name  is  something  nonstandard,  use  "con‐
4715              sole:/dev/foofb"
4716
4717              If  you  do not want x11vnc to guess the framebuffer's WxHxB and
4718              masks automatically (sometimes the kernel gives incorrect infor‐
4719              mation),  specify them with a @WxHxB (and optional :R/G/B masks)
4720              at the end of the string.
4721
4722              Examples: -rawfb console -rawfb /dev/fb0           (same) -rawfb
4723              console3              (force    /dev/tty3)    -rawfb    consolex
4724              (no keystrokes or mouse) -rawfb console:/dev/nonstd -rawfb  con‐
4725              sole       -pipeinput      UINPUT:accel=4.0      -rawfb      vt3
4726              (/dev/tty3 w/o /dev/fb0)
4727
4728              VNC HOST: if the -rawfb string is of the form "vnc:host:N"  then
4729              the VNC display "N" on the remote VNC server "host" is connected
4730              to (i.e. x11vnc acts as a VNC client  itself)  and  that  frame‐
4731              buffer  is  exported.   This is the same as the option "-reflect
4732              host:N".
4733
4734              This mode is really only of use if you  are  trying  to  improve
4735              performance  in  the  case  of  many (e.g. >10) simultaneous VNC
4736              viewers, and you try a divide and conquer scheme to reduce band‐
4737              width  and  improve responsiveness.  However, another user found
4738              this mode useful to export a demo display through a  slow  link:
4739              then multiple demo viewers connected to the reflecting x11vnc on
4740              the fast side of the link, and so avoided all of the demo  view‐
4741              ers  going  through  the slow link.  Other users have found this
4742              mode useful to be able to take advantage  of  some  of  x11vnc's
4743              many  features  that  other VNC servers do not have, for example
4744              SSL encryption, single port http and https, unix  usernames  and
4745              passwords,  and -allow, -zeroconf, -clip, and -scale options and
4746              others.
4747
4748              For the classroom broadcast example, if there will be 64  simul‐
4749              taneous  VNC  viewers  this  can  lead to a lot of redundant VNC
4750              traffic to and from the server host:N, extra CPU usage, and  all
4751              viewers  response can be reduced by having to wait for writes to
4752              the slowest client to finish.  However, if you set up 8  reflec‐
4753              tors/repeaters started with option -rawfb vnc:host:N, then there
4754              are only 8 connections to host:N.  Each repeater then handles  8
4755              vnc  viewer  connections  thereby spreading the load around.  In
4756              classroom broadcast usage, try to put the repeaters on different
4757              switches.   This  mode  is the same as -reflect host:N.  Replace
4758              "host:N" by "listen" or "listen:port" for a reverse  connection.
4759              Use  "listennofork:port"  to  use  the  LibVNCServer non forking
4760              client listen interface (if your LibVNCServer has it),  same  as
4761              setting X11VNC_REFLECT_NO_FORK=1.
4762
4763              Overall  performance will not be as good as a single direct con‐
4764              nection because, among other  things,  there  is  an  additional
4765              level of framebuffer polling and pointer motion can still induce
4766              many changes per second that must be propagated.   Tip:  if  the
4767              remote  VNC  is  x11vnc  doing wireframing, or an X display that
4768              does wireframing that gives much  better  response  than  opaque
4769              window dragging.  Consider the -nodragging option if the problem
4770              is severe.
4771
4772              The env. var. X11VNC_REFLECT_PASSWORD can be set to the password
4773              needed    to   log   into   the   vnc   host   server,   or   to
4774              "file:path_to_file" to indicate a file containing  the  password
4775              as its first line.
4776
4777              To set the pixel format that x11vnc requests as a VNC CLIENT set
4778              the env. vars: X11VNC_REFLECT_bitsPerSample  X11VNC_REFLECT_sam‐
4779              plesPerPixel, and X11VNC_REFLECT_bytesPerPixel; the defaults are
4780              8, 3, 4.  2, 3, 1 would give a low color mode.  See the function
4781              rfbGetClient() in libvncclient for more info.
4782
4783              The  VNC  HOST  mode implies -shared.  Use -noshared as a subse‐
4784              quent cmdline option to disable sharing.
4785
4786       -freqtab file
4787
4788              For use with "-rawfb video" for TV tuner devices to specify sta‐
4789              tion  frequencies.   Instead of using the built in ntsc-cable-us
4790              mapping of station number to frequency, use the  data  in  file.
4791              For  stations  that  are not numeric, e.g. SE20, they are placed
4792              above the highest numbered station in the order they are  found.
4793              Example:  "-freqtab /usr/X11R6/share/xawtv/europe-west.list" You
4794              can make your own freqtab by copying the xawtv format.
4795
4796       -pipeinput cmd
4797
4798              This option lets you supply an  external  command  in  cmd  that
4799              x11vnc  will  pipe  all  of the user input events to in a simple
4800              format.  In -pipeinput mode by default x11vnc will  not  process
4801              any  of the user input events.  If you prefix cmd with "tee:" it
4802              will both send them to the pipe command and process them.  For a
4803              description   of   the  format  run  "-pipeinput  tee:/bin/cat".
4804              Another prefix is "reopen" which means  to  reopen  pipe  if  it
4805              exits.  Separate multiple prefixes with commas.
4806
4807              In  combination  with  -rawfb  one  might  be able to do amusing
4808              things (e.g. control non-X devices).   To  facilitate  this,  if
4809              -rawfb is in effect then the value is stored in X11VNC_RAWFB_STR
4810              for the pipe command to use if it wants. Do 'env | grep  X11VNC'
4811              for more.
4812
4813              Built-in pipeinput modes (no external program required):
4814
4815              If cmd is "VID" and you are using the -rawfb for a video capture
4816              device, then an internal list of keyboard mappings  is  used  to
4817              set parameters of the video.  The mappings are:
4818
4819              "B"  and  "b"  adjust  the  brightness up and down.  "H" and "h"
4820              adjust the hue.  "C" and "c" adjust the  colour.   "N"  and  "n"
4821              adjust the contrast.  "S" and "s" adjust the size of the capture
4822              screen.  "I" and "i" cycle through input channels.  Up and  Down
4823              arrows  adjust  the  station  (if  a tuner) F1, F2, ..., F6 will
4824              switch the video capture pixel format to HI240,  RGB565,  RGB24,
4825              RGB32,  RGB555,  and  GREY  respectively.   See -rawfb video for
4826              details.
4827
4828              If cmd is "CONSOLE" or "CONSOLEn" where n  is  a  Linux  console
4829              number,  then the linux console keystroke insertion to /dev/ttyN
4830              (see -rawfb console) is performed.
4831
4832              If cmd begins with "UINPUT" then the Linux uinput module is used
4833              to  insert  both keystroke and mouse events to the Linux console
4834              (see -rawfb  above).   This  usually  is  the  /dev/input/uinput
4835              device   file   (you   may   need   to  create  it  with  "mknod
4836              /dev/input/uinput c 10 223" and insert the module with "modprobe
4837              uinput".
4838
4839              The  UINPUT  mode  currently only does US keyboards (a scan code
4840              option may be added), and not all keysyms are supported.  But it
4841              is probably more accurate than the "CONSOLE" method.
4842
4843              You  may want to use the options -cursor none and -nodragging in
4844              this mode.
4845
4846              Additional  tuning   options   may   be   supplied   via:   UIN‐
4847              PUT:opt1,opt2,...  (a comma separated list). If an option begins
4848              with "/" it is taken as the uinput device file.
4849
4850              Which uinput is injected can be controlled by an  option  string
4851              made  of  the  characters  "K",  "M",  and  "B"  (see the -input
4852              option), e.g. "KM" allows keystroke and motion  but  not  button
4853              clicks.
4854
4855              A  UINPUT  option  of the form: accel=f, or accel=fx+fy sets the
4856              mouse motion "acceleration".  This is used to correct raw  mouse
4857              relative  motion  into  how  much  the  application cursor moves
4858              (x11vnc has no control over, or knowledge of how  the  windowing
4859              application  interprets  the  raw mouse motions).  Typically the
4860              acceleration for an X display is 2 (see xset "m"  option).   "f"
4861              is  a  floating point number, e.g. 3.0.  Use "fx+fy" if you need
4862              to supply different corrections for x and y.
4863
4864              Note: the default acceleration is 2.0 since it seems both X  and
4865              qt-embedded often (but not always) use this value.
4866
4867              Even  with  a  correct accel setting the mouse position will get
4868              out of sync (probably due to a mouse "threshold"  setting  where
4869              the  acceleration  doe  not  apply,  set  xset(1) ).  The option
4870              reset=N sets the number of ms (default 150) after which the cur‐
4871              sor is attempted to be reset (by forcing the mouse to (0, 0) via
4872              small increments and then back out to (x, y) in  1  jump),  This
4873              correction  seems  to be needed but can cause jerkiness or unex‐
4874              pected behavior with menus, etc.  Use reset=0 to disable.
4875
4876              If you  set  the  env.  var  X11VNC_UINPUT_THRESHOLDS  then  the
4877              thresh=n  mode  will  be  enabled.   It is currently not working
4878              well.  If |dx| <= thresh and |dy| < thresh  no  acceleration  is
4879              applied.   Use  "thresh=+n"  |dx|  +  |dy|  <  thresh to be used
4880              instead (X11?)
4881
4882              Example: -pipeinput UINPUT:accel=4.0 -cursor none
4883
4884              If the uinput device has an absolute pointer (as  opposed  to  a
4885              normal  mouse  that  is  a relative pointer) you can specify the
4886              option "abs".  Note that a touchpad on a laptop is  an  absolute
4887              device  to  some degree.  This (usually) avoids all the problems
4888              with mouse acceleration.  If x11vnc  has  trouble  deducing  the
4889              size  of  the device, use "abs=WxH".  Furthermore, if the device
4890              is a touchscreen (assumed  to  have  an  absolute  pointer)  use
4891              "touch"  or  "touch=WxH".  For touchscreens, when a mouse button
4892              is pressed, a pressure increase is injected, and when the button
4893              is released a pressure of zero is injected.
4894
4895              If touch has been set, use "touch_always=1" to indicate whenever
4896              the mouse moves with no button pressed, a touch  event  of  zero
4897              pressure should be sent anyway.  Also use "btn_touch=1" to indi‐
4898              cate a BTN_TOUCH keystroke  press  or  release  should  be  sent
4899              instead  of  a  pressure  change.   Set  "dragskip=n"  to skip n
4900              dragged mouse touches (with pressure applied)  before  injecting
4901              one.  To indicate the pressure that should be sent when there is
4902              a button click for a  touchscreen  device,  specify  pressure=n,
4903              e.g. n=5. The default is n=1.
4904
4905              If a touch screen is being used ("touch" above) and it is having
4906              its input processed by tslib, you can specify the tslib calibra‐
4907              tion     file     via     tslib_cal=<file>.      For    example,
4908              tslib_cal=/etc/pointercal.  To get accurate or even usable posi‐
4909              tioning this is required when tslib is in use.
4910
4911              The  Linux  uinput  mechanism  can be bypassed and one can write
4912              input events DIRECTLY to the devices instead.  To do this, spec‐
4913              ify  one  or  more  of  the  following  for  the  input classes:
4914              direct_rel=<device> direct_abs=<device>  direct_btn=<device>  or
4915              direct_key=<device>.   The  <device>  file  is usually something
4916              like /dev/input/event1 but you can specify any  device  file  or
4917              pipe.   You  must  specify each one of the above classes even if
4918              they correspond to the same device file  (rel/abs  and  btn  are
4919              often  the  same.)   Look at the file /proc/bus/input/devices to
4920              get an idea what is available and the device  filenames.   Note:
4921              The  /dev/input/mouse* devices do not seem to work, use the cor‐
4922              responding /dev/input/event* file instead.  Any input class  not
4923              directly specified as above will be handled via the uinput mech‐
4924              anism.  To disable creating a uinput device  (and  thereby  dis‐
4925              carding unhandled input), specify "nouinput".
4926
4927              Examples:
4928
4929              -pipeinput UINPUT:direct_abs=/dev/input/event1
4930
4931              this was used on a qtmoko Neo freerunner (armel):
4932
4933              -pipeinput               UINPUT:touch,tslib_cal=/etc/pointercal,
4934              direct_abs=/dev/input/event1,nouinput,dragskip=4
4935
4936              (where the long line has been split into two.)
4937
4938              You can set the env. var X11VNC_UINPUT_DEBUG=1 or higher to  get
4939              debugging output for UINPUT mode.
4940
4941       -macnodim
4942
4943              For the native MacOSX server, disable dimming.
4944
4945       -macnosleep
4946
4947              For the native MacOSX server, disable display sleep.
4948
4949       -macnosaver
4950
4951              For the native MacOSX server, disable screensaver.
4952
4953       -macnowait
4954
4955              For the native MacOSX server, do not wait for the user to switch
4956              back to his display.
4957
4958       -macwheel n
4959
4960              For the native MacOSX server, set the mouse  wheel  speed  to  n
4961              (default 5).
4962
4963       -macnoswap
4964
4965              For the native MacOSX server, do not swap mouse buttons 2 and 3.
4966
4967       -macnoresize
4968
4969              For  the native MacOSX server, do not resize or reset the frame‐
4970              buffer even if it is detected  that  the  screen  resolution  or
4971              depth has changed.
4972
4973       -maciconanim n
4974
4975              For  the  native MacOSX server, set n to the number of millisec‐
4976              onds that the  window  iconify/deiconify  animation  takes.   In
4977              -ncache  mode  this  value will be used to skip the animation if
4978              possible. (default 400)
4979
4980       -macmenu
4981
4982              For the native MacOSX server,  in  -ncache  client-side  caching
4983              mode,  try  to  cache  pull down menus (not perfect because they
4984              have animated fades, etc.)
4985
4986       -macuskbd
4987
4988              For the native MacOSX server, use the original keystroke  inser‐
4989              tion code based on a US keyboard.
4990
4991       -macnocglion
4992
4993              For the native MacOSX server, do not use CG interfaces added for
4994              MacOSX Lion for screen capture.
4995
4996       -macnoopengl
4997
4998              For the native MacOSX server, do not use OpenGL for screen  cap‐
4999              ture.
5000
5001       -macnorawfb
5002
5003              For  the  native  MacOSX  server, disable the raw memory address
5004              screen capture method.
5005
5006       -macdisplay n
5007
5008              For the native MacOSX server, use display 'n' as the  screen  to
5009              export.   A  macosx  display  is  a  distinct monitor or builtin
5010              screen.  The main display is  always  n=0  and  is  the  default
5011              screen  to  export.  For an extra attached monitor use n=1, etc.
5012              A list of all Available Displays is printed out  at  startup  so
5013              that  you  can find the n you want.  Notes: Currently there seem
5014              to be refresh problems with anything but the main display.   Not
5015              all of the pointer behavior is correct in the non-main displays.
5016              Usually only the main display has the menu bar (so you may  need
5017              to  run a more than one x11vnc for complete control of an appli‐
5018              cation.)
5019
5020              MORE MACOSX NOTES: There are some deprecated  MacOSX  interfaces
5021              to  inject  keyboard  and mouse events and the raw memory access
5022              method is deprecated as well (however, OpenGL will be  preferred
5023              if available because it is faster.)  One can force not using any
5024              deprecated   interfaces   at    compile    time    by    setting
5025              -DX11VNC_MACOSX_NO_DEPRECATED=1  in  CPPFLAGS.   Or to turn them
5026              off  one  by  one:  -DX11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS=1,
5027              -DX11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS=1                    or
5028              -DX11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER=1  At  run  time,  for
5029              testing  and  workarounds,  one  can disable them by using: -env
5030              X11VNC_MACOSX_NO_DEPRECATED=1    -env    X11VNC_MACOSX_NO_DEPRE‐
5031              CATED_LOCALEVENTS=1         -env         X11VNC_MACOSX_NO_DEPRE‐
5032              CATED_POSTEVENTS=1  or  -env  X11VNC_MACOSX_NO_DEPRECATED_FRAME‐
5033              BUFFER=1  Note:  When  doing either of these for the mouse input
5034              not everything works currently, e.g. double clicks and wirefram‐
5035              ing.   Also,  screen resolution and pixel depth changes will not
5036              be automatically  detected  unless  the  deprecated  framebuffer
5037              interfaces are allowed.
5038
5039              Conversely,  if  you are compiling on an older machine that does
5040              not have some of the newer interfaces, you may need  to  specify
5041              -DX11VNC_MACOSX_NO_CGEVENTCREATESCROLLWHEELEVENT
5042              -DX11VNC_MACOSX_NO_CGEVENTCREATEMOUSEEVENT                    or
5043              -DX11VNC_MACOSX_NO_CGEVENTCREATEKEYBOARDEVENT.               Use
5044              -DX11VNC_MACOSX_USE_GETMAINDEVICE to regain the very old  Quick‐
5045              Draw GetMainDevice() interface (rare...)  End of MACOSX NOTES.
5046
5047       -gui [gui-opts]
5048
5049              Start up a simple tcl/tk gui based on the remote control options
5050              -remote/-query described below.  Requires the "wish" program  to
5051              be  installed  on  the machine.  "gui-opts" is not required: the
5052              default is to start up both the full gui and x11vnc with the gui
5053              showing up on the X display in the environment variable DISPLAY.
5054
5055              "gui-opts"  can  be  a comma separated list of items.  Currently
5056              there are these types of items: 1) a gui mode, a  2)  gui  "sim‐
5057              plicity",  3)  the  X  display  the  gui should display on, 4) a
5058              "tray" or "icon" mode, and 5) a gui geometry.
5059
5060              1) The gui mode can be "start", "conn", or "wait" "start" is the
5061              default  mode  above  and  is not required.  "conn" means do not
5062              automatically start up x11vnc, but instead just try  to  connect
5063              to  an existing x11vnc process.  "wait" means just start the gui
5064              and nothing else (you will  later  instruct  the  gui  to  start
5065              x11vnc or connect to an existing one.)
5066
5067              2)  The  gui simplicity is off by default (a power-user gui with
5068              all options is presented) To start with something less  daunting
5069              supply  the  string  "simple" ("ez" is an alias for this).  Once
5070              the gui is started you can toggle between the two with "Misc  ->
5071              simple_gui".
5072
5073              3)  Note  the  possible  confusion regarding the potentially two
5074              different X displays: x11vnc polls one, but you may want the gui
5075              to  appear on another.  For example, if you ssh in and x11vnc is
5076              not running yet you may want the gui to come  back  to  you  via
5077              your ssh redirected X display (e.g. localhost:10).
5078
5079              If  you  do  not  specify a gui X display in "gui-opts" then the
5080              DISPLAY environment variable and -display option are  tried  (in
5081              that order).  Regarding the x11vnc X display the gui will try to
5082              communication with, it first tries -display  and  then  DISPLAY.
5083              For  example, "x11vnc -display :0 -gui otherhost:0", will remote
5084              control an x11vnc polling :0 and display the gui on  otherhost:0
5085              The  "tray/icon" mode below reverses this preference, preferring
5086              to display on the x11vnc display.
5087
5088              4) When "tray" or "icon" is specified, the gui  presents  itself
5089              as  a  small  icon  with  behavior typical of a "system tray" or
5090              "dock applet".  The color of the  icon  indicates  status  (con‐
5091              nected clients) and there is also a balloon status.  Clicking on
5092              the icon gives a menu from which properties, etc, can be set and
5093              the  full  gui is available under "Advanced".  To be fully func‐
5094              tional, the gui mode should be "start" (the default).
5095
5096              Note that tray or icon  mode  will  imply  the  -forever  x11vnc
5097              option  (if  the  x11vnc  server  is started along with the gui)
5098              unless -connect or  -connect_or_exit  has  been  specified.   So
5099              x11vnc  (and  the  tray/icon gui) will wait for more connections
5100              after the first client disconnects.  If you want only one viewer
5101              connection include the -once option.
5102
5103              For  "icon"  the gui just a small standalone window.  For "tray"
5104              it will attempt to embed itself in the "system tray"  if  possi‐
5105              ble. If "=setpass" is appended then at startup the X11 user will
5106              be prompted to set the VNC session password.  If =<hexnumber> is
5107              appended  that  icon  will attempt to embed itself in the window
5108              given by hexnumber.  Use =noadvanced to disable  the  full  gui.
5109              (To supply more than one, use "+" sign).  E.g. -gui tray=setpass
5110              and -gui icon=0x3600028
5111
5112              Other modes: "full", the default  and  need  not  be  specified.
5113              "-gui none", do not show a gui, useful to override a ~/.x11vncrc
5114              setting, etc.
5115
5116              5) When "geom=+X+Y" is specified, that geometry is passed to the
5117              gui  toplevel.   This is the icon in icon/tray mode, or the full
5118              gui otherwise.  You can also  specify  width  and  height,  i.e.
5119              WxH+X+Y, but it is not recommended.  In "tray" mode the geometry
5120              is ignored unless the system tray manager does not  seem  to  be
5121              running.    One   could   imagine  using  something  like  "-gui
5122              tray,geom=+4000+4000" with a display manager  to  keep  the  gui
5123              invisible until someone logs in...
5124
5125              More icon tricks, "icon=minimal" gives an icon just with the VNC
5126              display number.  You can also set the font with  "iconfont=...".
5127              The   following   could   be  useful:  "-gui  icon=minimal,icon‐
5128              font=5x8,geom=24x10+0-0"
5129
5130              General examples of the -gui option: "x11vnc -gui", "x11vnc -gui
5131              ez"  "x11vnc  -gui  localhost:10",  "x11vnc  -gui  conn,host:0",
5132              "x11vnc -gui tray,ez" "x11vnc -gui tray=setpass"
5133
5134              If you do not intend to start x11vnc from  the  gui  (i.e.  just
5135              remote control an existing one), then the gui process can run on
5136              a different machine from the x11vnc server as long as X  permis‐
5137              sions, etc. permit communication between the two.
5138
5139              FONTS: On some systems the tk fonts can be too small, jagged, or
5140              otherwise unreadable.  There are 4 env vars you can  set  to  be
5141              the tk font you prefer:
5142
5143              X11VNC_FONT_BOLD      main   font   for   menus   and   buttons.
5144              X11VNC_FONT_FIXED  font for fixed width text.
5145
5146              X11VNC_FONT_BOLD_SMALL  tray icon  font.   X11VNC_FONT_REG_SMALL
5147              tray icon menu font.
5148
5149              The last two only apply for the tray icon mode.
5150
5151              Here are some examples:
5152
5153              -env      X11VNC_FONT_BOLD='Helvetica     -16     bold'     -env
5154              X11VNC_FONT_FIXED='Courier -14' -env X11VNC_FONT_REG_SMALL='Hel‐
5155              vetica -12'
5156
5157              You  can  put  the  lines like the above (without the quotes) in
5158              your ~/.x11vncrc file to avoid having to  specify  them  on  the
5159              x11vnc command line.
5160
5161              Sometimes there are problems when the gui asks x11vnc to use the
5162              identd (port 113) service to try to get the  names  of  attached
5163              users.  To  disable  trying to connect to the viewer machines to
5164              identify the user's names, set -env X11VNC_NO_IDENT_USERNAME=1
5165
5166       -remote command
5167
5168              Remotely control some  aspects  of  an  already  running  x11vnc
5169              server.   "-R"  and  "-r"  are aliases for "-remote".  After the
5170              remote control command is sent to the running server the 'x11vnc
5171              -remote  ...'   x11vnc  command  exits.   You  can often use the
5172              -query command (see below) to see if the x11vnc server processed
5173              your -remote command.
5174
5175              The  default  communication  channel  is  that  of  X properties
5176              (specifically X11VNC_REMOTE), and so this command  must  be  run
5177              with  correct  settings  for  DISPLAY and possibly XAUTHORITY to
5178              connect to the X server and set  the  property.   Alternatively,
5179              use  the  -display  and -auth options to set them to the correct
5180              values.  The running server cannot use the -novncconnect  option
5181              because  that disables the communication channel.  See below for
5182              alternate channels.
5183
5184              For example: 'x11vnc -remote stop' (which is the same as ´x11vnc
5185              -R stop') will close down the x11vnc server.  ´x11vnc -R shared'
5186              will enable shared connections, and ´x11vnc -R  scale:3/4'  will
5187              rescale the desktop.
5188
5189              To use a different name for the X11 property (e.g. to have sepa‐
5190              rate communication channels for multiple x11vnc's  on  the  same
5191              display)  set  the  X11VNC_REMOTE  environment  variable  to the
5192              string       you       want,       for       example:       -env
5193              X11VNC_REMOTE=X11VNC_REMOTE_12345 Both sides of the channel must
5194              use the same unique name.
5195
5196              To run a bunch of commands in a  sequence  use  something  like:
5197              x11vnc -R 'script:firstcmd;secondcmd;...'
5198
5199              Use  x11vnc -R script:file=/path/to/file to read commands from a
5200              file (can be multi-line and use the comment '#' character in the
5201              normal  way.   The  ';' separator must still be used to separate
5202              each command.)
5203
5204              To not try to contact another x11vnc process  and  instead  just
5205              run the command (or query) directly, prefix the command with the
5206              string "DIRECT:"
5207
5208              The following -remote/-R commands are supported:
5209
5210              stop            terminate the server, same as "quit"  "exit"  or
5211              "shutdown".
5212
5213              ping             see  if the x11vnc server responds.  return is:
5214              ans=ping:<display>
5215
5216              ping:mystring   as  above,  but  use  your  own  unique  string.
5217              return is: ans=ping:mystring:<xdisplay>
5218
5219              blacken          try  to  push  a black fb update to all clients
5220              (due to timings a client could miss it). Same  as  "zero",  also
5221              "zero:x1,y1,x2,y2" for a rectangle.
5222
5223              refresh         send the entire fb to all clients.
5224
5225              reset           recreate the fb, polling memory, etc.
5226
5227              id:windowid     set -id window to "windowid". empty or "root" to
5228              go back to root window
5229
5230              sid:windowid    set -sid window to "windowid"
5231
5232              id_cmd:cmd       cmds:  raise,  lower,  map,   unmap,   iconify,
5233              move:dXdY,  resize:dWdH,  geom:WxH+X+Y.  dX  dY, dW, and dH must
5234              have a leading "+" or "-" e.g.: move:-30+10 resize:+20+35  also:
5235              wm_delete,    wm_name:string    and    icon_name:string.    Also
5236              id_cmd:win=N:cmd
5237
5238              waitmapped      wait until subwin is mapped.
5239
5240              nowaitmapped    do not wait until subwin is mapped.
5241
5242              clip:WxH+X+Y    set -clip mode to "WxH+X+Y"
5243
5244              flashcmap       enable  -flashcmap mode.
5245
5246              noflashcmap     disable -flashcmap mode.
5247
5248              shiftcmap:n     set -shiftcmap to n.
5249
5250              notruecolor     enable  -notruecolor mode.
5251
5252              truecolor       disable -notruecolor mode.
5253
5254              overlay         enable  -overlay mode (if applicable).
5255
5256              nooverlay       disable -overlay mode.
5257
5258              overlay_cursor  in -overlay mode, enable cursor drawing.
5259
5260              overlay_nocursor disable cursor drawing. same as  nooverlay_cur‐
5261              sor.
5262
5263              8to24           enable  -8to24 mode (if applicable).
5264
5265              no8to24         disable -8to24 mode.
5266
5267              8to24_opts:str  set the -8to24 opts to "str".
5268
5269              24to32          enable  -24to32 mode (if applicable).
5270
5271              no24to32        disable -24to32 mode.
5272
5273              visual:vis      set -visual to "vis"
5274
5275              scale:frac      set -scale to "frac"
5276
5277              scale_cursor:f  set -scale_cursor to "f"
5278
5279              viewonly        enable  -viewonly mode.
5280
5281              noviewonly      disable -viewonly mode.
5282
5283              shared          enable  -shared mode.
5284
5285              noshared        disable -shared mode.
5286
5287              forever         enable  -forever mode.
5288
5289              noforever       disable -forever mode.
5290
5291              timeout:n        reset  -timeout to n, if there are currently no
5292              clients, exit unless one connects in the next n secs.
5293
5294              tightfilexfer   enable  filetransfer for NEW clients.
5295
5296              notightfilexfer disable filetransfer for NEW clients.
5297
5298              ultrafilexfer   enable  filetransfer for clients.
5299
5300              noultrafilexfer disable filetransfer for clients.
5301
5302              rfbversion:n.m  set -rfbversion for new clients.
5303
5304              http            enable  http client connections.
5305
5306              nohttp          disable http client connections.
5307
5308              deny            deny any new connections, same as "lock"
5309
5310              nodeny          allow new connections, same as "unlock"
5311
5312              avahi           enable  avahi service advertising.
5313
5314              noavahi         disable avahi service advertising.
5315
5316              mdns            enable  avahi service advertising.
5317
5318              nomdns          disable avahi service advertising.
5319
5320              zeroconf        enable  avahi service advertising.
5321
5322              nozeroconf      disable avahi service advertising.
5323
5324              connect:host    do reverse connection to host, "host" may  be  a
5325              comma  separated  list  of  hosts  or host:ports.  See -connect.
5326              Passwords   required   as    with    fwd    connections.     See
5327              X11VNC_REVERSE_CONNECTION_NO_AUTH=1
5328
5329              disconnect:host  disconnect  any  clients  from  "host"  same as
5330              "close:host".  Use host "all" to close all current clients.   If
5331              you  know  the  client  internal  hex  ID, e.g. 0x3 (returned by
5332              "-query clients" and RFB_CLIENT_ID) you can use that too.
5333
5334              proxy:host:port set reverse connection proxy (empty to disable).
5335
5336              allowonce:host  For the next connection only,  allow  connection
5337              from  "host".  In  -ssl  mode  two connections are allowed (i.e.
5338              Fetch Cert) unless X11VNC_NO_SSL_ALLOW_TWICE=1
5339
5340              allow:hostlist  set -allow list to (comma separated) "hostlist".
5341              See -allow and -localhost.  Do not use with -allow /path/to/file
5342              Use "+host" to add a single host, and use "-host"  to  delete  a
5343              single host
5344
5345              localhost       enable  -localhost mode
5346
5347              nolocalhost     disable -localhost mode
5348
5349              listen:str      set -listen to str, empty to disable.
5350
5351              noipv6          enable  -noipv6 mode.
5352
5353              ipv6            disable -noipv6 mode.
5354
5355              noipv4          enable  -noipv4 mode.
5356
5357              ipv4            disable -noipv4 mode.
5358
5359              6               enable  -6 IPv6 listening mode.
5360
5361              no6             disable -6 IPv6 listening mode.
5362
5363              lookup          disable -nolookup mode.
5364
5365              nolookup        enable  -nolookup mode.
5366
5367              lookup          disable -nolookup mode.
5368
5369              input:str       set -input to "str", empty to disable.
5370
5371              grabkbd         enable  -grabkbd mode.
5372
5373              nograbkbd       disable -grabkbd mode.
5374
5375              grabptr         enable  -grabptr mode.
5376
5377              nograbptr       disable -grabptr mode.
5378
5379              grabalways      enable  -grabalways mode.
5380
5381              nograbalways    disable -grabalways mode.
5382
5383              grablocal:n     set -grablocal to n.
5384
5385              client_input:str  set  the K, M, B -input on a per-client basis.
5386              select which client as for disconnect, e.g. client_input:host:MB
5387              or client_input:0x2:K
5388
5389              accept:cmd      set -accept "cmd" (empty to disable).
5390
5391              afteraccept:cmd set -afteraccept (empty to disable).
5392
5393              gone:cmd        set -gone "cmd" (empty to disable).
5394
5395              noshm           enable  -noshm mode.
5396
5397              shm             disable -noshm mode (i.e. use shm).
5398
5399              flipbyteorder    enable -flipbyteorder mode, you may need to set
5400              noshm for this to do something.
5401
5402              noflipbyteorder disable -flipbyteorder mode.
5403
5404              onetile         enable  -onetile mode. (you may need to set  shm
5405              for this to do something)
5406
5407              noonetile       disable -onetile mode.
5408
5409              solid           enable  -solid mode
5410
5411              nosolid         disable -solid mode.
5412
5413              solid_color:color set -solid color (and apply it).
5414
5415              blackout:str     set  -blackout  "str"  (empty to disable).  See
5416              -blackout for the form of "str"  (basically:  WxH+X+Y,...)   Use
5417              "+WxH+X+Y" to append a single rectangle use "-WxH+X+Y" to delete
5418              one
5419
5420              xinerama        enable  -xinerama mode. (if applicable)
5421
5422              noxinerama      disable -xinerama mode.
5423
5424              xtrap           enable  -xtrap input mode(if applicable)
5425
5426              noxtrap         disable -xtrap input mode.
5427
5428              xrandr          enable  -xrandr mode. (if applicable)
5429
5430              noxrandr        disable -xrandr mode.
5431
5432              xrandr_mode:mode set the -xrandr mode to "mode".
5433
5434              rotate:mode     set the -rotate mode to "mode".
5435
5436              padgeom:WxH     set -padgeom to WxH (empty to disable) If WxH is
5437              "force" or "do" the padded geometry fb is immediately applied.
5438
5439              quiet           enable  -quiet mode.
5440
5441              noquiet         disable -quiet mode.
5442
5443              modtweak        enable  -modtweak mode.
5444
5445              nomodtweak      enable  -nomodtweak mode.
5446
5447              xkb             enable  -xkb modtweak mode.
5448
5449              noxkb           disable -xkb modtweak mode.
5450
5451              capslock        enable  -capslock mode.
5452
5453              nocapslock      disable -capslock mode.
5454
5455              skip_lockkeys   enable  -skip_lockkeys mode.
5456
5457              noskip_lockkeys disable -skip_lockkeys mode.
5458
5459              skip_keycodes:str enable -xkb -skip_keycodes "str".
5460
5461              sloppy_keys     enable  -sloppy_keys mode.
5462
5463              nosloppy_keys   disable -sloppy_keys mode.
5464
5465              skip_dups       enable  -skip_dups mode.
5466
5467              noskip_dups     disable -skip_dups mode.
5468
5469              add_keysyms     enable -add_keysyms mode.
5470
5471              noadd_keysyms    stop  adding keysyms. those added will still be
5472              removed at exit.
5473
5474              clear_mods      enable  -clear_mods mode and clear them.
5475
5476              noclear_mods    disable -clear_mods mode.
5477
5478              clear_keys      enable  -clear_keys mode and clear them.
5479
5480              noclear_keys    disable -clear_keys mode.
5481
5482              clear_locks     do the clear_locks action.
5483
5484              clear_all       do the clear_all action.
5485
5486              keystate        have x11vnc print current keystate.
5487
5488              remap:str       set -remap "str" (empty to disable).  See -remap
5489              for  the form of "str" (basically: key1-key2,key3-key4,...)  Use
5490              "+key1-key2" to append a single keymapping, use "-key1-key2"  to
5491              delete.
5492
5493              norepeat        enable  -norepeat mode.
5494
5495              repeat          disable -norepeat mode.
5496
5497              nofb            enable  -nofb mode.
5498
5499              fb              disable -nofb mode.
5500
5501              bell            enable  bell (if supported).
5502
5503              nobell          disable bell.
5504
5505              sendbell        ring the bell now.
5506
5507              nosel           enable  -nosel mode.
5508
5509              sel             disable -nosel mode.
5510
5511              noprimary       enable  -noprimary mode.
5512
5513              primary         disable -noprimary mode.
5514
5515              nosetprimary    enable  -nosetprimary mode.
5516
5517              setprimary      disable -nosetprimary mode.
5518
5519              noclipboard     enable  -noclipboard mode.
5520
5521              clipboard       disable -noclipboard mode.
5522
5523              nosetclipboard  enable  -nosetclipboard mode.
5524
5525              setclipboard    disable -nosetclipboard mode.
5526
5527              seldir:str      set -seldir to "str"
5528
5529              resend_cutbuffer resend the most recent CUTBUFFER0 copy
5530
5531              resend_clipboard resend the most recent CLIPBOARD copy
5532
5533              resend_primary   resend the most recent PRIMARY copy
5534
5535              cursor:mode     enable  -cursor "mode".
5536
5537              show_cursor     enable  showing a cursor.
5538
5539              noshow_cursor   disable showing a cursor. (same as "nocursor")
5540
5541              cursor_drag     enable  cursor changes during drag.
5542
5543              nocursor_drag   disable cursor changes during drag.
5544
5545              arrow:n         set -arrow to alternate n.
5546
5547              xfixes          enable  xfixes cursor shape mode.
5548
5549              noxfixes        disable xfixes cursor shape mode.
5550
5551              alphacut:n      set -alphacut to n.
5552
5553              alphafrac:f     set -alphafrac to f.
5554
5555              alpharemove     enable  -alpharemove mode.
5556
5557              noalpharemove   disable -alpharemove mode.
5558
5559              alphablend      disable -noalphablend mode.
5560
5561              noalphablend    enable  -noalphablend mode.
5562
5563              cursorshape     disable -nocursorshape mode.
5564
5565              nocursorshape   enable  -nocursorshape mode.
5566
5567              cursorpos       disable -nocursorpos mode.
5568
5569              nocursorpos     enable  -nocursorpos mode.
5570
5571              xwarp           enable  -xwarppointer mode.
5572
5573              noxwarp         disable -xwarppointer mode.
5574
5575              always_inject   enable  -always_inject mode.
5576
5577              noalways_inject disable -always_inject mode.
5578
5579              buttonmap:str   set -buttonmap "str", empty to disable
5580
5581              dragging        disable -nodragging mode.
5582
5583              nodragging      enable  -nodragging mode.
5584
5585              ncache          reenable -ncache mode.
5586
5587              noncache        disable  -ncache mode.
5588
5589              ncache_size:n   set -ncache size to n.
5590
5591              ncache_cr       enable  -ncache_cr mode.
5592
5593              noncache_cr     disable -ncache_cr mode.
5594
5595              ncache_no_moveraise     enable  no_moveraise mode.
5596
5597              noncache_no_moveraise   disable no_moveraise mode.
5598
5599              ncache_no_dtchange      enable  ncache_no_dtchange mode.
5600
5601              noncache_no_dtchange    disable ncache_no_dtchange mode.
5602
5603              ncache_old_wm           enable  ncache_old_wm mode.
5604
5605              noncache_old_wm         disable ncache_old_wm mode.
5606
5607              ncache_no_rootpixmap    enable  ncache_no_rootpixmap.
5608
5609              noncache_no_rootpixmap  disable ncache_no_rootpixmap.
5610
5611              ncache_reset_rootpixmap recheck the root pixmap, ncrp
5612
5613              ncache_keep_anims       enable  ncache_keep_anims.
5614
5615              noncache_keep_anims     disable ncache_keep_anims.
5616
5617              ncache_pad:n    set -ncache_pad to n.
5618
5619              wireframe       enable  -wireframe mode. same as "wf"
5620
5621              nowireframe     disable -wireframe mode. same as "nowf"
5622
5623              wireframe:str   enable  -wireframe mode string.
5624
5625              wireframe_mode:str enable  -wireframe mode string.
5626
5627              wireframelocal  enable  wireframelocal. same as "wfl"
5628
5629              nowireframe     disable wireframelocal. same as "nowfl"
5630
5631              wirecopyrect:str set -wirecopyrect string. same as "wcr:"
5632
5633              scrollcopyrect:str set -scrollcopyrect string. same "scr"
5634
5635              noscrollcopyrect disable -scrollcopyrect__mode_. "noscr"
5636
5637              scr_area:n      set -scr_area to n
5638
5639              scr_skip:list   set -scr_skip to "list"
5640
5641              scr_inc:list    set -scr_inc to "list"
5642
5643              scr_keys:list   set -scr_keys to "list"
5644
5645              scr_term:list   set -scr_term to "list"
5646
5647              scr_keyrepeat:str set -scr_keyrepeat to "str"
5648
5649              scr_parms:str   set -scr_parms parameters.
5650
5651              fixscreen:str   set -fixscreen to "str".
5652
5653              noxrecord       disable all use of RECORD extension.
5654
5655              xrecord         enable  use of RECORD extension.
5656
5657              reset_record    reset RECORD extension (if avail.)
5658
5659              pointer_mode:n  set -pointer_mode to n. same as "pm"
5660
5661              input_skip:n    set -input_skip to n.
5662
5663              allinput        enable  use of -allinput mode.
5664
5665              noallinput      disable use of -allinput mode.
5666
5667              input_eagerly   enable  use of -input_eagerly mode.
5668
5669              noinput_eagerly disable use of -input_eagerly mode.
5670
5671              ssltimeout:n    set -ssltimeout to n.
5672
5673              speeds:str      set -speeds to str.
5674
5675              wmdt:str        set -wmdt to str.
5676
5677              debug_pointer   enable  -debug_pointer, same as "dp"
5678
5679              nodebug_pointer disable -debug_pointer, same as "nodp"
5680
5681              debug_keyboard   enable  -debug_keyboard, same as "dk"
5682
5683              nodebug_keyboard disable -debug_keyboard, same as "nodk"
5684
5685              keycode:n       inject keystroke 'keycode' (xmodmap -pk)
5686
5687              keycode:n,down  inject 'keycode' (down=0,1)
5688
5689              keysym:str      inject keystroke 'keysym' (number/name)
5690
5691              keysym:str,down inject 'keysym' (down=0,1)
5692
5693              ptr:x,y,mask    inject pointer event x, y, button-mask
5694
5695              fakebuttonevent:button,down direct XTestFakeButtonEvent.
5696
5697              sleep:t         sleep floating point time t.
5698
5699              get_xprop:p     get X property named 'p'.
5700
5701              set_xprop:p:val  set  X  property  named  'p'  to  'val'.   p ->
5702              id=NNN:p for hex/dec window id.
5703
5704              wininfo:id      get info about X window id.  use 'root' for root
5705              window, use +id for children.
5706
5707              grab_state      get state of pointer and keyboard grab.
5708
5709              pointer_pos     print XQueryPointer x,y cursor position.
5710
5711              pointer_x       print XQueryPointer x cursor position.
5712
5713              pointer_y       print XQueryPointer y cursor position.
5714
5715              pointer_same    print XQueryPointer ptr on same screen.
5716
5717              pointer_root    print XQueryPointer curr ptr rootwin.
5718
5719              pointer_mask    print XQueryPointer button and mods mask
5720
5721              mouse_x         print x11vnc's idea of cursor position.
5722
5723              mouse_y         print x11vnc's idea of cursor position.
5724
5725              noop            do nothing.
5726
5727              defer:n         set -defer to n ms,same as deferupdate:n
5728
5729              wait:n          set -wait to n ms.
5730
5731              extra_fbur:n    set -extra_fbur to n.
5732
5733              wait_ui:f       set -wait_ui factor to f.
5734
5735              setdefer:n      set -setdefer to -2,-1,0,1, or 2.
5736
5737              wait_bog        disable -nowait_bog mode.
5738
5739              nowait_bog      enable  -nowait_bog mode.
5740
5741              slow_fb:f       set -slow_fb to f seconds.
5742
5743              xrefresh:f      set -xrefresh to f seconds.
5744
5745              readtimeout:n   set read timeout to n seconds.
5746
5747              nap             enable  -nap mode.
5748
5749              nonap           disable -nap mode.
5750
5751              sb:n            set -sb to n s, same as screen_blank:n
5752
5753              fbpm            disable -nofbpm mode.
5754
5755              nofbpm          enable  -nofbpm mode.
5756
5757              dpms            disable -nodpms mode.
5758
5759              nodpms          enable  -nodpms mode.
5760
5761              forcedpms       enable  -forcedpms mode.
5762
5763              noforcedpms     disable -forcedpms mode.
5764
5765              clientdpms      enable  -clientdpms mode.
5766
5767              noclientdpms    disable -clientdpms mode.
5768
5769              noserverdpms    enable  -noserverdpms mode.
5770
5771              serverdpms      disable -noserverdpms mode.
5772
5773              noultraext      enable  -noultraext mode.
5774
5775              ultraext        disable -noultraext mode.
5776
5777              chatwindow      enable  local chatwindow mode.
5778
5779              nochatwindow    disable local chatwindow mode.
5780
5781              chaton          begin chat using local window.
5782
5783              chatoff         end   chat using local window.
5784
5785              xdamage         enable  xdamage polling hints.
5786
5787              noxdamage       disable xdamage polling hints.
5788
5789              xd_area:A       set -xd_area max pixel area to "A"
5790
5791              xd_mem:f        set -xd_mem remembrance to "f"
5792
5793              fs:frac         set -fs fraction to "frac", e.g. 0.5
5794
5795              gaps:n          set -gaps to n.
5796
5797              grow:n          set -grow to n.
5798
5799              fuzz:n          set -fuzz to n.
5800
5801              snapfb          enable  -snapfb mode.
5802
5803              nosnapfb        disable -snapfb mode.
5804
5805              rawfb:str       set -rawfb mode to "str".
5806
5807              uinput_accel:f  set uinput_accel to f.
5808
5809              uinput_thresh:n set uinput_thresh to n.
5810
5811              uinput_reset:n  set uinput_reset to n ms.
5812
5813              uinput_always:n set uinput_always to 1/0.
5814
5815              progressive:n     set  LibVNCServer  -progressive  slice  height
5816              parameter to n.
5817
5818              desktop:str     set -desktop name to str for new clients.
5819
5820              rfbport:n       set -rfbport to n.
5821
5822              macnosaver      enable  -macnosaver mode.
5823
5824              macsaver        disable -macnosaver mode.
5825
5826              macnowait       enable  -macnowait  mode.
5827
5828              macwait         disable -macnowait  mode.
5829
5830              macwheel:n      set -macwheel to n.
5831
5832              macnoswap       enable  -macnoswap mouse button mode.
5833
5834              macswap         disable -macnoswap mouse button mode.
5835
5836              macnoresize     enable  -macnoresize mode.
5837
5838              macresize       disable -macnoresize mode.
5839
5840              maciconanim:n   set -maciconanim to n.
5841
5842              macmenu         enable  -macmenu  mode.
5843
5844              macnomenu       disable -macmenu  mode.
5845
5846              macuskbd        enable  -macuskbd mode.
5847
5848              macnouskbd      disable -macuskbd mode.
5849
5850              httpport:n      set -httpport to n.
5851
5852              httpdir:dir     set -httpdir to dir (and enable http).
5853
5854              enablehttpproxy   enable  -enablehttpproxy mode.
5855
5856              noenablehttpproxy disable -enablehttpproxy mode.
5857
5858              alwaysshared     enable  -alwaysshared mode.
5859
5860              noalwaysshared   disable  -alwaysshared  mode.   (may  interfere
5861              with other options)
5862
5863              nevershared      enable  -nevershared mode.
5864
5865              nonevershared    disable -nevershared mode.  (may interfere with
5866              other options)
5867
5868              dontdisconnect   enable  -dontdisconnect mode.
5869
5870              nodontdisconnect disable -dontdisconnect mode.   (may  interfere
5871              with other options)
5872
5873              debug_xevents   enable  debugging X events.
5874
5875              nodebug_xevents disable debugging X events.
5876
5877              debug_xdamage   enable  debugging X DAMAGE mechanism.
5878
5879              nodebug_xdamage disable debugging X DAMAGE mechanism.
5880
5881              debug_wireframe enable   debugging wireframe mechanism.
5882
5883              nodebug_wireframe disable debugging wireframe mechanism.
5884
5885              debug_scroll    enable  debugging scrollcopy mechanism.
5886
5887              nodebug_scroll  disable debugging scrollcopy mechanism.
5888
5889              debug_tiles     enable  -debug_tiles
5890
5891              nodebug_tiles   disable -debug_tiles
5892
5893              debug_grabs     enable  -debug_grabs
5894
5895              nodebug_grabs   disable -debug_grabs
5896
5897              debug_sel       enable  -debug_sel
5898
5899              nodebug_sel     disable -debug_sel
5900
5901              debug_ncache    enable  -debug_ncache
5902
5903              nodebug_ncache  disable -debug_ncache
5904
5905              dbg             enable  -dbg crash shell
5906
5907              nodbg           disable -dbg crash shell
5908
5909              noremote         disable the -remote command processing, it can‐
5910              not be turned back on.
5911
5912              bcx_xattach:str  This remote control command is for use with the
5913              BARCO  xattach  program  or the x2x program.  Both of these pro‐
5914              grams are for 'pointer and keyboard' sharing between separate  X
5915              displays.   In general the two displays are usually nearby, e.g.
5916              on the same desk, and this allows the user  to  share  a  single
5917              pointer  and keyboard between them.  The user moves the mouse to
5918              an edge and then the mouse pointer  appears  to  'jump'  to  the
5919              other  display  screen.  Thus it emulates what a single X server
5920              would do for two screens (e.g. :0.0 and :0.1) The illusion of  a
5921              single  Xserver  with multiple screens is achieved by forwarding
5922              events to the 2nd one via the XTEST extension.
5923
5924              What the x11vnc bcx_xattach command  does  is  to  perform  some
5925              pointer  movements to try to INDUCE xattach/x2x to 'jump' to the
5926              other display.  In what follows the ´master' display  refers  to
5927              the  one  that when it has ´focus' it is basically doing nothing
5928              besides watching for the mouse to go over an edge.  The  'slave'
5929              display  refers  to  the  one to which the mouse and keyboard is
5930              redirected to once an edge in the master has been crossed.  Note
5931              that  the  x11vnc  executing the bcx_xattach command MUST be the
5932              one connected to the *master* display.
5933
5934              Also note that when input is being redirected (via  XTEST)  from
5935              the  master  display  to the slave display, the master display's
5936              pointer and keyboard are *grabbed* by xattach/x2x.   x11vnc  can
5937              use  this  info  to verify that the master/slave mode change has
5938              taken place correctly.  If you  specify  the  "ifneeded"  option
5939              (see  below)  and  the initial grab state is that of the desired
5940              final  state,  then  no  pointer  movements  are  injected   and
5941              "DONE,GRAB_OK" is returned.
5942
5943              "str"  must  contain  one of "up", "down", "left", or "right" to
5944              indicate the direction of the 'jump'.  "str" must  also  contain
5945              one  of  "master_to_slave"  or "slave_to_master" to indicate the
5946              type of mode change induced by the jump.  Use "M2S" and "S2M" as
5947              shorter aliases.
5948
5949              "str"  may be a "+" separated list of additional tuning options.
5950              The "shift=n" option indicates an  offset  shift  position  away
5951              from  (0,0) (default 20).  "final=x+y" specifies the final posi‐
5952              tion of the cursor at the  end  of  the  normal  move  sequence;
5953              default  30+30.   "extra_move=x+y"  means to do one more pointer
5954              move after "final" to x+y.  "dt=n" sets the sleep time  in  mil‐
5955              liseconds between pointer moves (default: 40ms) "retry=n" speci‐
5956              fies the maximum number of retries  if  the  grab  state  change
5957              fails.  "ifneeded"  means  to not apply the pointer movements if
5958              the initial grab state is  that  of  the  desired  final  state.
5959              "nograbcheck"  means  to  not check if the grab state changed as
5960              expected and only apply the pointer  movements  (default  is  to
5961              check the grab states.)
5962
5963              If you do not specify "up", etc., to bcx_xattach nothing will be
5964              attempted and the  command  returns  the  string  FAIL,NO_DIREC‐
5965              TION_SPECIFIED.   If  you  do  not  specify "master_to_slave" or
5966              "M2S", etc., to bcx_xattach nothing will be  attempted  and  the
5967              command returns the string FAIL,NO_MODE_CHANGE_SPECIFIED.
5968
5969              Otherwise,  the returned string will contain "DONE".  It will be
5970              "DONE,GRAB_OK" if the grab state  changed  as  expected  (or  if
5971              "ifneeded"  was  supplied and the initial grab state was already
5972              the desired one.)  If the initial grab state was incorrect,  but
5973              the    final    grab    state    was    correct   then   it   is
5974              "DONE,GRAB_FAIL_INIT".  If the initial grab state  was  correct,
5975              but   the   final   grab   state   was   incorrect  then  it  is
5976              "DONE,GRAB_FAIL_FINAL".   If  both  are  incorrect  it  will  be
5977              "DONE,GRAB_FAIL".   Under  grab  failure the string will be fol‐
5978              lowed by  ":p1,k1-p2,k2"  where   p1,k1  indicates  the  initial
5979              pointer  and  keyboard  grab states and p2,k2 the final ones. If
5980              GRAB_FAIL or GRAB_FAIL_FINAL occurs, the action will be  retried
5981              up  to  3  times;  trying  to reset the state and sleeping a bit
5982              between each try.  Set retry=n to adjust the number of  retries,
5983              zero to disable retries.
5984
5985              Examples:   -R  bcx_xattach:down+M2S  -R  bcx_xattach:up+S2M  -R
5986              bcx_xattach:up+S2M+nograbcheck+dt=30         -R         bcx_xat‐
5987              tach:down+M2S+extra_move=100+100
5988
5989              or use -Q instead of -R to retrieve the result text.
5990
5991              End of the bcx_xattach:str description.
5992
5993              The  vncconnect(1)  command  from standard VNC distributions may
5994              also be used if string is prefixed with "cmd=" E.g.  'vncconnect
5995              cmd=stop'.   Under  some  circumstances  xprop(1) can used if it
5996              supports -set (see the FAQ).
5997
5998              If "-connect /path/to/file" has been  supplied  to  the  running
5999              x11vnc  server  then  that  file  can be used as a communication
6000              channel (this is the only way to  remote  control  one  of  many
6001              x11vnc's  polling  the same X display) Simply run: 'x11vnc -con‐
6002              nect /path/to/file -remote ...'  or you can  directly  write  to
6003              the  file  via  something like: "echo cmd=stop > /path/to/file",
6004              etc.
6005
6006       -query variable
6007
6008              Like -remote, except just query the value of variable.  "-Q"  is
6009              an alias for "-query".  Multiple queries can be done by separat‐
6010              ing variables by commas, e.g. -query var1,var2. The results come
6011              back  in  the  form  ans=var1:value1,ans=var2:value2,...  to the
6012              standard output.  If a variable is read-only, it comes back with
6013              prefix "aro=" instead of "ans=".
6014
6015              Some -remote commands are pure actions that do not make sense as
6016              variables, e.g. "stop" or "disconnect", in these cases the value
6017              returned   is   "N/A".   To  direct  a  query  straight  to  the
6018              X11VNC_REMOTE property or connect file use "qry=..." instead  of
6019              "cmd=..."
6020
6021              ans=  stop quit exit shutdown ping resend_cutbuffer resend_clip‐
6022              board resend_primary blacken zero refresh reset close disconnect
6023              id_cmd id sid waitmapped nowaitmapped clip flashcmap noflashcmap
6024              shiftcmap truecolor notruecolor overlay nooverlay overlay_cursor
6025              overlay_yescursor  nooverlay_nocursor  nooverlay_cursor  noover‐
6026              lay_yescursor overlay_nocursor 8to24 no8to24  8to24_opts  24to32
6027              no24to32  visual  scale  scale_cursor viewonly noviewonly shared
6028              noshared forever noforever once timeout  tightfilexfer  notight‐
6029              filexfer  ultrafilexfer  noultrafilexfer  rfbversion  deny  lock
6030              nodeny unlock avahi mdns zeroconf noavahi nomdns nozeroconf con‐
6031              nect  proxy allowonce allow noipv6 ipv6 noipv4 ipv4 no6 6 local‐
6032              host nolocalhost listen lookup nolookup accept afteraccept  gone
6033              shm   noshm   flipbyteorder  noflipbyteorder  onetile  noonetile
6034              solid_color solid nosolid  blackout  xinerama  noxinerama  xtrap
6035              noxtrap  xrandr  noxrandr  xrandr_mode  rotate  padgeom  quiet q
6036              noquiet  modtweak  nomodtweak  xkb  noxkb  capslock   nocapslock
6037              skip_lockkeys    noskip_lockkeys    skip_keycodes    sloppy_keys
6038              nosloppy_keys skip_dups  noskip_dups  add_keysyms  noadd_keysyms
6039              clear_mods   noclear_mods   clear_keys   noclear_keys  clear_all
6040              clear_locks keystate remap repeat norepeat fb nofb  bell  nobell
6041              sendbell  sel  nosel  primary  noprimary setprimary nosetprimary
6042              clipboard noclipboard setclipboard nosetclipboard seldir cursor‐
6043              shape  nocursorshape  cursorpos  nocursorpos  cursor_drag nocur‐
6044              sor_drag cursor show_cursor noshow_cursor nocursor arrow  xfixes
6045              noxfixes  xdamage  noxdamage  xd_area  xd_mem alphacut alphafrac
6046              alpharemove noalpharemove alphablend  noalphablend  xwarppointer
6047              xwarp  noxwarppointer noxwarp always_inject noalways_inject but‐
6048              tonmap     dragging     nodragging     ncache_cr     noncache_cr
6049              ncache_no_moveraise   noncache_no_moveraise   ncache_no_dtchange
6050              noncache_no_dtchange ncache_no_rootpixmap noncache_no_rootpixmap
6051              ncache_reset_rootpixmap      ncrp     ncache_keep_anims     non‐
6052              cache_keep_anims ncache_old_wm noncache_old_wm ncache_pad ncache
6053              noncache  ncache_size debug_ncache nodebug_ncache wireframe_mode
6054              wireframe wf nowireframe nowf wireframelocal wfl  nowireframelo‐
6055              cal   nowfl   wirecopyrect  wcr  nowirecopyrect  nowcr  scr_area
6056              scr_skip  scr_inc  scr_keys  scr_term  scr_keyrepeat   scr_parms
6057              scrollcopyrect  scr  noscrollcopyrect  noscr fixscreen noxrecord
6058              xrecord  reset_record  pointer_mode   pm   input_skip   allinput
6059              noallinput input_eagerly noinput_eagerly input grabkbd nograbkbd
6060              grabptr nograbptr grabalways nograbalways grablocal client_input
6061              ssltimeout  speeds  wmdt  debug_pointer  dp nodebug_pointer nodp
6062              debug_keyboard dk nodebug_keyboard nodk keycode keysym ptr fake‐
6063              buttonevent sleep get_xprop set_xprop wininfo bcx_xattach defer‐
6064              update defer setdefer  extra_fbur  wait_ui  wait_bog  nowait_bog
6065              slow_fb xrefresh wait readtimeout nap nonap sb screen_blank fbpm
6066              nofbpm dpms nodpms clientdpms noclientdpms forcedpms noforcedpms
6067              noserverdpms    serverdpms    noultraext   ultraext   chatwindow
6068              nochatwindow chaton chatoff fs gaps grow  fuzz  snapfb  nosnapfb
6069              rawfb uinput_accel uinput_thresh uinput_reset uinput_always pro‐
6070              gressive rfbport http nohttp  httpport  httpdir  enablehttpproxy
6071              noenablehttpproxy  alwaysshared noalwaysshared nevershared noal‐
6072              waysshared dontdisconnect nodontdisconnect desktop debug_xevents
6073              nodebug_xevents   debug_xevents   debug_xdamage  nodebug_xdamage
6074              debug_xdamage debug_wireframe nodebug_wireframe  debug_wireframe
6075              debug_scroll  nodebug_scroll  debug_scroll debug_tiles dbt node‐
6076              bug_tiles nodbt debug_tiles debug_grabs nodebug_grabs  debug_sel
6077              nodebug_sel dbg nodbg macnosaver macsaver nomacnosaver macnowait
6078              macwait nomacnowait macwheel macnoswap macswap nomacnoswap  mac‐
6079              noresize  macresize  nomacnoresize maciconanim macmenu macnomenu
6080              nomacmenu macuskbd nomacuskbd noremote
6081
6082              aro=  noop display vncdisplay  icon_mode  autoport  loop  loopbg
6083              desktopname  guess_desktop  guess_dbus http_url auth xauth users
6084              rootshift  clipshift  scale_str  scaled_x  scaled_y  scale_numer
6085              scale_denom    scale_fac_x   scale_fac_y   scaling_blend   scal‐
6086              ing_nomult4  scaling_pad  scaling_interpolate  inetd  privremote
6087              unsafe safer nocmds passwdfile unixpw unixpw_nis unixpw_list ssl
6088              ssl_pem sslverify stunnel  stunnel_pem  https  httpsredir  usepw
6089              using_shm logfile o flag rmflag rc norc h help V version lastmod
6090              bg sigpipe threads readrate netrate netlatency pipeinput clients
6091              client_count   pid   ext_xtest   ext_xtrap  ext_xrecord  ext_xkb
6092              ext_xshm   ext_xinerama   ext_overlay   ext_xfixes   ext_xdamage
6093              ext_xrandr   rootwin  num_buttons  button_mask  mouse_x  mouse_y
6094              grab_state   pointer_pos   pointer_x   pointer_y    pointer_same
6095              pointer_root  pointer_mask  bpp  depth indexed_color dpy_x dpy_y
6096              wdpy_x wdpy_y off_x off_y cdpy_x cdpy_y  coff_x  coff_y  rfbauth
6097              passwd viewpasswd
6098
6099       -QD variable
6100
6101              Just  like  -query  variable,  but returns the default value for
6102              that parameter (no running x11vnc server is consulted)
6103
6104       -sync
6105
6106              By default -remote commands are run asynchronously, that is, the
6107              request  is posted and the program immediately exits.  Use -sync
6108              to have the program wait for an acknowledgement from the  x11vnc
6109              server  that command was processed (somehow).  On the other hand
6110              -query requests are always processed synchronously because  they
6111              have to wait for the answer.
6112
6113              Also  note that if both -remote and -query requests are supplied
6114              on the command  line,  the  -remote  is  processed  first  (syn‐
6115              chronously:  no  need for -sync), and then the -query request is
6116              processed in the normal way.  This allows for a reliable way  to
6117              see if the -remote command was processed by querying for any new
6118              settings.  Note however that there is timeout of a  few  seconds
6119              (see the next paragraph) so if the x11vnc takes longer than that
6120              to process the requests the requester will think that a  failure
6121              has taken place.
6122
6123              The  default  is  to  wait 3.5 seconds.  Or if cmd=stop only 1.0
6124              seconds.  If cmd matches 'script:' then it will wait up to  10.0
6125              seconds.   Set  X11VNC_SYNC_TIMEOUT to the number of seconds you
6126              want it to wait.
6127
6128       -query_retries str
6129
6130              If a query fails to get a response from an x11vnc server,  retry
6131              up  to  n  times.  str is specified as n[:t][/match]  Optionally
6132              the delay between tries may be specified by "t" a floating point
6133              time  (default  0.5 seconds.)  Note: the response is not checked
6134              for validity or whether it corresponds to the query  sent.   The
6135              query  "ping:mystring" may be used to help uniquely identify the
6136              query.  Optionally, a matching string after a "/" will  be  used
6137              to check the result text.  Up to n retries will take place until
6138              the matching string is found in the output text.  If  the  match
6139              string is never found the program's exit code is 1; if the match
6140              is found it exits with 0.  Note that there may be stdout printed
6141              for  each  retry  (i.e.  multiple  lines printed out to stdout.)
6142              Example: -query_retries 4:1.5/grab_state
6143
6144       -remote_prefix str
6145
6146              Enable a remote-control communication channel for connected  VNC
6147              clients.   str is a non-empty string. If a VNC client sends rfb‐
6148              CutText having the prefix str then the part  after  it  is  pro‐
6149              cessed  as  though it were sent via 'x11vnc -remote ...'.  If it
6150              begins with neither 'cmd=' nor 'qry=' then  'qry='  is  assumed.
6151              Any corresponding output text for that remote control command is
6152              sent back to all client as rfbCutText.  The returned  output  is
6153              also prefixed with str.  Example: -remote_prefix DO_THIS:
6154
6155              Note  that enabling -remote_prefix allows the remote VNC viewers
6156              to run x11vnc -remote commands.  Do not use this option if  they
6157              are not to be trusted.
6158
6159       -noremote, -yesremote
6160
6161              Do  not  process  any  remote  control  commands or queries.  Do
6162              process remote control commands or queries.  Default: -yesremote
6163
6164              A note about security wrt remote control commands.   If  someone
6165              can   connect   to   the  X  display  and  change  the  property
6166              X11VNC_REMOTE, then they can remotely control x11vnc.   Normally
6167              access  to  the  X  display is protected.  Note that if they can
6168              modify X11VNC_REMOTE on the X server, they have  enough  permis‐
6169              sions  to  also run their own x11vnc and thus have complete con‐
6170              trol of the desktop.  If the  "-connect  /path/to/file"  channel
6171              is  being  used, obviously anyone who can write to /path/to/file
6172              can remotely control x11vnc.  So be sure to protect the  X  dis‐
6173              play and that file's write permissions.  See -privremote below.
6174
6175              If  you  are  paranoid  and do not think -noremote is enough, to
6176              disable  the  X11VNC_REMOTE  property  channel  completely   use
6177              -novncconnect,  or  use the -safer option that shuts many things
6178              off.
6179
6180       -unsafe
6181
6182              A few  remote  commands  are  disabled  by  default  (currently:
6183              id:pick,   accept:<cmd>,   gone:<cmd>,   and  rawfb:setup:<cmd>)
6184              because they are associated with running external programs.   If
6185              you  specify  -unsafe,  then  these  remote-control commands are
6186              allowed.  Note that you can still specify  these  parameters  on
6187              the  command  line,  they just cannot be invoked via remote-con‐
6188              trol.
6189
6190       -safer
6191
6192              Equivalent to: -novncconnect -noremote and prohibiting -gui  and
6193              the -connect file. Shuts off communcation channels.
6194
6195       -privremote
6196
6197              Perform  some  sanity checks and disable remote-control commands
6198              if it appears that the  X  DISPLAY  and/or  connectfile  can  be
6199              accessed  by  other  users.   Once remote-control is disabled it
6200              cannot be turned back on.
6201
6202       -nocmds
6203
6204              No external commands (e.g.  system(3) ,  popen(3)  ,  exec(3)  )
6205              will be run at all.
6206
6207       -allowedcmds list
6208
6209              list  contains  a comma separated list of the only external com‐
6210              mands that can be run.  The full list of associated options is:
6211
6212              stunnel, ssl, unixpw, WAIT, zeroconf, id,  accept,  afteraccept,
6213              gone,   pipeinput,   v4l-info,   rawfb-setup,   dt,   gui,  ssh,
6214              storepasswd, passwdfile, custom_passwd, findauth, crash.
6215
6216              See each option's help to learn the associated external command.
6217              Note  that  the -nocmds option takes precedence and disables all
6218              external commands.
6219
6220       -deny_all
6221
6222              For use with -remote nodeny:  start  out  denying  all  incoming
6223              clients until "-remote nodeny" is used to let them in.
6224
6225       These options are passed to LibVNCServer:
6226
6227       -rfbport port
6228
6229              TCP port for RFB protocol
6230
6231       -rfbwait time
6232
6233              max time in ms to wait for RFB client
6234
6235       -rfbauth passwd-file
6236
6237              use  authentication  on  RFB  protocol (use 'x11vnc -storepasswd
6238              pass file' to create a password file)
6239
6240       -rfbversion 3.x
6241
6242              Set the version of the RFB we choose to advertise
6243
6244       -permitfiletransfer
6245
6246              permit file transfer support
6247
6248       -passwd plain-password
6249
6250              use authentication (use plain-password as password, USE AT  YOUR
6251              RISK)
6252
6253       -deferupdate time
6254
6255              time in ms to defer updates (default 40)
6256
6257       -deferptrupdate time
6258
6259              time in ms to defer pointer updates (default none)
6260
6261       -desktop name
6262
6263              VNC desktop name (default "LibVNCServer")
6264
6265       -alwaysshared
6266
6267              always treat new clients as shared
6268
6269       -nevershared
6270
6271              never treat new clients as shared
6272
6273       -dontdisconnect
6274
6275              don't  disconnect existing clients when a new non-shared connec‐
6276              tion comes in (refuse new connection instead)
6277
6278       -httpdir dir-path
6279
6280              enable http server using dir-path home
6281
6282       -httpport portnum
6283
6284              use portnum for http connection
6285
6286       -enablehttpproxy
6287
6288              enable http proxy support
6289
6290       -progressive height
6291
6292              enable progressive updating for slow links
6293
6294       -listen ipaddr
6295
6296              listen for connections  only  on  network  interface  with  addr
6297              ipaddr. '-listen localhost' and hostname work too.
6298
6299       libvncserver-tight-extension options:
6300
6301       -disablefiletransfer
6302
6303              disable file transfer
6304
6305       -ftproot string
6306
6307              set ftp root
6308

FILES

6310       $HOME/.x11vncrc, $HOME/.Xauthority
6311

ENVIRONMENT

6313       DISPLAY, XAUTHORITY, HOME
6314
6315       The  following are set for the auxiliary commands run by -accept, -gone
6316       and other cases:
6317
6318       RFB_CLIENT_IP,   RFB_CLIENT_PORT,    RFB_SERVER_IP,    RFB_SERVER_PORT,
6319       RFB_X11VNC_PID,  RFB_CLIENT_ID,  RFB_CLIENT_COUNT,  RFB_MODE  RFB_STATE
6320       RFB_LOGIN_VIEWONLY   RFB_LOGIN_TIME    RFB_CURRENT_TIME    RFB_USERNAME
6321       RFB_SSL_CLIENT_CERT
6322

SEE ALSO

6324       vncviewer(1),   vncpasswd(1),   vncconnect(1),  vncserver(1),  Xvnc(1),
6325       xev(1),  xdpyinfo(1),  xwininfo(1),  xprop(1),  xmodmap(1),  xrandr(1),
6326       Xserver(1),  xauth(1),  xhost(1),  Xsecurity(7),  xmessage(1),  XGetIm‐
6327       age(3X11), ipcrm(1), inetd(1), xdm(1), gdm(1),  kdm(1),  ssh(1),  stun‐
6328       nel(8),    su(1),    http://www.tightvnc.com,   http://www.realvnc.com,
6329       http://www.karlrunge.com/x11vnc/, http://www.karlrunge.com/x11vnc/#faq
6330

AUTHORS

6332       x11vnc was written by Karl J. Runge <runge@karlrunge.com>, it  is  part
6333       of   the  LibVNCServer  project  <http://sf.net/projects/libvncserver>.
6334       This manual page is  based  one  the  one  written  by  Ludovic  Drolez
6335       <ldrolez@debian.org>,  for the Debian project (both may be used by oth‐
6336       ers).
6337
6338
6339
6340x11vnc                            April 2014                         X11VNC(1)
Impressum