X11VNC(1)

๐Ÿ“ฆ
version 0.9.17 ยท 2 versions
, in alpine 3.24, debian trixie, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– X11VNC(1) ๐Ÿ’–

bestie welcome to the X11VNC(1) manual page, straight out of the User Commands section, and it's giving extremely useful ๐Ÿ”ฅ


โœจ NAME โœจ

x11vnc โ€” allow VNC connections to real X11 displays ๐Ÿฆ‹

version: 0.9.17, lastmod: 2025-04-11


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

x11vnc [OPTION]...

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so the typical usage is literally this ๐Ÿ‘‡

Run this command in a shell on the remote machine "far-host" with the X session you wish to view:

x11vnc -display :0

Then run this in another window on the machine you are sitting at:

vncviewer far-host:0

Once x11vnc establishes connections with the X11 server and starts listening as a VNC server it will print out a string: PORT=XXXX where XXXX is typically 5900 (the default VNC server port). One would next run something like this on the local machine: "vncviewer hostname:N" where "hostname" is the name of the machine running x11vnc and N is XXXX - 5900, i.e. usually "vncviewer hostname:0". ๐Ÿซถ

By default x11vnc will not allow the screen to be shared and it will exit as soon as the client disconnects. See -shared and -forever below to override these protections. See the FAQ for details how to tunnel the VNC connection through an encrypted channel such as ssh(1). In brief:

ssh -t -L 5900:localhost:5900 far-host 'x11vnc -localhost -display :0'
% vncviewer -encodings 'copyrect tight zrle hextile' localhost:0

Also, use of a VNC password (-rfbauth or -passwdfile) is strongly recommended. ๐Ÿ”

For additional info see: http://www.karlrunge.com/x11vnc/ and http://www.karlrunge.com/x11vnc/faq.html

Config file support: if the file $HOME/.x11vncrc exists then each line in it is treated as a single command line option. Disable with -norc. For each option name, the leading character "-" is not required. E.g. a line that is either "forever" or "-forever" may be used and are equivalent. Likewise "wait 100" or "-wait 100" are acceptable and equivalent lines. The "#" character comments out to the end of the line in the usual way (backslash it for a literal). Leading and trailing whitespace is trimmed off. Lines may be continued with a "\" as the last character of a line (it becomes a space character). ๐Ÿ’…


๐Ÿ‘‘ OPTIONS ๐Ÿ‘‘

  • -display disp โ€” X11 server display to connect to, usually :0. The X server process must be running on same machine and support MIT-SHM. Equivalent to setting the DISPLAY environment variable to disp.

See the description below of the "-display WAIT:..." extensions, where alias "-find" will find the user's display automatically, and "-create" will create a Xvfb session if no session is found. โœจ

  • -auth file โ€” Set the X authority file to be file, equivalent to setting the XAUTHORITY environment variable to file before startup. Same as -xauth file. See Xsecurity(7) , xauth(1) man pages for more info.

Use '-auth guess' to have x11vnc use its -findauth mechanism (described below) to try to guess the XAUTHORITY filename and use it. ๐Ÿ”

XDM/GDM/KDM: if you are running x11vnc as root and want to find the XAUTHORITY before anyone has logged into an X session yet, use: x11vnc -env FD_XDM=1 -auth guess ... (This will also find the XAUTHORITY if a user is already logged into the X session.) When running as root, FD_XDM=1 will be tried if the initial -auth guess fails.

  • -N โ€” If the X display is :N, try to set the VNC display to also be :N This just sets the -rfbport option to 5900+N The program will exit immediately if that port is not available. The -N option only works with normal -display usage, e.g. :0 or :8, -N is ignored in the -display WAIT:..., -create, -find, -svc, -redirect, etc modes. ๐Ÿ˜ค
  • -autoport n โ€” Automatically probe for a free VNC port starting at n. The default is to start probing at 5900. Use this to stay away from other VNC servers near 5900.
  • -rfbport str โ€” The VNC port to listen on (a LibVNCServer option), e.g. 5900, 5901, etc. If specified as "-rfbport PROMPT" then the x11vnc -gui is used to prompt the user to enter the port number. ๐ŸŽฏ
  • -6 โ€” IPv6 listening support. In addition to IPv4, the IPv6 address is listened on for incoming connections. The same port number as IPv4 is used.

NOTE: This x11vnc binary was compiled to have the "-6" IPv6 listening mode ENABLED by default (CPPFLAGS -DX11VNC_LISTEN6=1). So to disable IPv6 listening mode you MUST supply the "-no6" option (see below.) โš ๏ธ

The "-6" mode works for both normal connections and -ssl encrypted ones. Nearly everything is supported for the IPv6 case, but there are a few exceptions. See -stunnel for its IPv6 support.

Currently, for absolutely everything to work correctly the machine may need to have some IPv4 support, at the least for the loopback interface. However, for nearly all usage modes no IPv4 support is required. See -noipv4.

If you have trouble compiling or running in IPv6 mode, set -DX11VNC_IPV6=0 in CPPFLAGS when configuring to disable IPv6 support.

  • -no6 โ€” Disable IPv6 listening support (only useful if the "-6" mode is compiled in to be the default; see the X11VNC_LISTEN6 description above under "-6".) ๐Ÿšซ
  • -noipv6 โ€” Do not try to use IPv6 for any listening or connecting sockets. This includes both the listening service port(s) and outgoing connections from -connect, -connect_or_exit, or -proxy. Use this if you are having problems due to IPv6.
  • -noipv4 โ€” Do not try to use IPv4 for any listening or connecting sockets. This is mainly for exploring the behavior of x11vnc on an IPv6-only system, but may have other uses. ๐Ÿงช
  • -reopen โ€” If the X server connection is disconnected, try to reopen the X display (up to one time.) This is of use for display managers like GDM (KillInitClients option) that kill x11vnc just after the user logs into the X session. Note: the reopened state may be unstable. Set X11VNC_REOPEN_DISPLAY=n to reopen n times and set X11VNC_REOPEN_SLEEP_MAX to the number of seconds, default 10, to keep trying to reopen the display (once per second.) ๐Ÿ˜ญ

Update: as of 0.9.9, x11vnc tries to automatically avoid being killed by the display manager by delaying creating windows or using XFIXES. So you shouldn't need to use KillInitClients=false as long as you log in quickly enough (within 45 seconds of connecting.) You can disable this by setting X11VNC_AVOID_WINDOWS=never. You can also set it to the number of seconds to delay.

  • -reflect host:N โ€” Instead of connecting to and polling an X display, connect to the remote VNC server host:N and be a reflector/repeater for it. This is useful for trying to manage the case of many simultaneous VNC viewers (e.g. classroom broadcasting) where, e.g. you put a repeater on each network switch, etc, to improve performance by distributing the load and network traffic. Implies -shared (use -noshared as a later option to disable). See the discussion below under -rawfb vnc:host:N for more details. ๐Ÿ“ก
  • -id windowid โ€” Show the X window corresponding to windowid not the entire display. New windows like popup menus, transient toplevels, etc, may not be seen or may be clipped. Disabling SaveUnders or BackingStore in the X server may help show them. x11vnc may crash if the window is initially partially obscured, changes size, is iconified, etc. Some steps are taken to avoid this and the -xrandr mechanism is used to track resizes. Use xwininfo(1) to get the window id, or use "-id pick" to have x11vnc run xwininfo(1) for you and extract the id. The -id option is useful for exporting very simple applications (e.g. the current view on a webcam). ๐Ÿ“ท
  • -sid windowid โ€” As -id, but instead of using the window directly it shifts a root view to it: this shows SaveUnders menus, etc, although they will be clipped if they extend beyond the window.
  • -appshare โ€” Simple application sharing based on the -id/-sid mechanism. Every new toplevel window that the application creates induces a new viewer window via a reverse connection. The -id/-sid and -connect options are required. Run 'x11vnc -appshare -help' for more info. ๐ŸชŸ
  • -clip WxH+X+Y โ€” Only show the sub-region of the full display that corresponds to the rectangle geometry with size WxH and offset +X+Y. The VNC display has size WxH (i.e. smaller than the full display). This also works for -id/-sid mode where the offset is relative to the upper left corner of the selected window. An example use of this option would be to split a large (e.g. Xinerama) display into two parts to be accessed via separate viewers by running a separate x11vnc on each part.

Use '-clip xinerama0' to clip to the first xinerama sub-screen (if xinerama is active). xinerama1 for the 2nd sub-screen, etc. This way you don't need to figure out the WxH+X+Y of the desired xinerama sub-screen. screens are sorted in increasing distance from the (0,0) origin (I.e. not the Xserver's order). โœ‚๏ธ

  • -flashcmap โ€” In 8bpp indexed color, let the installed colormap flash as the pointer moves from window to window (slow). Also try the -8to24 option to avoid flash altogether. ๐ŸŽ†
  • -shiftcmap n โ€” Rare problem, but some 8bpp displays use less than 256 colorcells (e.g. 16-color grayscale, perhaps the other bits are used for double buffering) and also need to shift the pixels values away from 0, .., ncells. n indicates the shift to be applied to the pixel values. To see the pixel values set DEBUG_CMAP=1 to print out a colormap histogram. Example: -shiftcmap 240
  • -notruecolor โ€” For 8bpp displays, force indexed color (i.e. a colormap) even if it looks like 8bpp TrueColor (rare problem). ๐ŸŽจ
  • -advertise_truecolor โ€” If the X11 display is indexed color, lie to clients when they first connect by telling them it is truecolor. To workaround RealVNC: inPF has colourMap but not 8bpp Use '-advertise_truecolor reset' to reset client fb too. ๐Ÿ™ˆ
  • -visual n
  • the tail end of the -visual tea โ€” okay bestie, real talk: this option probably does NOT do what you think it does. It just forces the visual used for the framebuffer, and that can be a genuinely bad timeโ€ฆ (like, it'll mess up your colors or straight-up cause a crash ๐Ÿ’€). It's useful for testing and for some workarounds, that's it. n can be a decimal number, or 0x hex. Run xdpyinfo(1) to get the values. You can also use "TrueColor", etc. โ€” peep <X11/X.h> for the full list. And if the string ends in :m then, for better or for worse, the visual depth gets forced to m. Oh and you probably wanna use -noshm when you use this option (so XGetImage may automatically translate the pixel data). ๐Ÿซถ
  • -overlay โ€” handles multiple depth visuals on one screen, like 8+24 and 24+8 overlay visuals (where the 32 bits per pixel are packed with 8 for PseudoColor and 24 for TrueColor). โœจ

Right now -overlay only works on Solaris via XReadScreen(3X11) and IRIX using XReadDisplay(3). On Solaris there's a problem with image "bleeding" around transient popup menus (but not for the menu itself): a workaround is to disable SaveUnders by passing the -su argument to Xsun (in /etc/dt/config/Xservers).

Use -overlay as a workaround for situations like these: some legacy applications require the default visual to be 8bpp (8+24), or they'll use 8bpp PseudoColor even when the default visual is depth 24 TrueColor (24+8). In those cases, colors in some windows will be incorrect in x11vnc unless -overlay is used. Another use of -overlay is to enable showing the exact mouse cursor shape (details below ๐Ÿ‘€).

Under -overlay, performance will be somewhat slower because of the extra image transformations required. For optimal performance, do not use -overlay โ€” instead configure the X server so that the default visual is depth 24 TrueColor and try to have all apps use that visual (e.g. some apps have -use24 or -visual options). ๐Ÿ’…

  • -overlay_nocursor โ€” sets -overlay, but does not try to draw the exact mouse cursor shape using the overlay mechanism. ๐ŸŽ€
  • -8to24 [opts] โ€” try this option if -overlay isn't supported on your OS, and you have a legacy 8bpp app you wanna view on a multi-depth display with default depth 24 (and is 32 bpp) OR you have a default depth 8 display with depth 24 overlay windows for some apps. This option may not work on all X servers and hardware (it was tested on XFree86/Xorg mga driver and Xsun). The "opts" string is not required and is described below. ๐ŸŒธ

This mode enables a hack where x11vnc monitors windows within 3 levels from the root window. If it finds any that are 8bpp it extracts the indexed color pixel values using XGetImage() and then applies a transformation using the colormap(s) to create TrueColor RGB values that it in turn inserts into bits 1-24 of the framebuffer. This creates a depth 24 "view" of the display that is then exported via VNC. ๐Ÿฆ‹

Conversely, for default depth 8 displays, the depth 24 regions are read by XGetImage() and everything is transformed and inserted into a depth 24 TrueColor framebuffer.

Note that even if there are no depth 24 visuals or windows (i.e. pure 8bpp), this mode is potentially an improvement over -flashcmap because it avoids the flashing and shows each window in the correct color. ๐Ÿ’–

This method works OK, but may still have bugs and it does hog resources. If there are multiple 8bpp windows using different colormaps, you may have to iconify all but one for the colors to be correct.

There may be painting errors for clipping and switching between windows of depths 8 and 24. Heuristics are applied to try to minimize the painting errors. You can also press 3 Alt_L's in a row to refresh the screen if the error doesn't repair itself. Also the option -fixscreen 8=3.0 or -fixscreen V=3.0 may be used to periodically refresh the screen at the cost of bandwidth (every 3 sec for this example).

The [opts] string can contain the following settings. Multiple settings are separated by commas.

For some X servers with default depth 24, a speedup may be achieved via the option "nogetimage". This enables a scheme where XGetImage() is not used to retrieve the 8bpp data. Instead, it assumes that the 8bpp data is in bits 25-32 of the 32bit X pixels. There is no requirement that the X server should put the data there for our poll requests, but some do and so the extra steps to retrieve it can be skipped. Tested with mga driver with XFree86/Xorg. For the default depth 8 case this option is ignored.

To adjust how often XGetImage() is used to poll the non-default visual regions for changes, use the option "poll=t" where "t" is a floating point time. (default: 0.05)

Setting the option "level2" will limit the search for non-default visual windows to two levels from the root window. Do this on slow machines where you know the window manager only imposes one extra window between the app window and the root window.

Also for very slow machines use "cachewin=t" where t is a floating point amount of time to cache XGetWindowAttributes results. E.g. cachewin=5.0. This may lead to the windows being unnoticed for this amount of time when deiconifying, painting errors, etc. ๐Ÿ˜ญ

While testing on a very old SS20 these options gave tolerable response: -8to24 poll=0.2,cachewin=5.0. For this machine -overlay is supported and gives better response.

Debugging for this mode can be enabled by setting "dbg=1", "dbg=2", or "dbg=3". ๐Ÿ”ฅ

  • -24to32 โ€” very rare problem: if the framebuffer (X display or -rawfb) is 24bpp instead of the usual 32bpp, then dynamically transform the pixels to 32bpp. This will be slower, but can be used to work around problems where VNC viewers can't handle 24bpp (e.g. "main: setPF: not 8, 16 or 32 bpp?"). See the FAQ for more info. ๐Ÿงš

In the case of -rawfb mode, the pixels are directly modified by inserting a 0 byte to pad them out to 32bpp. For X displays, a kludge is done that is equivalent to "-noshm -visual TrueColor:32". (If better performance is needed for the latter, feel free to ask ๐Ÿ™ˆ).


  • -scale fraction โ€” scale the framebuffer by factor fraction. Values less than 1 shrink the fb, larger ones expand it. Note: the image may not be sharp and response may be slower. If fraction contains a decimal point "." it's taken as a floating point number, alternatively the notation "m/n" may be used to denote fractions exactly, e.g. -scale 2/3 โœจ

To scale asymmetrically in the horizontal and vertical directions, specify a WxH geometry to stretch to: e.g. '-scale 1024x768', or also '-scale 0.9x0.75'

Scaling Options: can be added after fraction via ":", to supply multiple ":" options use commas. If you just want a quick, rough scaling without blending, append ":nb" to fraction (e.g. -scale 1/3:nb). No blending is the default for 8bpp indexed color, to force blending for this case use ":fb".

To disable -scrollcopyrect and -wirecopyrect under -scale use ":nocr". If you need to enable them use ":cr" or specify them explicitly on the command line. If a slow link is detected, ":nocr" may be applied automatically. Default: :cr

More esoteric options: for compatibility with vncviewers the scaled width is adjusted to be a multiple of 4 โ€” to disable this use ":n4". ":in" use interpolation scheme even when shrinking, ":pad" pad scaled width and height to be multiples of scaling denominator (e.g. 3 for 2/3). ๐Ÿ’…

  • -geometry WxH โ€” same as -scale WxH. ๐ŸŽ€
  • -scale_cursor frac โ€” by default if -scale is supplied the cursor shape is scaled by the same factor. Depending on your usage, you may want to scale the cursor independently of the screen or not at all. If you specify -scale_cursor the cursor will be scaled by that factor. When using -scale mode to keep the cursor at its "natural" size use "-scale_cursor 1". Most of the ":" scaling options apply here as well. ๐ŸŒธ
  • -viewonly โ€” all VNC clients can only watch (default off). ๐Ÿ‘€
  • -shared โ€” VNC display is shared, i.e. more than one viewer can connect at the same time (default off). ๐Ÿซถ
  • -once โ€” exit after the first successfully connected viewer disconnects, opposite of -forever. This is the Default.
  • -forever โ€” keep listening for more connections rather than exiting as soon as the first client(s) disconnect. Same as -many

To get the standard non-shared VNC behavior where when a new VNC client connects the existing VNC client is dropped, use: -nevershared -forever This method can also be used to guard against hung TCP connections that do not go away. ๐Ÿ’€

  • -loop โ€” create an outer loop restarting the x11vnc process whenever it terminates. -bg and -inetd are ignored in this mode (however see -loopbg below). ๐Ÿ”

Useful for continuing even if the X server terminates and restarts (at that moment the process will need permission to reconnect to the new X server of course).

Use, e.g., -loop100 to sleep 100 millisecs between restarts, etc. Default is 2000ms (i.e. 2 secs). Use, e.g. -loop300,5 to sleep 300 ms and only loop 5 times.

If -loopbg (plus any numbers) is specified instead, the "-bg" option is implied and the mode approximates inetd(8) usage to some degree. In this case when it goes into the background any listening sockets (i.e. ports 5900, 5800) are closed, so the next one in the loop can use them. This mode will only be of use if a VNC client (the only client for that process) is already connected before the process goes into the background โ€” for example, usage of -display WAIT:.., -svc, and -connect can make use of this "poor man's" inetd mode. The default wait time is 500ms in this mode. This usage could use useful: -svc -bg -loopbg ๐Ÿฆ‹

  • -timeout n โ€” exit unless a client connects within the first n seconds after startup. โฐ

So like, if there have been no connection attempts after n seconds, x11vnc literally just dips out immediately. ๐Ÿ’€ But if a client is tryna connect and just hasn't progressed to the normal operating state yet, she's sweet about it and gives it a few more seconds to finish โ€” and if it still doesn't make it to the normal state, she's gone. periodt. โœจ

And for reverse connections via -connect or -connect_or_exit, a timeout of n seconds gets set for all the reverse connects. If the connect timeout alarm goes off, x11vnc will exit immediately. no takebacks ๐Ÿซถ


  • -sleepin n โ€” at startup, sleep n seconds before doing literally anything else. it's giving "let the redirs and the listening clients have a sec to start up" energy ๐Ÿ›Œ

And bestie, if you give it a range โ€” -sleepin min-max โ€” it sleeps a random value somewhere between min and max. E.g. -sleepin 0-20 and -sleepin 10-30. Floats are allowed too. she's flexible like that ๐Ÿ’…

  • -inetd โ€” for when you're being launched by inetd(8): stdio instead of a listening socket. ๐ŸŒ€
Note, and this one is important: if you are not redirecting stderr to a log file (via shell 2> or the -o option) you MUST also specify the -q option โ€” otherwise the stderr goes to the viewer, which will cause it to abort. ๐Ÿ˜ญ Specifying both -inetd and -q and no -o will automatically close the stderr. iconic auto-cleanup behaviour โœจ
  • -tightfilexfer โ€” enables the TightVNC file transfer extension. ๐ŸŽ€ Note that when the -viewonly option is supplied, all file transfers are disabled. Also, clients that log in viewonly cannot transfer files. However โ€” if the remote control mechanism is used to change the global or per-client viewonly state, the filetransfer permissions will NOT change. lowkey sneaky, but that's the rules. ๐Ÿ™ˆ
IMPORTANT: please understand โ€” if -tightfilexfer is specified and you run x11vnc as root for, say, inetd or display manager (gdm, kdm, ...) access and you do not have it switch users via the -users option, then VNC Viewers that connect are able to do filetransfer reads and writes as root. that's not a vibe, that's a whole security situation ๐Ÿ’€

Also, tightfilexfer is disabled in -unixpw mode. ๐Ÿšซ

  • -ultrafilexfer โ€” heads up: to enable UltraVNC filetransfer and to get it to actually work, you probably need to supply these LibVNCServer options: "-rfbversion 3.6 -permitfiletransfer". "-ultrafilexfer" is an alias for this combination. ๐Ÿช„
IMPORTANT: same energy as above โ€” if -ultrafilexfer is specified and you run x11vnc as root for, say, inetd or display manager (gdm, kdm, ...) access and you do not have it switch users via the -users option, then VNC Viewers that connect are able to do filetransfer reads and writes as root. root access is not a cute little party trick, bestie ๐Ÿ”ฅ

And note that sadly ๐Ÿ˜” you cannot do both -tightfilexfer and -ultrafilexfer at the same time, because the latter requires setting the version to 3.6 and tightvnc will not do filetransfer when it sees that version number. they simply cannot coexist. it's giving exes at the same function ๐Ÿ’”

  • -http โ€” instead of using -httpdir (peep below ๐Ÿ‘€) to specify where the Java vncviewer applet is, have x11vnc try to guess where the directory is by looking relative to the program location and in standard locations (/usr/local/share/x11vnc/classes, etc). Under -ssl or -stunnel the ssl classes subdirectory is sought. she's a detective actually ๐Ÿ”
  • -http_ssl โ€” same as -http, but force the lookup for the ssl classes subdir. ๐Ÿ’…

Note that for HTTPS, single-port Java applet delivery, you can set X11VNC_HTTPS_DOWNLOAD_WAIT_TIME to the max number of seconds to wait for the applet download to finish. The default is 15. โฑ๏ธ

  • -avahi โ€” use the Avahi/mDNS ZeroConf protocol to advertise this VNC server to the local network. (Related terms: Rendezvous, Bonjour.) ๐Ÿ“ก Depending on your setup, you may need to start avahi-daemon and open udp port 5353 in your firewall.

You can set X11VNC_AVAHI_NAME, X11VNC_AVAHI_HOST, and/or X11VNC_AVAHI_PORT environment variables to override the default values. For example: -env X11VNC_AVAHI_NAME=wally ๐ŸŒธ

If the avahi API cannot be found at build time, a helper program like avahi-publish(1) or dns-sd(1) will be tried. backup plan always ready ๐Ÿซถ

  • -mdns โ€” same as -avahi. twin behaviour โœจ
  • -zeroconf โ€” same as -avahi. also same. the trio ๐Ÿ‘‘
  • -connect string โ€” this one's for use with "vncviewer -listen" reverse connections. ๐Ÿ”„ If string has the form "host" or "host:port" the connection is made once at startup.

Use commas for a list of host's and host:port's. E.g. -connect host1,host2 or -connect host1:0,host2:5678. Note that to reverse connect to multiple hosts at the same time you will likely need to also supply: -shared ๐Ÿ’ž

Note that unlike most vnc servers, x11vnc will require a password for reverse as well as for forward connections. (provided password auth has been enabled, -rfbauth, etc) If you do not want to require a password for reverse connections, set X11VNC_REVERSE_CONNECTION_NO_AUTH=1 in your environment before starting x11vnc. ๐Ÿ”

If string contains "/" it is instead interpreted as a file to periodically check for new hosts. The first line is read and then the file is truncated. Be careful about the location of this file if x11vnc is running as root (e.g. via gdm(1), etc). โš ๏ธ

Repeater mode: some services provide an intermediate "vnc repeater": http://www.uvnc.com/addons/repeater.html (and also http://koti.mbnet.fi/jtko/ for the linux port) that acts as a proxy/gateway. ๐Ÿ›ฐ๏ธ Modes like these require an initial string to be sent for the reverse connection before the VNC protocol is started. Here are the ways to do this:

-connect pre=some_string+host:port
-connect pre128=some_string+host:port
-connect repeater=ID:1234+host:port
-connect repeater=23.45.67.89::5501+host:port

SSVNC notation is also supported:

-connect repeater://host:port+ID:1234

As with normal -connect usage, if the repeater port is not supplied 5500 is assumed. ๐ŸŽฏ

The basic idea is between the special tag, e.g. "pre=" and "+" is the pre-string to be sent. Note that in this case host:port is the repeater server, NOT the vnc viewer. Somehow the pre-string tells the repeater server how to find the vnc viewer and connect you to it. ๐Ÿงš

In the case pre=some_string+host:port, "some_string" is simply sent. In the case preNNN=some_string+host:port, "some_string" is sent in a null padded buffer of length NNN. repeater= is the same as pre250=, this is the ultravnc repeater buffer size. ๐Ÿ“ฆ

Strings like "\n" and "\r", etc. are expanded to newline and carriage return. "\c" is expanded to "," since the connect string is comma separated. ๐ŸŽ€

See also the -proxy option below for additional ways to plumb reverse connections. ๐Ÿ”ง

Reverse SSL: using -connect in -ssl mode makes x11vnc act as an SSL client (initiates SSL connection) rather than an SSL server. The idea is x11vnc might be connecting to stunnel on the viewer side with the viewer in listening mode. ๐Ÿ‘‚ If you do not want this behavior, use -env X11VNC_DISABLE_SSL_CLIENT_MODE=1. With this the viewer side can act as the SSL client as it normally does for forward connections. ๐Ÿ”

Reverse SSL Repeater mode: this will work, but note that if the VNC Client does any sort of a 'Fetch Cert' action before connecting, then the Repeater will likely drop the connection and both sides will need to restart. ๐Ÿ˜ญ Consider the use of -connect_or_exit and -loop300,2 to have x11vnc reconnect once to the repeater after the fetch. You will probably also want to supply -sslonly to avoid x11vnc thinking the delay in response means the connection is VeNCrypt. The env var X11VNC_DISABLE_SSL_CLIENT_MODE=1 discussed above may also be useful (i.e. the viewer can do a forward connection as it normally does.) ๐Ÿ’…

IPv6: as of x11vnc 0.9.10 the -connect option should connect to IPv6 hosts properly. ๐ŸŒ If there are problems you can disable IPv6 by setting -DX11VNC_IPV6=0 in CPPFLAGS when configuring. If there problems connecting to IPv6 hosts consider a relay like the included inet6to4 script or the -proxy option. ๐Ÿ› ๏ธ

  • -connect_or_exit str โ€” as with -connect, except if none of the reverse connections succeed, then x11vnc shuts down immediately. she does not wait around ๐Ÿ’€

An easier to type alias for this option is '-coe'. lazy girlies win ๐Ÿซถ

By the way, if you do not want x11vnc to listen on ANY interface use -rfbport 0 which is handy for the -connect_or_exit mode. ๐ŸŽฏ

  • -proxy string โ€” use proxy in string (e.g. host:port) as a proxy for making reverse connections (-connect or -connect_or_exit options). ๐Ÿ”€

Web proxies are supported, but note by default most of them only support destination connections to ports 443 or 563, so this might not be very useful (the viewer would need to listen on that port or the router would have to do a port redirection). ๐Ÿ™ƒ

A web proxy may be specified by either "host:port" or "http://host:port" (the port is required even if it is the common choices 80 or 8080). ๐Ÿ“ฎ

SOCKS4, SOCKS4a, and SOCKS5 are also supported. SOCKS proxies normally do not have restrictions on the destination port number. ๐Ÿงฆ

Use a format like this: socks://host:port or socks5://host:port. Note that ssh -D does not support SOCKS4a, so use socks5://. For socks:// SOCKS4 is used on a numerical IP and "localhost", otherwise SOCKS4a is used (and so the proxy tries to do the DNS lookup). ๐Ÿ”

An experimental mode is "-proxy http://host:port/...". Note the "/" after the port that distinguishes it from a normal web proxy. The port must be supplied even if it is the default 80. For this mode a GET is done to the supplied URL with the string host=H&port=P appended. H and P will be the -connect reverse connect host and port. Use the string "__END__" to disable the appending. ๐Ÿงช The basic idea here is that maybe some cgi script provides the actual viewer hookup and tunnelling. How to actually achieve this within cgi, php, etc. is not clear... ๐Ÿ˜ตโ€๐Ÿ’ซ A custom web server or apache module would be straight-forward. ๐Ÿ’…

Another experimental mode is -proxy ssh://user@host โ€” and in that case a SSH tunnel is doing the proxying for you. โœจ The user@ part is only needed if your unix username is different on host, so like, don't add it if it's the same, bestie. For a non-standard SSH port, use ssh://user@host:port. If you're chaining proxies (peep the next paragraph) then the ssh one has to be first, no exceptions. And if ssh-agent isn't active, you're gonna have to type the ssh password into the terminal where x11vnc is running. ๐Ÿ˜ญ Examples:

-connect localhost:0 -proxy ssh://me@friends-pc:2222
-connect snoopy:0 -proxy ssh://ssh.company.com

You can chain multiple proxies together if you need to ricochet off a whole bunch of hosts to finally reach the VNC viewer โ€” main character energy, honestly. Up to 3 may be chained, separate them by commas in the order they're to be connected to. E.g. http://host1:port1,socks5://host2:port2 or three like: first,second,third.

IPv6: as of x11vnc 0.9.10 the -proxy option should connect to IPv6 hosts properly. ๐Ÿฆ‹ If there are problems you can disable IPv6 by setting -DX11VNC_IPV6=0 in CPPFLAGS when configuring. And if you have problems connecting to IPv6 hosts, consider a relay like the included inet6to4 script.

  • -vncconnect, -novncconnect โ€” Monitor the VNC_CONNECT X property set by the standard VNC program vncconnect(1). When the property is set to "host" or "host:port" it establishes a reverse connection. Using xprop(1) instead of vncconnect may work (see the FAQ). The -remote control mechanism uses the X11VNC_REMOTE channel, and this option disables/enables it as well. Default: -vncconnect

To use different names for these X11 properties (e.g. to have separate communication channels for multiple x11vnc's on the same display) set the VNC_CONNECT or X11VNC_REMOTE env. vars. to the string you want, for example: -env X11VNC_REMOTE=X11VNC_REMOTE_12345 Both sides of the channel must use the same unique name. ๐Ÿ‘‘ The same can be done for the internal X11VNC_TICKER property (heartbeat and timestamp) if desired.

  • -allow host1[,host2..] โ€” Only allow client connections from hosts matching the comma separated list of hostnames or IP addresses. Can also be a numerical IP prefix, e.g. "192.168.100." to match a simple subnet. For more control, build LibVNCServer with libwrap support (See the FAQ). If the list contains a / it instead is interpreted as a file containing addresses or prefixes that is re-read each time a new client connects. Lines can be commented out with the # character in the usual way. ๐ŸŽ€

-allow applies in -ssl mode, but not in -stunnel mode.

IPv6: as of x11vnc 0.9.10 a host can be specified in IPv6 numerical format, e.g. 2001:4860:b009::93.

  • -localhost โ€” Basically the same as "-allow 127.0.0.1". ๐Ÿ’…
Note: if you want to restrict which network interface x11vnc listens on, see the -listen option below. E.g. "-listen localhost" or "-listen 192.168.3.21". As a special case, the option "-localhost" implies "-listen localhost".

A rare case, but for non-localhost -listen usage, if you use the remote control mechanism (-R) to change the -listen interface you may need to manually adjust the -allow list (and vice versa) to avoid situations where no connections (or too many) are allowed. ๐Ÿ˜ญ

If you do not want x11vnc to listen on ANY interface (evidently you are using -connect or -connect_or_exit, or plan to use remote control: -R connect:host), use -rfbport 0.

IPv6: if IPv6 is supported, this option automatically implies the IPv6 loopback address '::1' as well.

  • -unixsock str โ€” Listen on the unix socket (AF_UNIX) 'str' for connections. This mode is for either local connections or a tunnel endpoint where one wants the file permission of the unix socket file to determine what can connect to it. (This currently requires an edit to libvnserver/rfbserver.c: comment out lines 310 and 311, 'close(sock)' and 'return NULL' in rfbserver.c after the setsockopt() call.) Note that to disable all tcp listening ports specify '-rfbport 0' and should be useful with this mode. Example: mkdir ~/s; chmod 700 ~/s; x11vnc -unixsock ~/s/mysock -rfbport 0 ... The SSVNC unix vncviewer can connect to unix sockets. ๐Ÿงš
  • -listen6 str โ€” When in IPv6 listen mode "-6", listen only on the network interface with address str. It also works for link scope addresses (fe80::219:dbff:fee5:3f92%eth0) and IPv6 hostname strings (e.g. ipv6.google.com.) Use LibVNCServer -listen option for the IPv4 interface.
  • -nolookup โ€” Do not use gethostbyname() or gethostbyaddr() to look up host names or IP numbers. Use this if name resolution is incorrectly set up and leads to long pauses as name lookups time out, etc. โญ
  • -input string โ€” Fine tuning of allowed user input. If string does not contain a comma "," the tuning applies only to normal clients. Otherwise the part before "," is for normal clients and the part after for view-only clients. "K" is for Keystroke input, "M" for Mouse-motion input, "B" for Button-click input, "C" is for Clipboard input, and "F" is for File transfer (ultravnc only). Their presence in the string enables that type of input. E.g. "-input M" means normal users can only move the mouse and "-input KMBCF,M" lets normal users do anything and enables view-only users to move the mouse. This option is ignored when a global -viewonly is in effect (all input is discarded in that case).
  • -grabkbd โ€” When VNC viewers are connected, attempt to grab the keyboard so a (non-malicious) user sitting at the physical display is not able to enter keystrokes. This method uses XGrabKeyboard(3X11) and so it is not secure and does not rule out the person at the physical display injecting keystrokes by flooding the server with them, grabbing the keyboard himself, etc. Some degree of cooperation from the person at the display is assumed. This is intended for remote help-desk or educational usage modes. ๐Ÿ’€
Note: on some recent (12/2010) X servers and/or desktops, -grabkbd no longer works: it prevents the window manager from resizing windows and similar things. Try -ungrabboth below (might not work.)
  • -grabptr โ€” As -grabkbd, but for the mouse pointer using XGrabPointer(3X11). Unfortunately due to the way the X server works, the mouse can still be moved around by the user at the physical display, but he will not be able to change window focus with it. Also some window managers that call XGrabServer(3X11) for resizes, etc, will act on the local user's input. Again, some degree of cooperation from the person at the display is assumed. ๐Ÿ™ˆ
  • -ungrabboth โ€” Whenever there is any input (either keyboard or pointer), ungrab *both* the keyboard and the pointer while injecting the synthetic input. This is to allow window managers, etc. a chance to grab.
  • -grabalways โ€” Apply both -grabkbd and -grabptr even when no VNC viewers are connected. If you only want one of them, use the -R remote control to turn the other back on, e.g. -R nograbptr. ๐Ÿ˜Œ
  • -viewpasswd string โ€” Supply a 2nd password for view-only logins. The -passwd (full-access) password must also be supplied.
  • -passwdfile filename โ€” Specify the LibVNCServer password via the first line of the file filename (instead of via -passwd on the command line where others might see it via ps(1) ). ๐Ÿ”ฅ

See the descriptions below for how to supply multiple passwords, view-only passwords, to specify external programs for the authentication, and other features.

If the filename is prefixed with "rm:" it will be removed after being read. Perhaps this is useful in limiting the readability of the file. In general, the password file should not be readable by untrusted users (BTW: neither should the VNC -rfbauth file: it is NOT encrypted, only obscured with a fixed key).

If the filename is prefixed with "read:" it will periodically be checked for changes and reread. It is guaranteed to be reread just when a new client connects so that the latest passwords will be used.

If filename is prefixed with "cmd:" then the string after the ":" is run as an external command: the output of the command will be interpreted as if it were read from a password file (see below). If the command does not exit with 0, then x11vnc terminates immediately. To specify more than 1000 passwords this way set X11VNC_MAX_PASSWDS before starting x11vnc. The environment variables are set as in -accept.

Note that due to the VNC protocol only the first 8 characters of a password are used (DES key).

If filename is prefixed with "custom:" then a custom password checker is supplied as an external command following the ":". The command will be run when a client authenticates. If the command exits with 0 the client is accepted, otherwise it is rejected. The environment variables are set as in -accept.

The standard input to the custom command will be a decimal digit "len" followed by a newline. "len" specifies the challenge size and is usually 16 (the VNC spec). Then follows len bytes which is the random challenge string that was sent to the client. This is then followed by len more bytes holding the client's response (i.e. the challenge string encrypted via DES with the user password in the standard situation).

The "custom:" scheme can be useful to implement dynamic passwords or to implement methods where longer passwords and/or different encryption algorithms are used. The latter will require customizing the VNC client as well. One could create an MD5SUM based scheme for example. ๐Ÿ’–

File format for -passwdfile:

  • If there's more than one non-blank line in the file, every single one of them gets taken as a valid password. Blank lines? Ignored, they're not invited to the party ๐Ÿ’…
  • A password line can be "commented out" (aka ignored) if it begins with the character #, or if the line contains the string __SKIP__.
  • Lines can also be annotated with the __COMM__ string: everything from it to the end of the line is ignored. Cute little notes section, honestly ๐ŸŽ€
  • Wanna allow an empty password? Use the __EMPTY__ string on a line all by itself. (heads up tho: your viewer might not accept empty passwords ๐Ÿ™ˆ)
  • If the string __BEGIN_VIEWONLY__ appears on a line by itself, then the remaining passwords are used for viewonly access. ๐Ÿ‘€
  • For compatibility, there's a special case: if the file contains only two password lines, the 2nd one is automatically taken as the viewonly password. Otherwise the __BEGIN_VIEWONLY__ token must be used to have viewonly passwords. (tip: make the 3rd and last line be __BEGIN_VIEWONLY__ to have 2 full-access passwords โœจ)

  • -showrfbauth filename โ€” prints to the screen the obscured VNC password kept in the rfbauth file filename and then exits. Lowkey a reveal moment ngl ๐Ÿ”ฅ
  • -unixpw [list] โ€” use Unix username and password authentication. x11vnc will use the su(1) program to verify the user's password. [list] is an optional comma separated list of allowed Unix usernames. If the [list] string begins with the character ! then the entire list is taken as an exclude list. (see below for per-user options that can be applied ๐Ÿ‘‡)
    • A familiar login: and Password: dialog is presented to the user on a black screen inside the vncviewer. The connection is dropped if the user fails to supply the correct password in 3 tries, or does not send one before a 45 second timeout. Existing clients are view-only during this period. โณ
    • If the first character received is "Escape" then the unix username will not be displayed after login: as it is typed. Could be useful for VNC viewers that automatically type the username and password ๐Ÿงš
    • Since the detailed behavior of su(1) can vary from OS to OS and for local configurations, test the mode before deployment to make sure it is working properly. x11vnc will attempt to be conservative and reject a login if anything abnormal occurs.
    • One case to note: FreeBSD and the other BSD's, by default it is impossible for the user running x11vnc to validate his own password via su(1) (commenting out the pam_self.so entry in /etc/pam.d/su eliminates this behavior). So the x11vnc login will always FAIL for this case (even when the correct password is supplied). ๐Ÿ˜ญ
    • A possible workaround for this on *BSD would be to start x11vnc as root with the -users +nobody option to immediately switch to user nobody where the su'ing will proceed normally.
    • Another source of potential problems are PAM modules that prompt for extra info, e.g. password aging modules. These logins will fail as well even when the correct password is supplied.
    • IMPORTANT: to prevent the Unix password being sent in clear text over the network, one of two schemes will be enforced: 1) the -ssl builtin SSL mode, or 2) require both -localhost and -stunnel be enabled.
    • Method 1) ensures the traffic is encrypted between viewer and server. A PEM file will be required, see the discussion under -ssl below (under some circumstances a temporary one can be automatically generated).
    • Method 2) requires the viewer connection to appear to come from the same machine x11vnc is running on (e.g. from a ssh -L port redirection). And that the -stunnel SSL mode be used for encryption over the network. (see the description of -stunnel below).
    • Note: as a convenience, if you ssh(1) in and start x11vnc it will check if the environment variable SSH_CONNECTION is set and appears reasonable. If it does, then the -ssl or -stunnel requirement will be dropped since it is assumed you are using ssh for the encrypted tunnelling. -localhost is still enforced. Use -ssl or -stunnel to force SSL usage even if SSH_CONNECTION is set.
    • To override the above restrictions you can set environment variables before starting x11vnc:
      • Set UNIXPW_DISABLE_SSL=1 to disable requiring either -ssl or -stunnel (as under SSH_CONNECTION.) Evidently you will be using a different method to encrypt the data between the vncviewer and x11vnc: perhaps ssh(1) or an IPSEC VPN. -localhost is still enforced (however, see the next paragraph.)
      • Set UNIXPW_DISABLE_LOCALHOST=1 to disable the -localhost requirement in -unixpw modes. One should never do this (i.e. allow the Unix passwords to be sniffed on the network.) This also disables the localhost requirement for reverse connections (see below.)
    • Note that use of -localhost with ssh(1) (and no -unixpw) is roughly the same as requiring a Unix user login (since a Unix password or the user's public key authentication is used by sshd on the machine where x11vnc runs and only local connections from that machine are accepted).
    • Regarding reverse connections (e.g. -R connect:host and -connect host), when the -localhost constraint is in effect then reverse connections can only be used to connect to the same machine x11vnc is running on (default port 5500). Please use a ssh or stunnel port redirection to the viewer machine to tunnel the reverse connection over an encrypted channel. ๐Ÿ”
    • In -inetd mode the Method 1) will be enforced (not Method 2). With -ssl in effect reverse connections are disabled. If you override this via env. var, be sure to also use encryption from the viewer to inetd. Tip: you can also have your own stunnel spawn x11vnc in -inetd mode (thereby bypassing inetd). See the FAQ for details.
    • The user names in the comma separated [list] may have per-user options after a :, e.g. fred:opts where opts is a + separated list of viewonly, fullaccess, input=XXXX, or deny, e.g. karl,wally:viewonly,boss:input=M. For input= it is the K,M,B,C described under -input.
    • If an item in the list is * that means those options apply to all users. It ALSO implies all users are allowed to log in after supplying a valid password. Use deny to explicitly deny some users if you use * to set a global option. If [list] begins with the ! character then * is ignored for checking if the user is allowed, but the option values associated with it do apply as normal.
    • There are also some utilities for checking passwords if [list] starts with the % character. See the quick_pw() function for more details. Description: %- or %stdin means read one line from stdin. %env means it is in $UNIXPW env var. A leading %/ or %. means read the first line from the filename that follows after the % character. % by itself means prompt for the username and password. Otherwise: %user:pass E.g. -unixpw %fred:swordfish For the other cases user:pass is read from the indicated source. If the password is correct 'Y user' is printed and the program exit code is 0. If the password is incorrect it prints 'N user' and the exit code is 1. If there is some other error the exit code is 2. This feature enables x11vnc to be a general unix user password checking tool; it could be used from scripts or other programs. These % password checks also apply to the -unixpw_nis and -unixpw_cmd options. ๐Ÿ› ๏ธ
    • For the % password check, if the env. var. UNIXPW_CMD is set to a command then it is run as the user (assuming the password is correct.) The output of the command is not printed, the program or script must manage that by some other means. The exit code of x11vnc will depend on the exit code of the command that is run.
    • Use -nounixpw to disable unixpw mode if it was enabled earlier in the cmd line (e.g. -svc mode)

  • -unixpw_nis [list] โ€” as -unixpw above, however do not use su(1) but rather use the traditional getpwnam(3) + crypt(3) method to verify passwords. All of the above -unixpw options and constraints apply. ๐ŸŒˆ
    • This mode requires that the encrypted passwords be readable. Encrypted passwords stored in /etc/shadow will be inaccessible unless x11vnc is run as root.
    • This is called "NIS" mode simply because in most NIS setups user encrypted passwords are accessible (e.g. ypcat passwd) by an ordinary user and so that user can authenticate ANY user.
    • NIS is not required for this mode to work (only that getpwnam(3) return the encrypted password is required), but it is unlikely it will work (as an ordinary user) for most modern environments unless NIS is available. On the other hand, when x11vnc is run as root it will be able to to access /etc/shadow even if NIS is not available (note running as root is often done when running x11vnc from inetd and xdm/gdm/kdm).
    • Looked at another way, if you do not want to use the su(1) method provided by -unixpw (i.e. su_verify()), you can run x11vnc as root and use -unixpw_nis. Any users with passwords in /etc/shadow can then be authenticated. ๐Ÿ‘‘
    • In -unixpw_nis mode, under no circumstances is x11vnc's user password verifying function based on su called (i.e. the function su_verify() that runs /bin/su in a pseudoterminal to verify passwords.) However, if -unixpw_nis is used in conjunction with the -find and -create -display WAIT:... modes then, if x11vnc is running as root, /bin/su may be called externally to run the find or create commands.

  • -unixpw_cmd cmd โ€” as -unixpw above, however do not use su(1) but rather run the externally supplied command cmd. The first line of its stdin will be the username and the second line the received password. If the command exits with status 0 (success) the VNC user will be accepted. It will be rejected for any other return status. ๐Ÿ’€

Dynamic passwords and non-unix passwords (LDAP besties, I'm looking at you ๐Ÿ‘€) can be done this way โ€” you just hand over your own custom helper program. Heads up tho: the remote viewer gets 3 tries to type the right password, so your program might get called that many times in a row (or more, fr).

If you need a list of allowed users to limit who can log in, use -unixpw [list] alongside this option. ๐Ÿซถ

In FINDDISPLAY and FINDCREATEDISPLAY modes the cmd will also be run with the RFB_UNIXPW_CMD_RUN env. var. non-empty and set to the corresponding display find/create command. The first two lines of input are the username and passwd, same as the normal case described above. To support FINDDISPLAY and FINDCREATEDISPLAY, cmd should run the requested command as the user (and most likely refusing to run it if the password is not correct.) Here's an example script (note it has a hardwired bogus password "abc"! ๐Ÿ’€):

#!/bin/sh
# Example x11vnc -unixpw_cmd script.
# Read the first two lines of stdin (user and passwd)
read user
read pass

debug=0
if [ $debug = 1 ]; then
    echo "user: $user" 1>&2
    echo "pass: $pass" 1>&2
    env | egrep -i 'rfb|vnc' 1>&2
fi

# Check if the password is valid.
# (A real example would use ldap lookup, etc!)
if [ "X$pass" != "Xabc" ]; then
    exit 1        # incorrect password
fi

if [ "X$RFB_UNIXPW_CMD_RUN" = "X" ]; then
    exit 0        # correct password
else
    # Run the requested command (finddisplay)
    if [ $debug = 1 ]; then
        echo "run: $RFB_UNIXPW_CMD_RUN" 1>&2
    fi
    exec /bin/su - "$user" -c "$RFB_UNIXPW_CMD_RUN"
fi

In -unixpw_cmd mode, under no circumstances is x11vnc's user password verifying function based on su called (i.e. the function su_verify() that runs /bin/su in a pseudoterminal to verify passwords.) It is up to the supplied unixpw_cmd to do user switching if desired and if it has the permissions to do so. ๐Ÿ‘‘


  • -find โ€” Finds the user's display using FINDDISPLAY. It's an alias for "-display WAIT:cmd=FINDDISPLAY".
Note: if a -display occurs later on the command line it will override the -find setting.

For this and the next few options see -display WAIT:... below for all of the details. โœจ

  • -finddpy โ€” Runs the FINDDISPLAY program, prints out the found display (if any) and exits. Output is like: DISPLAY=:0.0 DISPLAY=:0.0,XPID=12345 or DISPLAY=:0.0,VT=7. XPID is the process ID of the found X server. VT is the Linux virtual terminal of the X server. ๐Ÿฆ‹
  • -listdpy โ€” Has the FINDDISPLAY program list all of your displays (i.e. all the X displays on the local machine that you have access rights to). x11vnc then exits. ๐Ÿ’…
  • -findauth [disp] โ€” Applies the -find/-finddpy heuristics to try to guess the XAUTHORITY file for DISPLAY 'disp'. If 'disp' is not supplied, then the value in the -display on the cmdline is used; failing that $DISPLAY is used; and failing that ":0" is used. x11vnc then exits. If nothing is printed out, that means no XAUTHORITY was found for 'disp'; i.e. failure. If "XAUTHORITY=" is printed out, that means use the default (i.e. do not set XAUTHORITY). If "XAUTHORITY=/path/to/file" is printed out, then use that file. XDM/GDM/KDM: if you are running x11vnc as root and want to find the XAUTHORITY before anyone has logged into an X session yet, use: x11vnc -env FD_XDM=1 -findauth ... (This will also find the XAUTHORITY if a user is already logged into the X session.) When running as root, FD_XDM=1 will be tried if the initial -findauth fails.
  • -create โ€” First tries to find the user's display using FINDDISPLAY; if that doesn't succeed, creates an X session via the FINDCREATEDISPLAY method. This is an alias for "-display WAIT:cmd=FINDCREATEDISPLAY-Xvfb".
Note: if a -display occurs later on the command line it will override the -create setting.

SSH NOTE: for both -find and -create you can (should!) add the "-localhost" option to force SSH tunnel access. ๐Ÿ”’

  • -xdummy โ€” As in -create, except Xdummy instead of Xvfb.
  • -xvnc โ€” As in -create, except Xvnc instead of Xvfb.
  • -xvnc_redirect โ€” As in -create, except Xvnc.redirect instead of Xvfb.
  • -xdummy_xvfb โ€” Sets WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb
  • -create_xsrv str โ€” Sets WAIT:cmd=FINDCREATEDISPLAY-<str> Can be on cmdline after anything that sets WAIT:.. and other things (e.g. -svc, -xdmsvc) to adjust the X server list. Example: -svc ... -create_xsrv Xdummy,X
  • -svc โ€” Terminal services mode based on SSL access. Alias for -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb -unixpw -users unixpw= -ssl SAVE Also "-service".
Note: if a -display, -unixpw, -users, or -ssl occurs later on the command line it will override the -svc setting.
  • -svc_xdummy โ€” As -svc except Xdummy instead of Xvfb.
  • -svc_xvnc โ€” As -svc except Xvnc instead of Xvfb.
  • -svc_xdummy_xvfb โ€” As -svc with Xdummy,Xvfb.
  • -xdmsvc โ€” Display manager Terminal services mode based on SSL. Alias for -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp -unixpw -users unixpw= -ssl SAVE Also "-xdm_service".
Note: if a -display, -unixpw, -users, or -ssl occurs later on the command line it will override the -xdmsvc setting.

To create a session a user will have to first log in to the -unixpw dialog and then log in again to the XDM/GDM/KDM prompt. Subsequent re-connections will only require the -unixpw password. See the discussion under -display WAIT:... for more details about XDM, etc configuration. ๐Ÿ˜ญ Remember to enable XDMCP in the xdm-config, gdm.conf, or kdmrc configuration file. See -display WAIT: for more info.

  • -sshxdmsvc โ€” Display manager Terminal services mode based on SSH. Alias for -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb.xdmcp -localhost. The -localhost option constrains connections to come in via a SSH tunnel (which will require a login). To create a session a user will also have to log into the XDM GDM KDM prompt. Subsequent re-connections will only only require the SSH login. See the discussion under -display WAIT:... for more details about XDM, etc configuration. Remember to enable XDMCP in the xdm-config, gdm.conf, or kdmrc configuration file. See -display WAIT: for more info.
  • -unixpw_system_greeter โ€” Presents a "Press 'Escape' for System Greeter" option to the connecting VNC client in combined -unixpw and xdmcp FINDCREATEDISPLAY modes (e.g. -xdmsvc). ๐Ÿšชโœจ Normally in a -unixpw mode the VNC client must supply a valid username and password to gain access. However, if -unixpw_system_greeter is supplied AND the FINDCREATEDISPLAY command matches 'xdmcp', then the user has the option to press Escape and then get a XDM/GDM/KDM login/greeter panel instead. They will then supply a username and password directly to the greeter. Otherwise, in xdmcp FINDCREATEDISPLAY mode the user must supply his username and password TWICE. First to the initial unixpw login dialog, and second to the subsequent XDM/GDM/KDM greeter. Note that if the user re-connects and supplies his username and password in the unixpw dialog the xdmcp greeter is skipped and he is connected directly to his existing X session. So the -unixpw_system_greeter option avoids the extra password at X session creation time. ๐ŸŽ€ Example: x11vnc -xdmsvc -unixpw_system_greeter See -unixpw and -display WAIT:... for more info. The special options after a colon at the end of the username (e.g. user:solid) described under -display WAIT: are also applied in this mode if they are typed in before the user hits Escape. The username is ignored but the colon options are not. The default message is 2 lines in a small font, set the env. var. X11VNC_SYSTEM_GREETER1=true for a 1 line message in a larger font. If the user pressed Escape the FINDCREATEDISPLAY command will be run with the env. var. X11VNC_XDM_ONLY=1. Remember to enable XDMCP in the xdm-config, gdm.conf, or kdmrc configuration file. See -display WAIT: for more info.
  • -redirect port โ€” As in FINDCREATEDISPLAY-Xvnc.redirect mode except redirect immediately (i.e. without X session finding or creation) to a VNC server listening on port. You can also supply host:port to redirect to a different machine. ๐Ÿ”€ If 0 <= port < 200 it is taken as a VNC display (5900 is added to get the actual port), if port < 0 then -port is used. Probably the only reason to use the -redirect option is in conjunction with SSL support, e.g. -ssl SAVE. This provides an easy way to add SSL encryption to a VNC server that does not support SSL (e.g. Xvnc or vnc.so) In fact, the protocol does not even need to be VNC, and so "-rfbport port1 -ssl SAVE -redirect host:port2" can act as a replacement for stunnel(1). ๐Ÿ’… This mode only allows one redirected connection. The -forever option does not apply. Use -inetd or -loop for persistent service.
  • -display WAIT:... โ€” A special usage mode for the normal -display option. Useful with -unixpw, but can be used independently of it. If the display string begins with WAIT: then x11vnc waits until a VNC client connects before opening the X display (or -rawfb device). โณ This could be useful for delaying opening the display for certain usage modes (say if x11vnc is started at boot time and no X server is running or users logged in yet). If the string is, e.g. WAIT:0.0 or WAIT:1, i.e. "WAIT" in front of a normal X display, then that indicated display is used. One can also insert a geometry between colons, e.g. WAIT:1280x1024:... to set the size of the display the VNC client first attaches to since some VNC viewers will not automatically adjust to a new framebuffer size. ๐Ÿ“ A more interesting case is like this:
WAIT:cmd=/usr/local/bin/find_display

in which case the command after cmd= gets run to dynamically work out the DISPLAY and optionally the XAUTHORITY data. The first line of the command output has to look like DISPLAY=<xdisplay>. On Linux, if you know the virtual terminal, tack ,VT=n onto that string and the chvt(1) program gets run too. Any output left over after that? That's your XAUTHORITY data ๐Ÿ’… โ€” either as XAUTHORITY=<file> or as raw xauthority data for the display. Like, for example:

xauth extract - $DISPLAY"
NOTE: so yeah, like the last paragraph said, you can supply your own WAIT:cmd=... program or script โ€” BUT there are two extremely useful BUILT-IN ones: FINDDISPLAY (alias -find above) and FINDCREATEDISPLAY (alias -create above). Most people just use those instead of writing their own script, bestie. Read the next bits (especially the BUILT-IN modes sections) to see how to configure these two super useful builtin -display WAIT: modes.

If you're on -unixpw (and -unixpw_nis only when x11vnc is running as root), then the cmd= command runs as the user who just authenticated through the login + password prompt. ๐Ÿซถ

And with -unixpw_cmd, those commands also run as the logged-in user โ€” as long as the user-supplied helper program supports RFB_UNIXPW_CMD_RUN (peep the -unixpw_cmd option for that one).

Also, with -unixpw, the person logging in can drop a colon at the end of her username and add a few options: scale=, scale_cursor= (or sc=), solid (or so), id=, clear_mods (or cm), clear_keys (or ck), clear_all (or ca), repeat, speeds= (or sp=), readtimeout= (or rd=), viewonly (or vo), nodisplay= (or nd=), rotate= (or ro=), or noncache (or nc) โ€” all separated by commas if there's more than one. Once she logs in successfully, those options get applied to the VNC screen. For example:

login: fred:scale=3/4,sc=1,repeat Password: ...

login: runge:sp=modem,rd=120,solid

and for convenience, m/n just means scale= โ€” e.g. fred:3/4. Oh and if you type your password wrong? To get your long login: line back, hit the Up arrow once (before you type anything else). ๐Ÿ™ˆ

Most of these colon options only apply to the builtin FINDDISPLAY and FINDCREATEDISPLAY modes โ€” but heads up, they also get passed to the external command in the environment, so they could be used there too.

In the login panel, press F1 to pull up a list of the available options you can add after the username. โœจ

Another option is geom=WxH or geom=WxHxD (or ge=). This one only does anything in FINDCREATEDISPLAY mode, when a virtual X server like Xvfb is about to be created. It sets the width and height of the new display, and optionally the color depth too.

You can also hand it gnome, kde, twm, fvwm, mwm, dtwm, wmaker, xfce, lxde, enlightenment, Xsession, or failsafe (same as xterm) to have the created display use that mode for the user session. ๐Ÿ’–

Specify tag=... to set the unique FD_TAG desktop session tag described below. Note: this option gets ignored if the FD_TAG env. var. is already set, or if the viewer-side supplied value isn't completely made up of alphanumeric or _ or - characters.

User preferences file: instead of making the user type geom=WxH,... etc. every single time he logs in to find or create his X session โ€” if you set FD_USERPREFS to a string that doesn't contain the / character, then the user's home directory gets prepended to that string, and if the file exists its first line is read and appended to any options he supplied at the login: prompt. For example -env FD_USERPREFS=.x11vnc_create and the user put "geom=1600x1200" in his ~/.x11vnc_create file.

To disable the option setting, set the environment variable X11VNC_NO_UNIXPW_OPTS=1 before starting x11vnc. And to set any other options, the user can use the gui (x11vnc -gui connect) or the remote control method (x11vnc -R opt:val) during his VNC session.

So like, you see how the combo of -display WAIT:cmd=... and -unixpw lets an unix authenticated VNC user get automatically paired with his desktop? ๐ŸŒธ That's lowkey very useful on SunRays and honestly any system where multiple users share a given machine. The user doesn't have to remember special ports or passwords set up for his desktop and VNC. iconic.

A nice way to use WAIT:cmd=... is out of inetd(8) (it automatically forks a new x11vnc for each user). You can have the x11vnc inetd spawned process run as, say, root or nobody. When run as root (for either inetd or display manager), you can also supply the option -users unixpw= to have the x11vnc process switch to the user as well. Note: there will be a 2nd SSL helper process that will not switch โ€” but at that point it's only encoding and decoding the encrypted stream. ๐Ÿ’…

๐ŸŒˆ BUILT-IN modes ๐ŸŒˆ

๐Ÿ’ซ -- Automatic Finding of User X Sessions -- ๐Ÿ’ซ

As a special case, WAIT:cmd=FINDDISPLAY runs a script that works on most Unixes to figure out a user's DISPLAY variable and xauthority data (peep who(1)). ๐Ÿ‘‘

NOTE: the option -find is an alias for this mode.

To have this default script printed to stdout (e.g. for customization) run with WAIT:cmd=FINDDISPLAY-print. To have the script run to print what display it would find, use -finddpy or WAIT:cmd=FINDDISPLAY-run.

The standard script runs xdpyinfo(1) on potential displays. If your X server(s) have a login greeter that exclusively grabs the Xserver, then xdpyinfo blocks forever and this mode will not work. ๐Ÿ˜ญ See www.karlrunge.com/x11vnc/faq.html#faq-display-manager for how to disable this for dtgreet on Solaris and possibly for other greeters.

In -find/cmd=FINDDISPLAY mode, if you set FD_XDM=1, e.g. 'x11vnc -env FD_XDM=1 -find ...', and x11vnc is running as root (e.g. inetd), then it'll try to find the XAUTHORITY file of a running XDM/GDM/KDM login greeter (i.e. no user has logged into an X session yet).

As another special case, WAIT:cmd=HTTPONCE lets x11vnc service one http request and then exit. This is usually done in -inetd mode to run on, say, port 5800 and let the Java vncviewer get downloaded by client web browsers. Like, for example:

5815 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc \ -inetd
-q -http_ssl -prog /.../x11vnc \ -display WAIT:cmd=HTTPONCE

Where /.../x11vnc is the full path to x11vnc. It's used in the Apache SSL-portal example (see FAQ).

In this mode you can set X11VNC_SKIP_DISPLAY to a comma separated list of displays (e.g. ":0,:1") to ignore in the finding process. The ":" is optional. Ranges like n-m, e.g. 0-20, can also be supplied. This string can also be set by the connecting user via "nd=" using "+" instead of ",". And if "nd=all" or you set X11VNC_SKIP_DISPLAY=all, then all display finding fails โ€” as if you set X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 (below).

On some systems lsof(1) can be very slow. ๐Ÿ˜ญ Set the env. var. FIND_DISPLAY_NO_LSOF=1 to skip using lsof to try to find the Linux VT the X server is running on. Or set FIND_DISPLAY_NO_VT_FIND=1 to avoid looking at all.

๐Ÿฆ‹ -- Automatic Creation of User X Sessions -- ๐Ÿฆ‹

An interesting option is WAIT:cmd=FINDCREATEDISPLAY, which is like FINDDISPLAY in that it uses the same method to find an existing display. BUT โ€” if it doesn't find one, it'll try to start up an X server session for the user. This is the only time x11vnc tries to actually start up an X server. ๐Ÿš€

NOTE: the option -create is an alias for this mode.

It starts looking for an open display number at :20. Override via X11VNC_CREATE_STARTING_DISPLAY_NUMBER=n. By default 80 X displays are allowed (i.e. going to :99). Override via X11VNC_CREATE_MAX_DISPLAYS=n.

For its heuristics, the create display script sets LC_ALL=C so that command output is uniform. By default it'll try to restore LC_ALL right before starting the user session. But if you don't mind it keeping LC_ALL=C set, use the env. var.: X11VNC_CREATE_LC_ALL_C_OK=1.

By default FINDCREATEDISPLAY will try Xvfb and then Xdummy:

The Xdummy wrapper is part of the x11vnc source code (x11vnc/misc/Xdummy). It should be available in PATH and have run "Xdummy -install" once to create the shared library. Xdummy only works on Linux. As of 12/2009 it no longer needs to be run as root, and the default is to not run as root. In some circumstances permissions may require running it as root โ€” in those cases specify FD_XDUMMY_RUN_AS_ROOT=1, which is the same as supplying -root to the Xdummy cmdline.

Xvfb is available on most platforms and does not require root.

An advantage of Xdummy over Xvfb is that Xdummy supports RANDR dynamic screen resizing. โœจ

When x11vnc exits (i.e. user disconnects) the X server session stays running in the background. The FINDDISPLAY will find it directly next time. The user must exit the X session in the usual way for it to terminate (or kill the X server process if all else fails). ๐Ÿ’€

To troubleshoot the FINDCREATEDISPLAY mechanism, set the following env. var. to an output log file, e.g. -env CREATE_DISPLAY_OUTPUT=/tmp/mydebug.txt.

So this is a somewhat odd mode for x11vnc in that it'll start up and poll virtual X servers! It can be used from, say, inetd(8) to provide a means of definitely getting a desktop (either real or virtual) on the machine. E.g. a desktop service:

5900 stream tcp nowait root /usr/sbin/tcpd /.../x11vnc -inetd -q
-http -ssl SAVE -unixpw -users unixpw=\ -passwd secret -prog
/.../x11vnc \ -display WAIT:cmd=FINDCREATEDISPLAY

Where /.../x11vnc is the full path to x11vnc.

See the -svc/-service option alias above. ๐Ÿ‘‘

If for some reason you do not want x11vnc to ever try to find an existing display, set the env. var X11VNC_FINDDISPLAY_ALWAYS_FAILS=1 (also -env ...). This is the same as setting X11VNC_SKIP_DISPLAY=all or supplying "nd=all" after "username:". ๐ŸŽ€


ok bestie so you've got your display-finding scheme all set up, and now we're deep in the wait-mode lore. buckle up ๐ŸŽ€

Use WAIT:cmd=FINDCREATEDISPLAY-print to print out the script that's actually used for this whole thing. iykyk, it's the receipts โœจ

You can specify the preferred X server order via e.g. WAIT:cmd=FINDCREATEDISPLAY-Xdummy,Xvfb,X and/or just leave out the ones you don't want. choose your own adventure energy ๐Ÿ’… The case "X" means try to start up a real, hardware X server using xinit(1) or startx(1). And heads up bestie โ€” if there's already an X server running, the X case may only work on Linux (see startx(1)). ๐Ÿ˜ญ

"Xvnc" will start up a VNC X server (real- or tight-vnc, e.g. use if Xvfb is not available). "Xsrv" will start up the server program in the variable "FD_XSRV" if it is non-empty. You can make this be a wrapper script if you like โ€” it must handle :N, -geometry, and -depth and other X server options. no pressure or anything ๐Ÿ’€

You can set the environment variable FD_GEOM (or X11VNC_CREATE_GEOM) to WxH or WxHxD to set the width and height and optionally the color depth of the created display. You can also set FD_SESS to be the session (short name of the windowmanager: kde, gnome, twm, failsafe, etc.). FD_OPTS contains extra options to pass to the X server. You can also set FD_PROG to be the full path to the session/windowmanager program. so many knobs, so little time ๐Ÿฆ‹

More FD tricks, because there are always more tricks:

  • FD_CUPS=port or FD_CUPS=host:port will set the cups printing environment.
  • Similarly FD_ESD=port or FD_ESD=host:port for esddsp sound redirection.
  • Set FD_EXTRA to a command to be run a few seconds after the X server starts up.
  • Set FD_TAG to be a unique name for the session, it is set as an X property, that makes FINDDISPLAY only find sessions with that tag value. ๐Ÿท๏ธ

Set FD_XDMCP_IF to the network interface that the display manager is running on; default is 'localhost' but you may need to set it to '::1' on some IPv6 only systems or misconfigured display managers. sigh, IPv6 ๐Ÿ™ˆ

If you want the FINDCREATEDISPLAY session to contact an XDMCP login manager (xdm/gdm/kdm) on the same machine, then use "Xvfb.xdmcp" instead of "Xvfb", etc. The user will have to supply his username and password one more time (but he gets to select his desktop type so that can be useful). For this to work, you will need to enable localhost XDMCP (udp port 177) for the display manager. This seems to be:

for gdm in gdm.conf:   Enable=true in section [xdmcp]
for kdm in kdmrc:      Enable=true in section [Xdmcp]
for xdm in xdm-config: DisplayManager.requestPort: 177

See the shorthand options above -svc, -xdmsvc and -sshxdmsvc that specify the above options for some useful cases. convenience queen ๐Ÿ‘‘

If you set the env. var WAITBG=1 x11vnc will go into the background once listening in wait mode. ๐ŸŒ™

Another special mode is FINDCREATEDISPLAY-Xvnc.redirect, (or FINDDISPLAY-Xvnc.redirect). In this case it will start up Xvnc as above if needed, but instead of polling it in its normal way, it simply does a socket redirection of the connected VNC viewer to the Xvnc. no thoughts, just pipe ๐Ÿ”ฅ

So in Xvnc.redirect x11vnc does no VNC but merely transfers the data back and forth. This should be faster then x11vnc's polling method, but not as fast as connecting directly to the Xvnc with the VNC Viewer. The idea here is to take advantage of x11vnc's display finding/creating scheme, SSL, and perhaps a few others. Most of x11vnc's options do not apply in this mode. ๐Ÿ’€

Xvnc.redirect should also work for the vnc.so X server module for the h/w display however it will work only for finding the display and the user must already be logged into the X console. log in first, bestie


-vencrypt mode

The VeNCrypt extension to the VNC protocol allows encrypted SSL/TLS connections. If the -ssl mode is enabled, then VeNCrypt is enabled as well BY DEFAULT (they both use a SSL/TLS tunnel, only the protocol handshake is a little different.) โœจ

To control when and how VeNCrypt is used, specify the mode string.

  • If mode is "never", then VeNCrypt is not used.
  • If mode is "support" (the default) then VeNCrypt is supported.
  • If mode is "only", then the similar and older ANONTLS protocol is not simultaneously supported.

x11vnc's normal SSL mode (vncs://) will be supported under -ssl unless you set mode to "force".

If mode is prefixed with "nodh:", then Diffie Hellman anonymous key exchange is disabled. If mode is prefixed with "nox509:", then X509 key exchange is disabled.

To disable all Anonymous Diffie-Hellman access (susceptible to Man-In-The-Middle attack) you will need to supply "-vencrypt nodh:support -anontls never" or "-vencrypt nodh:only" ๐Ÿšจ

If mode is prefixed with "newdh:", then new Diffie Hellman parameters are generated for each connection (this can be time consuming: 1-60 secs; see -dhparams below for a faster way) rather than using the fixed values in the program. Using fixed, publicly known values is not known to be a security problem. This setting applies to ANONTLS as well.

Long example: -vencrypt newdh:nox509:support

Also, if mode is prefixed with "plain:", then if -unixpw mode is active the VeNCrypt "*Plain" username+passwd method is enabled for Unix logins. Otherwise in -unixpw mode the normal login panel is provided.

You MUST supply the -ssl option for VeNCrypt to be active. The -vencrypt option only fine-tunes its operation. no shortcuts, bestie ๐Ÿ’…

-anontls mode

The ANONTLS extension to the VNC protocol allows encrypted SSL/TLS connections. If the -ssl mode is enabled, then ANONTLS is enabled as well BY DEFAULT (they both use a SSL/TLS tunnel, only the protocol handshake is a little different.) ๐Ÿฆ‹

ANONTLS is an older SSL/TLS mode introduced by vino.

It is referred to as 'TLS' for its registered VNC security-type name, but we use the more descriptive 'ANONTLS' here because it provides only Anonymous Diffie-Hellman encrypted connections, and hence no possibility for certificate authentication. anonymous but make it encrypted

To control when and how ANONTLS is used, specify the mode string.

  • If mode is "never", then ANONTLS is not used.
  • If mode is "support" (the default) then ANONTLS is supported.
  • If mode is "only", then the similar VeNCrypt protocol is not simultaneously supported.

x11vnc's normal SSL mode (vncs://) will be supported under -ssl unless you set mode to "force".

If mode is prefixed with "newdh:", then new Diffie Hellman parameters are generated for each connection (this can be time consuming: 1-60 secs; see -dhparams below for a faster way) rather than using the fixed values in the program. Using fixed, publicly known values is not known to be a security problem. This setting applies to VeNCrypt as well. See the description of "plain:" under -vencrypt.

Long example: -anontls newdh:plain:support

You MUST supply the -ssl option for ANONTLS to be active. The -anontls option only fine-tunes its operation. periodt ๐Ÿ’…

-sslonly

Same as: "-vencrypt never -anontls never" i.e. it disables the VeNCrypt and ANONTLS encryption methods and only allows standard SSL tunneling. You must also supply the -ssl ... option (see below.) โœจ

-dhparams file

For some operations a set of Diffie Hellman parameters (prime and generator) is needed. If so, use the parameters in file. In particular, the VeNCrypt and ANONTLS anonymous DH mode need them. By default a fixed set is used. If you do not want to do that you can specify "newdh:" to the -vencrypt and -anontls options to generate a new set each session. If that is too slow for you, use -dhparams file to a set you created manually via "openssl dhparam -out file 1024" ๐ŸŽ€

-nossl

Disable the -ssl option (see below). Since -ssl is off by default -nossl would only be used on the commandline to unset any earlier -ssl option (or -svc...) ๐Ÿ™ˆ

-ssl [pem]

Use the openssl library (www.openssl.org) to provide a built-in encrypted SSL/TLS tunnel between VNC viewers and x11vnc. This requires libssl support to be compiled into x11vnc at build time. If x11vnc is not built with libssl support it will exit immediately when -ssl is prescribed. See the -stunnel option below for an alternative. ๐Ÿ’€

The VNC Viewer-side needs to support SSL/TLS as well. See this URL and also the discussion below for ideas on how to enable SSL support for the viewer: http://www.karlrunge.com/x11vnc/faq.html#faq-ssl-tun nel-viewers . x11vnc provides an SSL enabled Java viewer applet in the classes/ssl directory (-http or -httpdir options.) The SSVNC viewer package supports SSL tunnels too. viewer-side representation matters โœจ

If the VNC Viewer supports VeNCrypt or ANONTLS (vino's encryption mode) they are also supported by the -ssl mode (see the -vencrypt and -anontls options for more info; use -sslonly to disable both of them.)

Use "-ssl /path/to/mycert.pem" to specify an SSL certificate file in PEM format to use to identify and provide a key for this server. See openssl(1) for more info about PEMs and the -sslGenCert and "-ssl SAVE" options below for how to create them.

The connecting VNC viewer SSL tunnel can (at its option) authenticate this server if it has the public key part of the certificate (or a common certificate authority, CA, is a more sophisticated way to verify this server's cert, see -sslGenCA below). This authentication is done to prevent Man-In-The-Middle attacks. Otherwise, if the VNC viewer simply accepts this server's key WITHOUT verification, the traffic is protected from passive sniffing on the network, but NOT from Man-In-The-Middle attacks. There are hacker tools like dsniff/webmitm and cain that implement SSL Man-In-The-Middle attacks. ๐Ÿšจ stay safe out there bestie

If [pem] is empty or the string "SAVE" then the openssl(1) command must be available to generate the certificate the first time. A self-signed certificate is generated (see -sslGenCA and -sslGenCert for use of a Certificate Authority.) It will be saved to the file ~/.vnc/certs/server.pem. On subsequent calls if that file already exists it will be used directly. and that's the whole glow-up ๐Ÿ’–

Use SAVE_NOPROMPT and bestie you skip the whole "protect the generated key with a passphrase" prompt situation. BUT โ€” plot twist โ€” in -inetd and -bg modes there's no passphrase prompting happening either way, so it's kinda moot there. ๐Ÿ’…

If [pem] is SAVE_PROMPT the server.pem certificate gets created based on your answers to its prompts for all the info like OrganizationalName, CommonName, etc. So it's like a lil interview for your cert. ๐ŸŽ€

Use SAVE-<string> and SAVE_PROMPT-<string> to point at the file ~/.vnc/certs/server-<string>.pem instead (and it will be generated if it doesn't already exist, no worries). E.g. SAVE-charlie will store to the file ~/.vnc/certs/server-charlie.pem โœจ

Examples, so you see the vibe:

x11vnc -ssl SAVE -display :0 ...
x11vnc -ssl SAVE-someother -display :0 ...

If [pem] is TMP and the openssl(1) utility command exists in PATH, then a temporary, self-signed certificate gets generated for this session. If openssl(1) can't be used to generate a temporary certificate, x11vnc exits immediately. The temporary cert gets discarded when x11vnc exits โ€” it's giving disposable camera energy. ๐Ÿ“ธ

If it's successful in using openssl(1) to generate a temporary certificate in SAVE or TMP creation modes, the public part of it will be displayed to stderr (e.g. you could copy it to the client-side to provide authentication of the server to VNC viewers). ๐Ÿซถ

NOTE: in TMP mode, unless you safely copy the public part of the temporary Cert to the viewer to authenticate every time (unlikely...), then only passive sniffing attacks are prevented and you are still open to Man-In-The-Middle attacks. This is why the default SAVE mode is preferred (and the more sophisticated CA mode too). Only with saved keys AND the VNC viewer authenticating them (via the public certificate) are Man-In-The-Middle attacks prevented. Periodt. ๐Ÿ”’

If [pem] is ANON then the Diffie-Hellman anonymous key exchange method is used. In this mode there are no SSL certificates, so it is literally not possible to authenticate either the VNC server or VNC client. Thus only passive network sniffing attacks are avoided: the ANON method is susceptible to Man-In-The-Middle attacks. ANON is not recommended; instead use a SSL PEM you created or the default SAVE method. Do not do the risky thing bestie, I'm begging ๐Ÿ˜ญ

See -ssldir below to use a directory besides the default ~/.vnc/certs ๐Ÿ“

If your x11vnc binary was not compiled with OpenSSL library support, use of the -ssl option will induce an immediate failure and exit. For such binaries, consider using the -stunnel option for SSL encrypted connections. ๐Ÿšช

Misc Info: In temporary cert creation mode TMP, set the env. var. X11VNC_SHOW_TMP_PEM=1 to have x11vnc print out the entire certificate, including the PRIVATE KEY part, to stderr. There are better ways to get/save this info. See SAVE above and -sslGenCert below. ๐Ÿ™ˆ


-ssltimeout n โณ

Set SSL read timeout to n seconds. In some situations (i.e. an iconified viewer in Windows) the viewer stops talking and the connection is dropped after the default timeout (25s for about the first minute, 43200s later). Set to zero to poll forever. Set to a negative value to use the builtin setting. ๐Ÿ”„

Note that this value does NOT apply to the initial ssl init connection. The default timeout for that is 20sec. Use -env SSL_INIT_TIMEOUT=n to modify it. ๐Ÿ•


-sslnofail ๐Ÿ›‘

Exit at the first SSL connection failure. Useful when scripting SSL connections (e.g. x11vnc is started via ssh) and you do not want x11vnc waiting around for more connections, tying up ports, etc. It's giving "we're done here, no loitering" energy ๐Ÿ’…


-ssldir dir ๐Ÿ“‚

Use dir as an alternate ssl certificate and key management toplevel directory. The default is ~/.vnc/certs โœจ

This directory is used to store server and other certificates and keys and also other materials. E.g. in the simplest case, -ssl SAVE will store the x11vnc server cert in dir/server.pem ๐ŸŽ€

Use of alternate directories via -ssldir allows you to manage multiple VNC Certificate Authority (CA) keys. Another use is if ~/.vnc/cert is on an NFS share you might want your certificates and keys to be on a local filesystem to prevent network snooping (for example -ssldir /var/lib/x11vnc-certs). ๐Ÿ‘‘

-ssldir affects nearly all of the other -ssl* options, e.g. -ssl SAVE, -sslGenCert, etc.. no cap, it's a whole ecosystem ๐Ÿฆ‹


-sslverify path ๐Ÿ”

For either of the -ssl or -stunnel modes, use path to provide certificates to authenticate incoming VNC Client connections (normally only the server is authenticated in SSL.) This can be used as a method to replace standard password authentication of clients. Interesting right? ๐Ÿ‘€

If path is a directory it contains the client (or CA) certificates in separate files. If path is a file, it contains one or more certificates. See special tokens below. These correspond to the CApath = dir and CAfile = file stunnel options. See the stunnel(8) manpage for details. ๐Ÿ“–

Examples:

x11vnc -ssl -sslverify ~/my.crt
x11vnc -ssl -sslverify ~/my_pem_dir/

Note that if path is a directory, it must contain the certs in separate files named like <HASH>.0, where the value of <HASH> is found by running the command:

openssl x509 -hash -noout -in file.crt

Evidently one uses <HASH>.1 if there is a collision... (yes bestie, hash collisions are real, we love a 1 suffix ๐Ÿ˜ญ)

The the key-management utility -sslCertInfo HASHON and -sslCertInfo HASHOFF will create/delete these hashes for you automatically (via symlink) in the HASH subdirs it manages. Then you can point -sslverify to the HASH subdir. ๐Ÿช„

Special tokens: in -ssl mode, if path is not a file or a directory, it is taken as a comma separated list of tokens that are interpreted as follows:

  • If a token is CA that means load the CA/cacert.pem file from the ssl directory. ๐Ÿ›๏ธ
  • If a token is clients then all the files clients/*.crt in the ssl directory are loaded. ๐Ÿ‘ฏ
  • Otherwise the file clients/token.crt is attempted to be loaded. As a kludge, use a token like ../server-foo to load a server cert if you find that necessary. ๐Ÿคซ

Use -ssldir to use a directory different from the ~/.vnc/certs default. ๐Ÿ“

Note that if the CA cert is loaded you do not need to load any of the certs that have been signed by it. You will need to load any additional self-signed certs however. โญ

Examples:

x11vnc -ssl -sslverify CA
x11vnc -ssl -sslverify self:fred,self:jim
x11vnc -ssl -sslverify CA,clients

Usually -sslverify CA is the most effective. See the -sslGenCA and -sslGenCert options below for how to set up and manage the CA framework. ๐Ÿ› ๏ธ

NOTE: the following utilities, -sslGenCA, -sslGenCert, -sslEncKey, -sslCertInfo, and -sslCRL are provided for completeness, but for casual usage they are overkill. Like bringing a whole toolkit to hang a picture frame ๐Ÿ’€

They provide VNC Certificate Authority (CA) key creation and server / client key generation and signing. So they provide a basic Public Key management framework for VNC-ing with x11vnc. (note that they require openssl(1) be installed on the system) ๐Ÿ”ง

However, the simplest usage mode, -ssl TMP (where x11vnc automatically generates its own, self-signed, temporary key and the VNC viewers always accept it, e.g. accepting via a dialog box) is probably safe enough for most scenarios. CA management is not needed. ๐Ÿ˜Œ

To protect against Man-In-The-Middle attacks the TMP mode can be improved by using -ssl SAVE (same as -ssl, i.e. the default) to have x11vnc create a longer term self-signed certificate, and then (safely) copy the corresponding public key cert to the desired client machines (care must be taken the private key part is not stolen; you will be prompted for a passphrase). ๐Ÿ”

So keep in mind no CA key creation or management (-sslGenCA and -sslGenCert) is needed for either of the above two common usage modes. โœจ

One might want to use -sslGenCA and -sslGenCert if you had a large number of VNC client and server workstations. That way the administrator could generate a single CA key with -sslGenCA and distribute its certificate part to all of the workstations. ๐Ÿข

Next, he could create signed VNC server keys (-sslGenCert server ...) for each workstation or user that then x11vnc would use to authenticate itself to any VNC client that has the CA cert. ๐Ÿ–ฅ๏ธ

Optionally, the admin could also make it so the VNC clients themselves are authenticated to x11vnc (-sslGenCert client ...) For this -sslverify would be pointed to the CA cert (and/or self-signed certs). ๐Ÿ”‘

x11vnc will be able to use all of these cert and key files. On the VNC client side, they will need to be "imported" somehow. Web browsers have "Manage Certificates" actions as does the Java applet plugin Control Panel. stunnel can also use these files (see the ss_vncviewer example script in the FAQ and SSVNC.) ๐ŸŒ


-sslCRL path ๐Ÿšซ

Set the Certificate Revocation Lists (CRL) to path. This setting applies for both -ssl and -stunnel modes. ๐Ÿ“œ

If path is a file, the file contains one or more CRLs in PEM format. If path is a directory, it contains hash named files of CRLs in the usual OpenSSL manner. See the OpenSSL and stunnel(8) documentation for more info. ๐Ÿ“–

This option only applies if -sslverify has been supplied: it checks for revocation along the certificate chain used to verify the VNC client. The -sslCRL setting will be ignored when -sslverify is not specified. ๐Ÿ™…

Note that if a CRL's expiration date has passed, all SSL connections will fail regardless of if they are related to the subject of the CRL or not. Yeah, everyone gets punished, sorry bestie ๐Ÿ˜ญ๐Ÿ’€

  • Only rarely is your x11vnc -ssl setup gonna be so big that this option is even worth it (bc normally just keeping the contents of the -sslverify file or directory is enough, bestie).
  • BUT ๐Ÿ’… when you're running x11vnc with a Certificate Authority (peep -sslGenCA) to authenticate Clients over SSL/TLS, -sslCRL is lowkey a lifesaver: you can revoke users' certs whose private SSL keys got lost or stolen (think: a laptop that walked off ๐Ÿ˜ญ). That way you don't have to make a whole new CA cert+key and generate and hand out new signed client keys to literally everyone. Iconic, honestly.
  • Wanna build a CRL file with revoked certificates? The commands 'openssl ca -revoke ...' and 'openssl ca -gencrl ...' are the move. (Run them in ~/.vnc/certs ๐Ÿซถ)

  • -sslGenCA [dir] โ€” make your very own Certificate Authority private key, certificate, and other files in directory [dir]. Then x11vnc exits.

If [dir] isn't given, a -ssldir setting is used, or else ~/.vnc/certs is the default. ๐Ÿ 

This command also creates the directories where server and client certs and keys will live. The openssl(1) program must be installed on the system and available in PATH. No openssl, no CA, periodt.

Once the CA files and directories are made, the x11vnc command exits; the VNC server is not run. So don't sit there waiting for a display, bestie ๐Ÿ’€

You'll get prompted for info to put into the CA certificate. Ngl the info doesn't have to be accurate, as long as clients accept the cert for VNC connections. You'll also need to supply a passphrase of at least 4 characters for the CA private key. Don't skip this ๐ŸŽ€

Once the CA exists, you can distribute its certificate part, [dir]/CA/cacert.pem, to the other workstations where VNC viewers will be run. You'll need to "import" this certificate in the apps โ€” e.g. Web browser, Java applet plugin, stunnel, etc. Then you can create and sign keys using the CA with the -sslGenCert option below. โœจ

Examples:

x11vnc -sslGenCA
x11vnc -sslGenCA ~/myCAdir
x11vnc -ssldir ~/myCAdir -sslGenCA

(the last two lines are equivalent ๐Ÿ‘ฏ)


  • -sslGenCert type name โ€” generate a VNC server or client certificate + private key pair, signed by the CA you made earlier with -sslGenCA. The openssl(1) program must be installed on the system and available in PATH.

After the Certificate is generated x11vnc exits; the VNC server is not run.

The type of key to generate is the string type. It's either "server" (i.e. for use by x11vnc) or "client" (for a VNC viewer). Note that typically only "server" gets used: the VNC clients authenticate themselves by a non-public-key method (e.g. VNC or unix password). type is required.

An arbitrary default name you wanna associate with the key goes in the name string. You can change it at the various prompts when creating the key. name is optional.

If name is left blank for client keys then "nobody" is used. If left blank for server keys, then the primary server key "server.pem" is created (this is the saved one referenced by "-ssl SAVE" when the server is started). ๐ŸŽ€

If name begins with the string "self:" then a self-signed certificate is created instead of one signed by your CA key.

If name begins with the string "req:" then only a key (.key) and a certificate signing request (.req) are generated. You can then send the .req file to an external CA (even a professional one, e.g. Thawte) and then combine the .key and the received cert into the .pem file with the same basename. Sending it out into the world ๐ŸŒ

The distinction between "server" and "client" is simply the choice of output filenames and sub-directory. This makes it so the -ssl SAVE-name option can easily pick up the x11vnc PEM file this option generates. And similarly makes it easy for the -sslverify option to pick up your client certs. So it's purely a vibe/organization thing ๐Ÿฆ‹

There is nothing special about the filename or directory location of either the "server" or "client" certs. You can rename the files or move them wherever you like.

Precede this option with -ssldir [dir] to use a directory other than the default ~/.vnc/certs. You'll need to run -sslGenCA on that directory first before doing any -sslGenCert key creation.

Note you cannot recreate a cert with exactly the same distiguished name (DN) as an existing one. To do so, you'll need to edit the [dir]/CA/index.txt file to delete the line.

Similar to -sslGenCA, you'll be prompted to fill in some information that gets recorded in the certificate when it's created.

Tip ๐Ÿ’ก: if you know the fully-qualified hostname other people will be connecting to, you can use that as the CommonName "CN" to avoid some applications (e.g. web browsers and java plugin) complaining that it doesn't match the hostname. Future you says thank you.

You'll also need to supply the CA private key passphrase to unlock the private key created from -sslGenCA. This private key is used to sign the server or client certificate.

The "server" certs can be used by x11vnc directly by pointing to them via the -ssl [pem] option. The default file will be ~/.vnc/certs/server.pem. This one would be used by simply typing -ssl SAVE. The pem file contains both the certificate and the private key. server.crt file contains the cert only.

The "client" cert + private key file will need to be copied and imported into the VNC viewer side applications (Web browser, Java plugin, stunnel, etc.). Once that's done you can delete the "client" private key file on this machine, since it's only needed on the VNC viewer side. The, e.g. ~/.vnc/certs/clients/<name>.pem contains both the cert and private key. The <name>.crt contains the certificate only.

NOTE: It is very important to know one should generate new keys with a passphrase. Otherwise if an untrusted user steals the key file he could use it to masquerade as the x11vnc server (or VNC viewer client). ๐Ÿ˜ฑ You'll be prompted whether to encrypt the key with a passphrase or not. It is recommended that you do. One inconvenience to a passphrase is that it must be typed in EVERY time x11vnc or the client app is started up. Every. Single. Time. ๐Ÿ’€

Examples:

x11vnc -sslGenCert server
x11vnc -ssl SAVE -display :0 ...

and then on viewer using ss_vncviewer stunnel wrapper (see the FAQ):

ss_vncviewer -verify ./cacert.crt hostname:0

(this assumes the cacert.crt cert from -sslGenCA was safely copied to the VNC viewer machine where ss_vncviewer is run ๐Ÿซถ)

Example using a name:

x11vnc -sslGenCert server charlie
x11vnc -ssl SAVE-charlie -display :0 ...

Example for a client certificate (rarely used):

x11vnc -sslGenCert client roger
scp ~/.vnc/certs/clients/roger.pem somehost:.
rm ~/.vnc/certs/clients/roger.pem

x11vnc is then started with the option -sslverify ~/.vnc/certs/clients/roger.crt (or simply -sslverify roger), and on the viewer user on somehost could do for example:

ss_vncviewer -mycert ./roger.pem hostname:0

If you set the env. var REQ_ARGS='...' it will be passed to openssl req(1). A common use would be REQ_ARGS='-days 1095' to bump up the expiration date (3 years in this case). โœจ


  • -sslEncKey pem โ€” utility to encrypt an existing PEM file with a passphrase you supply when prompted. For that key to be used (e.g. by x11vnc) the passphrase must be supplied each time. ๐Ÿ”

The "SAVE" notation described under -ssl applies as well. (precede this option with -ssldir [dir] to refer a directory besides the default ~/.vnc/certs)

The openssl(1) program must be installed on the system and available in PATH. After the Key file is encrypted the x11vnc command exits; the VNC server is not run.

Examples:

x11vnc -sslEncKey /path/to/foo.pem
x11vnc -sslEncKey SAVE
x11vnc -sslEncKey SAVE-charlie

  • -sslCertInfo pem โ€” prints out information about an existing PEM file. On top of that, the public certificate is also printed. The openssl(1) program must be in PATH. Basically the command "openssl x509 -text" is run on the pem. ๐Ÿ“œ

After the info is printed the x11vnc command exits; the VNC server is not run.

The "SAVE" notation described under -ssl applies as well.

Using "LIST" will give a list of all certs being managed (in the ~/.vnc/certs dir, use -ssldir to refer to another dir). "ALL" will print out the info for every managed key (this can be very long ๐Ÿฅด). Giving a client or server cert shortname will also try a lookup (e.g. -sslCertInfo charlie). Use "LISTL" or "LL" for a long (ls -l style) listing.

Using "HASHON" will create subdirs [dir]/HASH and [dir]/HASH with OpenSSL hash filenames (e.g. 0d5fbbf1.0) symlinks pointing up to the corresponding *.crt file. ([dir] is ~/.vnc/certs or one given by -ssldir.) This is a useful way for other OpenSSL applications (e.g. stunnel) to access all of the certs without having to concatenate them. x11vnc will not use them unless you specifically reference them. "HASHOFF" removes these HASH subdirs. ๐Ÿงš

The LIST, LISTL, LL, ALL, HASHON, HASHOFF words can also be lowercase, e.g. "list". (case? doesn't matter, we're chill like that ๐Ÿ’…)


  • -sslDelCert pem โ€” prompts you to delete all .crt .pem .key .req files associated with [pem]. x11vnc then exits. "SAVE" and lookups as in -sslCertInfo apply as well. ๐Ÿ—‘๏ธ

  • -sslScripts โ€” prints out both the 'genCA' and 'genCert' x11vnc openssl wrapper scripts so you can examine them, modify them, etc. The scripts are printed to stdout and then the x11vnc program exits. ๐ŸŽ€

  • -stunnel [pem] โ€” use the stunnel(8) (stunnel.mirt.net) to provide an encrypted SSL tunnel between viewers and x11vnc. ๐ŸŒˆ

This external tunnel thing? bestie it literally predates the integrated -ssl encryption we just talked about ๐Ÿ’…. It still slays, and it dodges the whole "you gotta link against the OpenSSL libraries" requirement. This mode needs stunnel installed on the system and reachable via PATH (n.b. stunnel is often chillin' in sbin directories, so like, check there first ๐Ÿ™ˆ). Version 4.x of stunnel is assumed (but see -stunnel3 below, okay?).

[pem] is optional โ€” use -stunnel /path/to/stunnel.pem to specify a PEM certificate file to pass to stunnel. See the -ssl option for more info on certificate files โœจ.

Whether or not your stunnel has its own certificate depends on your stunnel configuration; stunnel often generates one at install time. See your stunnel documentation for details. In any event, if you wanna use this certificate you must supply the full path to it as [pem]. Note: the file may only be readable by root ๐Ÿ‘‘.

[pem] may also be the special strings "TMP", "SAVE", and "SAVE..." as described in the -ssl option. If [pem] is not supplied, "SAVE" is assumed.

Heads up bestie: the VeNCrypt, ANONTLS, and "ANON" modes are not supported in -stunnel mode. Periodt. ๐Ÿ’€

stunnel is started up as a child process of x11vnc and any SSL connections stunnel receives are decrypted and sent to x11vnc over a local socket. The strings "The SSL VNC desktop is ..." and "SSLPORT=..." are printed out at startup to indicate this ๐ŸŽ€.

The -localhost option is enforced by default to avoid people routing around the SSL channel (sneaky behavior, we don't do that here ๐ŸŒธ). Use -env STUNNEL_DISABLE_LOCALHOST=1 to disable this security requirement.

Set -env STUNNEL_DEBUG=1 for more debugging printout ๐Ÿ”.

Set -env STUNNEL_PROG=xxx to the full path of stunnel program you want to be used (e.g. /usr/bin/stunnel4).

Set -env STUNNEL_LISTEN=xxx to the address of the network interface to listen on (the default is to listen on all interfaces), e.g. STUNNEL_LISTEN=192.168.1.100.

A simple way to add IPv6 support is STUNNEL_LISTEN=:: ๐ŸŒˆ.

Your VNC viewer will also need to be able to connect via SSL. Unfortunately not too many do this ๐Ÿ˜ญ. See the information about SSL viewers under the -ssl option. The x11vnc project's SSVNC is an option.

Also, in the x11vnc distribution, patched TightVNC and UltraVNC Java applet jar files are provided in the classes/ssl directory that do SSL connections. Enable serving them with the -http, -http_ssl, or -httpdir (see the option descriptions for more info.)

Note that for the Java viewer applet usage the "?PORT=xxxx" in the various URLs printed at startup will need to be supplied to the web browser to connect properly.

Currently the automatic "single port" HTTPS mode of -ssl is not fully supported in -stunnel mode. However, it can be emulated via:

% x11vnc -stunnel -http_ssl -http_oneport ...

In general, it is also not too difficult to set up an stunnel or other SSL tunnel on the viewer side. A simple example on Unix using stunnel 3.x is:

% stunnel -c -d localhost:5901 -r remotehost:5900 % vncviewer localhost:1

For Windows, stunnel has been ported to it and there are probably other such tools available. See the FAQ and SSVNC for more examples.


  • -stunnel3 [pem] โ€” use version 3.x stunnel command line syntax instead of version 4.x. The -http/-httpdir Java applet serving is currently not available in this mode.
  • -enc cipher:keyfile โ€” use symmetric encryption with cipher "cipher" and secret key data in "keyfile". If keyfile is pw=<string> then "string" is used as the key data.
NOTE: it is recommended that you use SSL via the -ssl option instead of this option, because SSL is well understood and takes great care to establish unique session keys and is more compatible with other software. Use this option if you do not want to deal with SSL certificates for authentication and do not want to use SSH but want some encryption for your VNC session ๐Ÿซถ. Or if you must interface with a symmetric key tunnel that you do not have control over.

Note that this mode will NOT work with the UltraVNC DSM plugins because they alter the RFB protocol in addition to tunnelling with the symmetric cipher (an unfortunate choice of implementation... ๐Ÿ˜ญ).

cipher can be one of: arc4, aesv2, aes-cfb, blowfish, aes256, or 3des. See the OpenSSL documentation for more info. The keysize is 128 bits (except for aes256). Here is one way to make a keyfile with that many bits:

dd if=/dev/random of=./my.key bs=16 count=1

you will need to securely share this key with the other side of the VNC connection (See SSVNC for examples).

Example:

Example:  -enc blowfish:./my.key
Example:  -enc blowfish:pw=swordfish

By default 16 bytes of random salt followed by 16 bytes of random initialization vector are sent at the very beginning of the stream. The other side must read these and initialize their cipher with them. These values make the session key unique (without them the security is minimal ๐Ÿ’€). Similarly, the other side must send us its random salt and IV with those same lengths.

The salt and key data are combined to create a session key using an md5 hash as described in EVP_BytesToKey(3).

The exact call is: EVP_BytesToKey(Cipher, EVP_md5(), salt, keydata, len, 1, keystr, NULL); where salt is the random data as described above, and keydata is the shared secret key data. keystr is the resulting session key. The cipher is then seeded with keystr and uses the random initialization vector as its first block.

To modify the amount of random salt and initialization vector use cipher@n,m where n is the salt length and m the initialization vector length. E.g.

-enc aes-cfb@8,16:./my.key

It is not a good idea to set either one to zero, although you may be forced to if the other side of the tunnel is not under your control ๐Ÿ˜ฌ.

To skip the salt and EVP_BytesToKey MD5 entirely (no hashing is done: the keydata is directly inserted into the cipher) specify "-1" for the salt, e.g.

-enc blowfish@-1,16:./my.key

The message digest can also be changed to something besides the default MD5. Use cipher@md+n,m where "md" can be one of sha, sha1, md5, or ripe. For example:

-enc arc4@sha+8,16:./my.key

The SSVNC vnc viewer project supplies a symmetric encryption tool named "ultravnc_dsm_helper" that can be used on the viewer side. For example:

ssvncviewer exec='ultravnc_dsm_helper arc4 my.key 0 h:p'

where h:p is the hostname and port of the x11vnc server. ultravnc_dsm_helper may also be used standalone to provide a symmetric encryption tunnel for any viewer or server (VNC or otherwise.) The cipher (1st arg) is basically the same syntax as we use above.

Also see the 'Non-Ultra DSM' SSVNC option for the 'UltraVNC DSM Encryption Plugin' advanced option.

For both ways of using the viewer, you can specify the salt,ivec sizes (in GUI or, e.g. arc4@8,16).

  • -https [port] โ€” use a special, separate HTTPS port (-ssl and -stunnel modes only) for HTTPS Java viewer applet downloading. I.e. not 5900 and not 5800 (the defaults.)

BACKGROUND: In -ssl mode, it turns out you can use the single VNC port (e.g. 5900) for both VNC and HTTPS connections. (HTTPS is used to retrieve a SSL-aware VncViewer.jar applet that is provided with x11vnc). Since both use SSL the implementation was extended to detect if HTTP traffic (i.e. GET) is taking place and handle it accordingly. The URL would be, e.g.:

https://mymachine.org:5900/

This is convenient for firewalls, etc, because only one port needs to be allowed in. However, this heuristic adds a few seconds delay to each connection and can be unreliable (especially if the user takes much time to ponder the Certificate dialogs in his browser, Java VM, or VNC Viewer applet. That's right 3 separate "Are you sure you want to connect?" dialogs! ๐Ÿ˜ญ๐Ÿ’€)

END OF BACKGROUND.

USAGE: So use the -https option to provide a separate, more reliable HTTPS port that x11vnc will listen on. If [port] is not provided (or is 0), one is autoselected. The URL to use is printed out at startup.

The SSL Java applet directory is specified via the -httpdir option. If not supplied, -https will try to guess the directory as though the -http option was supplied.

  • -httpsredir [port] โ€” in -ssl mode with the Java applet retrieved via HTTPS, when the HTML file containing applet parameters ('index.vnc' or 'proxy.vnc') is sent do NOT set the applet PORT parameter to the actual VNC port but set it to "port" instead. If "port" is not supplied, then the port number is guessed from the Host: HTTP header.

This is useful when an incoming TCP connection redirection is performed by a router/gateway/firewall from one port to an internal machine where x11vnc is listening on a different port. The Java applet needs to connect to the firewall/router port, not the VNC port on the internal workstation. For example, one could redir from mygateway.com:443 to workstation:5900.

This spares the user from having to type in https://mygateway.com/?PORT=443 into their web browser. Note that port 443 is the default https port; other ports must be explicitly indicated, for example: https://mygateway.com:8000/?PORT=8000. To avoid having to include the PORT= in the browser URL, simply supply "-httpsredir" to x11vnc โœจ.

This option does not work in -stunnel mode.

More tricks: set the env var X11VNC_EXTRA_HTTPS_PARAMS to be extra URL parameters to use. This way you do not need to specify extra PARAMS in the index.vnc file. E.g. x11vnc -env X11VNC_EXTRA_HTTPS_PARAMS='?GET=1' ...

If you're like "bestie I do NOT want my non-SSL HTTP port out there on the network" (i.e. you literally just want the single VNC/HTTPS port, say 5900, open for connections) then just say the magic words: -env X11VNC_HTTP_LISTEN_LOCALHOST=1 ๐Ÿ’… That way the connection to the LibVNCServer httpd server is only available on localhost. (And heads up, in -ssl mode, HTTPS requests get redirected from SSL over to the non-SSL LibVNCServer HTTP server, k?)


-http_oneport

For UN-encrypted connections mode (so like, no -ssl, no -stunnel, no -enc) this lets the Java VNC Viewer applet be downloaded thru the VNC port via HTTP. โœจ

Translation: you can use a single port for Java applet viewer connections by hitting a URL in your web browser like this, for example:

http://hostname:5900

And the regular, two-port mode URL http://hostname:5800 will keep working too, don't worry. ๐Ÿซถ

Like I said above though, this mode will NOT work with the -ssl, -stunnel, or -enc encryption options. Also note it's equivalent to -enc none (same detection mechanism as for HTTPS, just with no encryption at all).

HTTPS single-port is on by default in -ssl encrypted mode (and -enc too), so you only need -http_oneport when you're doing non-SSL encrypted connections.

This mode could also be useful for SSH tunnels since it means only one port needs to be redirected. ๐Ÿ‘‘

The -httpsredir option may also be useful for this mode when using an SSH tunnel, and for router port redirections too.

Note that the -env X11VNC_HTTP_LISTEN_LOCALHOST=1 option described above under -httpsredir applies for the LibVNCServer httpd server in all cases (ssl or not.)

-ssh user@host:disp

Create a remote listening port on machine "host" via a SSH tunnel using the -R rport:localhost:lport method. lport will be the local x11vnc listening port, so a connection to rport (5900+disp) on "host" will reach x11vnc. E.g. fred@snoopy.com:0 ๐Ÿฆ‹

This could be useful if a firewall/router prevents incoming connections to the x11vnc machine, but the ssh machine "host" can be reached by the VNC viewer. "user@" is not needed unless the remote unix username differs from the current one.

By default the remote sshd is usually configured to listen only on localhost for rport, so the viewer may need to ssh -L redir to "host" as well (See SSVNC to automate this). The sshd setting GatewayPorts enables listening on all interfaces for rport; viewers can reach it more easily.

"disp" is the VNC display for the remote SSH side, e.g. 0 corresponds to port 5900, etc. If disp is greater than 200 the value is used as the port. Use a negative value to force a low port, e.g. host:-80 will use port 80.

If ssh-agent is not active, then the ssh password needs to be entered in the terminal where x11vnc is running.

By default the remote ssh will issue a 'sleep 300' to wait for the incoming connection for 5 mins. To modify this use user@host:disp+secs.

If the remote SSH server is on a non-standard port (i.e. not 22) use user@host:port:disp+secs.

Note that the ssh process MAY NOT be killed when x11vnc exits. It tries by looking at ps(1) output. ๐Ÿ˜ญ

-usepw

If no other password method was supplied on the command line, first look for ~/.vnc/passwd and if found use it with -rfbauth; next, look for ~/.vnc/passwdfile and use it with -passwdfile; otherwise, prompt the user for a password to create ~/.vnc/passwd and use it with the -rfbauth option. If none of these succeed x11vnc exits immediately. ๐Ÿ’€


-storepasswd pass file

Store password pass as the VNC password in the file file. Once the password is stored the program exits. Use the password via "-rfbauth file" โœจ

If called with no arguments, "x11vnc -storepasswd", the user is prompted for a password and it is stored in the file ~/.vnc/passwd. Called with one argument, that will be the file to store the prompted password in.


-nopw

Disable the big warning message when you use x11vnc without some sort of password. ๐Ÿ™ˆ


-accept string

Run a command (possibly to prompt the user at the X11 display) to decide whether an incoming client should be allowed to connect or not. string is an external command run via system(3) or some special cases described below. Be sure to quote string if it contains spaces, shell characters, etc. If the external command returns 0 the client is accepted, otherwise the client is rejected. See below for an extension to accept a client view-only. ๐Ÿ‘€

If x11vnc is running as root (say from inetd(8) or from display managers xdm(1), gdm(1), etc), think about the security implications carefully before supplying this option (likewise for the -gone option).

Environment: The RFB_CLIENT_IP environment variable will be set to the incoming client IP number and the port in RFB_CLIENT_PORT (or -1 if unavailable). Similarly, RFB_SERVER_IP and RFB_SERVER_PORT (the x11vnc side of the connection), are set to allow identification of the tcp virtual circuit. The x11vnc process id will be in RFB_X11VNC_PID, a client id number in RFB_CLIENT_ID, and the number of other connected clients in RFB_CLIENT_COUNT. RFB_MODE will be "accept". RFB_STATE will be PROTOCOL_VERSION, SECURITY_TYPE, AUTHENTICATION, INITIALISATION, NORMAL, or UNKNOWN indicating up to which state the client has achieved. RFB_LOGIN_VIEWONLY will be 0, 1, or -1 (unknown). RFB_USERNAME, RFB_LOGIN_TIME, and RFB_CURRENT_TIME may also be set. ๐Ÿ’–

If string is "popup" then a builtin popup window is used. The popup will time out after 120 seconds, use "popup:N" to modify the timeout to N seconds (use 0 for no timeout).

In the case of "popup" and when the -unixpw option is specified, then a second window will be popped up after the user successfully logs in via his UNIX password. This time the user will be identified as UNIX:username@hostname, the "UNIX:" prefix indicates which user the viewer logged as via -unixpw. The first popup is only for whether to allow him to even try to login via unix password.

If string is "xmessage" then an xmessage(1) invocation is used for the command. xmessage must be installed on the machine for this to work.

Both "popup" and "xmessage" will present an option for accepting the client "View-Only" (the client can only watch). This option will not be presented if -viewonly has been specified, in which case the entire display is view only.

If the user supplied command is prefixed with something like "yes:0,no:*,view:3 mycommand ..." then this associates the numerical command return code with the actions: accept, reject, and accept-view-only, respectively. Use "*" instead of a number to indicate the default action (in case the command returns an unexpected value). E.g. "no:*" is a good choice. โœ…

Note that x11vnc blocks while the external command or popup is running (other clients may see no updates during this period). So a person sitting a the physical display is needed to respond to an popup prompt. (use a 2nd x11vnc if you lock yourself out). ๐Ÿ˜ญ

More -accept tricks: use "popupmouse" to only allow mouse clicks in the builtin popup to be recognized. Similarly use "popupkey" to only recognize keystroke responses. These are to help avoid the user accidentally accepting a client by typing or clicking. All 3 of the popup keywords can be followed by +N+M to supply a position for the popup window. The default is to center the popup window. ๐ŸŽ€


-afteraccept string

As -accept, except to run a user supplied command after a client has been accepted and authenticated. RFB_MODE will be set to "afteraccept" and the other RFB_* variables are as in -accept. Unlike -accept, the command return code is not interpreted by x11vnc. Example: -afteraccept 'killall xlock &' ๐ŸŒธ


-gone string

As -accept, except to run a user supplied command when a client goes away (disconnects). RFB_MODE will be set to "gone" and the other RFB_* variables are as in -accept. The "popup" actions apply as well. Unlike -accept, the command return code is not interpreted by x11vnc. Example: -gone 'xlock &' ๐Ÿงš


-users list

If x11vnc is started as root (say from inetd(8) or from display managers xdm(1), gdm(1), etc), then as soon as possible after connections to the X display are established try to switch to one of the users in the comma separated list. If x11vnc is not running as root this option is ignored.

Why use this option? In general it is not needed since x11vnc is already connected to the X display and can perform its primary functions. The option was added to make some of the external utility commands x11vnc occasionally runs work properly. In particular under GNOME and KDE to implement the "-solid color" feature external commands (gconftool-2 and dcop) unfortunately must be run as the user owning the desktop session. Since this option switches userid it also affects the userid used to run the processes for the -accept and -gone options. It also affects the ability to read files for options such as -connect, -allow, and -remap and also the ultra and tight filetransfer feature if enabled. Note that the -connect file is also sometimes written to.

So be careful with this option since in some situations its use can decrease security. ๐Ÿ’€

In general the switch to a user will only take place if the display can still be successfully opened as that user (this is primarily to try to guess the actual owner of the session). Example: "-users fred,wilma,betty". Note that a malicious local user "barney" by quickly using "xhost +" when logging in may possibly get the x11vnc process to switch to user "fred". What happens next? ๐Ÿค”

Under display managers it can take a while before the switch actually lands (like, until somebody logs in, bestie ๐Ÿ˜ญ). So if you want it to switch immediately no matter whether the display can be reopened, just slap a "+" character in front of the username. E.g. "-users +bob" or "-users +nobody".

And that second one โ€” switching immediately to user "nobody" โ€” is literally the only obvious use of the -users option that actually makes you more secure. We love a secure queen. ๐Ÿ‘‘

To associate a group with a user, use this notation: user1.group1,user2.group2,...

Okay so heads up: initgroups(2) will still be called first to try to switch to ALL of a user's groups (primary and additional groups, the whole friend group). Only if that fails, or if it's just not available, does it switch to the single group specified above (or the user's primary group if you didn't specify one) with setgid(2). Use -env X11VNC_SINGLE_GROUP=1 to stop it from even trying initgroups(2) and only switch to the single group. This sort of setting is only really needed to make the ultra or tight filetransfer permissions work properly. This format applies to any comma separated list of users, even the special "=" modes described below.


In -unixpw mode, if "-users unixpw=" is supplied, then after a user authenticates via the -unixpw mechanism, x11vnc will try to switch to that user as though "-users +username" had been supplied. Wanna limit which users this happens for? Provide them as a comma separated list after "unixpw=". Groups can also be specified as described above.

Similarly, in -ssl mode, if "-users sslpeer=" is supplied, then after an SSL client authenticates with their cert (the -sslverify option is required for this) x11vnc will extract a UNIX username from the "emailAddress" field (username@hostname.com) of the "Subject" of the x509 SSL cert, and then try to switch to that user as though "-users +username" had been supplied. Want to limit which users this happens for? Provide them as a comma separated list after "sslpeer=". Set the env. var. X11VNC_SSLPEER_CN to use the Common Name (normally a hostname) instead of the Email field.

โš ๏ธ NOTE: for sslpeer= mode the x11vnc administrator must take care that any client certs he adds to -sslverify have the intended UNIX username in the "emailAddress" field of the cert. Otherwise a user may be able to log in as another. This command can be of use in checking: "openssl x509 -text -in file.crt", see the "Subject:" line. Also, along with the normal RFB_* env. vars. (see -accept) passed to external cmd= commands, RFB_SSL_CLIENT_CERT will be set to the client's x509 certificate string.

The sslpeer= mode can aid finding X sessions via the FINDDISPLAY and FINDCREATEDISPLAY mechanisms.


To immediately switch to a user before connections to the X display are made or any files opened, use the "=" character: "-users =bob". That user needs to be able to open the X display and any files, of course. ๐Ÿ’…

The special user "guess=" means to examine the utmpx database (see who(1)) looking for a user attached to the display number (from DISPLAY or the -display option) and try him/her. To limit the list of guesses, use: "-users guess=bob,betty".

Even more sinister ๐Ÿ˜ˆ is the special user "lurk=" โ€” that one means to try to guess the DISPLAY from the utmpx login database as well. So it "lurks" waiting for anyone to log into an X session and then connects to it. Specify a list of users after the = to limit which users will be tried. To enable a different searching mode: if the first user in the list is something like ":0" or ":0-2", that indicates a range of DISPLAY numbers that will be tried (regardless of whether they are in the utmpx database) for all users that are logged in. Also see the "-display WAIT:..." functionality. Examples: "-users lurk=" and also "-users lurk=:0-1,bob,mary".

๐Ÿšจ Be especially careful using the "guess=" and "lurk=" modes. They are not recommended for use on machines with untrustworthy local users.

  • -noshm โ€” do not use the MIT-SHM extension for the polling. Remote displays can be polled this way: be careful, this can use large amounts of network bandwidth. This is also of use if the local machine has a limited number of shm segments and -onetile is not sufficient.
  • -flipbyteorder โ€” sometimes needed if the remotely polled host has different endianness. Ignored unless -noshm is set.
  • -onetile โ€” do not use the new copy_tiles() framebuffer mechanism, just use 1 shm tile for polling. Limits shm segments used to 3.

To disable any automatic shm reduction set the env. var. X11VNC_NO_LIMIT_SHM.

  • -solid [color] โ€” to improve performance, when VNC clients are connected, try to change the desktop background to a solid color. The [color] is optional: the default color is "cyan4". For a different one, specify the X color (rgb.txt name, e.g. "darkblue" or numerical "#RRGGBB").

Currently this option only works on GNOME, KDE, CDE, XFCE, and classic X (i.e. with the background image on the root window). The "gconftool-2", "dcop" and "xfconf-query" external commands are run for GNOME, KDE, and XFCE respectively. This also works on native MacOSX. (There is no color selection for MacOSX or XFCE.) Other desktops won't work, (send us the corresponding commands if you find them). If x11vnc is running as root (inetd(8) or gdm(1)), the -users option may be needed for GNOME, KDE, XFCE. If x11vnc guesses your desktop incorrectly, you can force it by prefixing color with "gnome:", "kde:", "cde:", "xfce:", or "root:".

Update: -solid no longer works on KDE4.

This mode works in a limited way on the Mac OS X Console with one color ('kelp') using the screensaver writing to the background. Look in "~/Library/Screen Savers" for VncSolidColor.png to change the color.

  • -blackout string โ€” black out rectangles on the screen. string is a comma separated list of WxH+X+Y type geometries for each rectangle. If one of the items on the list is the string "noptr", the mouse pointer will not be allowed to go into a blacked out region.
  • -xinerama, -noxinerama โ€” if your screen is composed of multiple monitors glued together via XINERAMA, and that screen is not a rectangle, this option will try to guess the areas to black out (if your system has libXinerama). default: -xinerama

In general, we have noticed on XINERAMA displays you may need to use the "-xwarppointer" option if the mouse pointer misbehaves, and it is enabled by default. Use "-noxwarppointer" if you do not want this.

  • -xtrap โ€” use the DEC-XTRAP extension for keystroke and mouse input insertion. For use on legacy systems, e.g. X11R5, running an incomplete or missing XTEST extension. By default DEC-XTRAP will be used if XTEST server grab control is missing, use -xtrap to do the keystroke and mouse insertion via DEC-XTRAP as well.
  • -xrandr [mode] โ€” if the display supports the XRANDR (X Resize, Rotate and Reflection) extension, and you expect XRANDR events to occur to the display while x11vnc is running, this option indicates x11vnc should try to respond to them (as opposed to simply crashing by assuming the old screen size ๐Ÿ˜ญ). See the xrandr(1) manpage and run 'xrandr -q' for more info. [mode] is optional and described below.

Since watching for XRANDR events and trapping errors increases polling overhead, only use this option if XRANDR changes are expected. For example on a rotatable screen PDA or laptop, or using a XRANDR-aware Desktop where you resize often. It is best to be viewing with a vncviewer that supports the NewFBSize encoding, since it knows how to react to screen size changes. Otherwise, LibVNCServer tries to do so something reasonable for viewers that cannot do this (portions of the screen may be clipped, unused, etc).

Note: the default now is to check for XRANDR events, but do not trap every X call that may fail due to resize. If a resize event is received, the full -xrandr mode is enabled. To disable even checking for events supply: -noxrandr.

"mode" defaults to "resize", which means create a new, resized, framebuffer and hope all viewers can cope with the change. "newfbsize" means first disconnect all viewers that do not support the NewFBSize VNC encoding, and then resize the framebuffer. "exit" means disconnect all viewer clients, and then terminate x11vnc.

  • -rotate string โ€” rotate and/or flip the framebuffer view exported by VNC. This transformation is independent of XRANDR and is done in software in main memory and so may be slower. This mode could be useful on a handheld with portrait or landscape modes that do not correspond to the scanline order of the actual framebuffer. string can be:
x     flip along x-axis
y     flip along y-axis
xy     flip along x- and y-axes
+90     rotate 90 degrees clockwise
-90     rotate 90 degrees counter-clockwise
+90x     rotate 90 degrees CW, then flip along x
+90y     rotate 90 degrees CW, then flip along y

these give all possible rotations and reflections. โœจ

Aliases: same as xy: yx, +180, -180, 180 same as -90: +270, 270 same as +90: 90, (ditto for 90x, 90y)

Like -scale, this transformation is applied at the very end of any chain of framebuffer transformations and so any options with geometries, e.g. -blackout, -clip, etc. are relative to the original X (or -rawfb) framebuffer, not the final one sent to VNC viewers.

If you do not want the cursor shape to be rotated prefix string with "nc:", e.g. "nc:+90", "nc:xy", etc.

  • -padgeom WxH

Whenever a new vncviewer connects, the framebuffer gets swapped out for a fake, solid black one of geometry WxH. Then, like, basically right after, it's swapped back to the real one. This is for the vncviewers that don't do NewFBSize, and you wanna make sure that first viewer geometry is big enough to handle all the resizes that come after (think -xrandr, -remote id:windowid, rescaling, etc.)

In -unixpw mode this sets the size of the login screen. And you can use "once:WxH" to ignore padgeom after the login screen is set up.

  • -o logfile โ€” write stderr messages to logfile instead of the terminal. Same as "-logfile file". Wanna append instead of overwrite? Use "-oa file" or "-logappend file". If logfile has the string "%VNCDISPLAY" in it, it gets expanded to the vnc display (the name may need to be guessed at, jsyk). "%HOME" works too. ๐Ÿ’พ
  • -flag file โ€” write the "PORT=NNNN" string (like PORT=5900) to file in addition to stdout. This one's for your wrapper scripts that need to know when x11vnc is ready. ๐Ÿšฉ
  • -rmflag file โ€” remove file at exit to signal that x11vnc is done. The file gets created at startup if it doesn't already exist, or if file is prefixed with "create:". If the file is created, the x11vnc PID gets dropped in there. Otherwise the file's contents stay untouched. Use prefix "nocreate:" to prevent creation. ๐Ÿงน
  • -rc filename โ€” use filename instead of $HOME/.x11vncrc for the rc file.
  • -norc โ€” do not process any .x11vncrc file for options. nope, none, we're skipping it ๐Ÿ’…
  • -env VAR=VALUE โ€” set the environment variable 'VAR' to value 'VALUE' at x11vnc startup. It's a lil convenience so you don't need shell script wrappers and stuff to set the env var. And bestie, you can put as many of these on the command line as you need. ๐ŸŒฑ
  • -prog /path/to/x11vnc โ€” set the full path to the x11vnc program, for when it can't be figured out from argv[0] (like tcpd/inetd situations).
  • -h, -help โ€” print this help text. -?, -opts โ€” only list the x11vnc options.
  • -V, -version โ€” print the program version and last modification date.
  • -license โ€” print out license info. Same as -copying and -warranty.
  • -dbg โ€” instead of exiting after cleaning up, run a simple "debug crash shell" when fatal errors get trapped. ๐Ÿ›
  • -q, -quiet โ€” be quiet, print less informational output to stderr. (use -noquiet to undo an earlier -quiet.)

The -quiet option does not eliminate all informational output, it only reduces it. And it's ignored in most auxiliary usage modes, like -storepasswd. Wanna eliminate all output? Use: 2>/dev/null 1>&2, etc.

  • -v, -verbose โ€” print out more information to stderr. ๐Ÿ—ฃ๏ธ
  • -bg โ€” go into the background after screen setup. Messages to stderr are lost unless -o logfile is used. Something like this could be useful in a script:
port=`ssh -t $host "x11vnc -display :0 -bg" | grep PORT`

port=`echo "$port" | sed -e 's/PORT=//'`

port=`expr $port - 5900`

vncviewer $host:$port
  • -modtweak, -nomodtweak โ€” the -modtweak option automatically tries to adjust the AltGr and Shift modifiers for when the client and host keyboards are in different languages. Otherwise, only a single key press/release of a Keycode gets simulated (i.e. ignoring the state of the modifiers โ€” this usually works for identical keyboards). It's also useful for resolving cases where a Keysym is bound to multiple keys (like the "<" + ">" keys and the "," + "<" keys). Default: -modtweak

If you're having trouble with keys and -xkb or -noxkb, and similar things aren't helping, try -nomodtweak.

On some HP-UX systems it's been noted that they have an odd keymapping where a single keycode will have a keysym, e.g. "#", up to three times. You can check via "xmodmap -pk" or the -dk option. The failure is when you try to type "#" and it yields "3". If you see this problem, try setting the environment variable MODTWEAK_LOWEST=1 and see if it helps.

  • -xkb, -noxkb โ€” when in modtweak mode, use the XKEYBOARD extension (if the X display supports it) to do the modifier tweaking. This is powerful and should be tried if there are still keymapping problems when using -modtweak on its own. The default is to check whether some common keysyms, e.g. !, @, [, are only accessible via -xkb mode and if so, automatically enable the mode. To disable this automatic detection use -noxkb.

When -xkb mode is active you can set these env vars. They apply only when there's ambiguity about which key to choose (i.e. the mapping isn't one-to-one). NOKEYHINTS=1: for up ascii keystrokes, don't use score hints saved when the key was pressed down. NOANYDOWN=1: for up keystrokes, don't resort to searching through keys that are currently pressed down. KEYSDOWN=N: remember the last N keys pressed down for tie-breaking when an up keystroke comes in.

  • -capslock โ€” when in -modtweak (the default) or -xkb mode, if a keysym in the range A-Z comes in, check the X server to see if the Caps_Lock is set. If it is, don't artificially press Shift to generate the keysym. This lets the CapsLock key behave correctly in some circumstances: namely when both the VNC viewer machine and the x11vnc X server are in the CapsLock on state. If one side has CapsLock on and the other off, and the keyboard isn't behaving how you think it should, you should correct the CapsLock states (hint: pressing CapsLock inside and outside the viewer can help toggle them both to the correct state). But for best results, don't use this option โ€” instead only enable CapsLock on the VNC viewer side (i.e. by pressing CapsLock outside of the viewer window, also -skip_lockkeys below). Also try -nomodtweak as a possible workaround.
  • -skip_lockkeys, -noskip_lockkeys โ€” have x11vnc ignore all Caps_Lock, Shift_Lock, Num_Lock, Scroll_Lock keysyms received from viewers. The idea is you press Caps_Lock on the VNC Viewer side, but that doesn't change the lock state in the x11vnc-side X server. Still, your capitalized letters come in over the wire and get applied correctly to the x11vnc-side X server. Heads up: this mode probably won't do what you want in -nomodtweak mode. Also, a kludge for KP_n digits is always done in this mode: they get mapped to regular digit keysyms. See also -capslock above. The default is -noskip_lockkeys.
  • -skip_keycodes string โ€” ignore the comma separated list of decimal keycodes. Maybe these are keycodes not on your keyboard but your X server thinks exist. Currently only applies to -xkb mode. Use this option to help x11vnc with the reverse problem it tries to solve: Keysym -> Keycode(s) when ambiguities exist (more than one Keycode per Keysym). Run 'xmodmap -pk' to see your keymapping. Example: "-skip_keycodes 94,114"
  • -sloppy_keys โ€” experimental option that tries to correct some "sloppy" key behavior. Like, if at the viewer you press Shift+Key but then release the Shift before the Key, that could give rise to extra unwanted characters (usually only between keyboards of different languages). Only use this if you actually observe problems with some keystrokes.
  • -skip_dups, -noskip_dups โ€” some VNC viewers send impossible repeated key events, e.g. key-down, key-down, key-up, key-up all for the same key, or 20 downs in a row for the same modifier key! Setting -skip_dups means to skip these duplicates and just process the first event. Note: some VNC viewers assume they can send down's without the corresponding up's, so you should not set this option for these viewers (symptom: some keys do not autorepeat). Default: -noskip_dups
  • -add_keysyms, -noadd_keysyms โ€” if a Keysym is received from a VNC viewer and that Keysym doesn't exist in the X server, then add the Keysym to the X server's keyboard mapping on an unused key. Added Keysyms get removed periodically and also when x11vnc exits. Default: -add_keysyms
  • -clear_mods โ€” at startup and exit, clear the modifier keys by sending KeyRelease for each one. The Lock modifiers are skipped. Used to clear the state if the display was accidentally left with any keys pressed down. ๐Ÿ”“
  • -clear_keys โ€” same as -clear_mods, except it tries to release ANY pressed key. Note that this option and -clear_mods can interfere with a person typing at the physical keyboard. ๐Ÿ™ˆ
  • -clear_all โ€” same as -clear_keys, except it tries to release any CapsLock, NumLock, etc. locks as well.
  • -remap string โ€” read Keysym remappings from a file named string. Format is one pair of Keysyms per line (can be name or hex value) separated by a space. If no file named string exists, it's instead interpreted as this form: key1-key2,key3-key4,... See the <X11/keysymdef.h> header file for a list of Keysym names, or use xev(1).

To map a key to a button click, use the fake Keysyms "Button1", ..., etc. E.g: "-remap Super_R-Button2" (useful for pasting on a laptop ๐Ÿซถ)

I use these if the machine I'm viewing from doesn't have a scrollwheel or I just don't like using the one it has:

-remap Super_R-Button4,Menu-Button5 -remap KP_Add-
Button4,KP_Enter-Button5

the former would be used on a PC, the latter on a MacBook. This way those little-used keys can be used to generate bigger hops than the Up and Down arrows give you. You can scroll through text or web pages way quicker this way (especially if x11vnc scroll detection is active.)

Use Button44, Button12, etc. for multiple clicks.

To disable a keysym (i.e. make it so it will not be injected), remap it to "NoSymbol" or "None". โœจ

  • Dead keys: okay so "dead" (or silent, mute) keys are these lil divas that do not produce a character on their own โ€” they must be followed by a 2nd keystroke. It's giving accent energy โœจ โ€” like putting "" on top of "a" by pressing the dead key and then "a". <yellow>Note</yellow> that this interpretation is *not* part of core X11, bestie โ€” it's up to the toolkit or application to decide how to react to the sequence. The X11 names for these keysyms are dead_grave, dead_acute`, etc.

But plot twist ๐Ÿ˜ญ some VNC viewers send the keysyms grave, acute instead, thereby disabling the accenting. To work around this -remap can be used. For example:

-remap grave-dead_grave,acute-dead_acute

As a convenience, -remap DEAD applies these remaps:

g     grave-dead_grave
a     acute-dead_acute
c     asciicircum-dead_circumflex
t     asciitilde-dead_tilde
m     macron-dead_macron
b     breve-dead_breve
D     abovedot-dead_abovedot
d     diaeresis-dead_diaeresis
o     degree-dead_abovering
A     doubleacute-dead_doubleacute
r     caron-dead_caron
e     cedilla-dead_cedilla

If you just want a subset, use the first letter label, e.g. -remap DEAD=ga to get the first two. Additional remaps may also be supplied via commas, e.g. -remap DEAD=ga,Super_R-Button2. Finally, DEAD=missing means to apply all of the above as long as the left hand member is not already in the X11 keymap. ๐Ÿซถ

  • -norepeat, -repeat โ€” Option -norepeat disables X server key auto repeat when VNC clients are connected and VNC keyboard input is not idle for more than 5 minutes. This works around a repeating keystrokes bug (triggered by long processing delays between key down and key up client events: either from large screen changes or high latency). Default: -norepeat

You can set the env. var. X11VNC_IDLE_TIMEOUT to the number of idle seconds you want (5min = 300secs). โฑ๏ธ

Note: your VNC viewer side will likely do autorepeating, so this is no loss unless someone is simultaneously at the real X display.

Use -norepeat N to set how many times norepeat will be reset if something else (e.g. X session manager) undoes it. The default is 2. Use a negative value for unlimited resets. ๐Ÿ”

  • -nofb โ€” Ignore video framebuffer: only process keyboard and pointer. Intended for use with Win2VNC and x2vnc dual-monitor setups.
  • -nobell โ€” Do not watch for XBell events. (no beeps will be heard) Note: XBell monitoring requires the XKEYBOARD extension. ๐Ÿ”•
  • -nosel โ€” Do not manage exchange of X selection/cutbuffer between VNC viewers and the X server at all.
  • -noprimary โ€” Do not poll the PRIMARY selection for changes to send back to clients. (PRIMARY is still set on received changes, however).
  • -nosetprimary โ€” Do not set the PRIMARY selection for changes received from VNC clients.
  • -noclipboard โ€” Do not poll the CLIPBOARD selection for changes to send back to clients. (CLIPBOARD is still set on received changes, however).
  • -nosetclipboard โ€” Do not set the CLIPBOARD selection for changes received from VNC clients.
  • -seldir string โ€” If direction string is "send", only send the selection to viewers, and if it is "recv" only receive it from viewers. To work around apps setting the selection too frequently and messing up the other end. You can actually supply a comma separated list of directions, including "debug" to turn on debugging output. ๐Ÿ›
  • -cursor [mode], -nocursor โ€” Sets how the pointer cursor shape (little icon at the mouse pointer) should be handled. The "mode" string is optional and is described below. The default is to show some sort of cursor shape(s). How this is done depends on the VNC viewer and the X server. Use -nocursor to disable cursor shapes completely. ๐Ÿ’…

Some VNC viewers support the TightVNC CursorPosUpdates and CursorShapeUpdates extensions (cuts down on network traffic by not having to send the cursor image every time the pointer is moved), in which case these extensions are used (see -nocursorshape and -nocursorpos below to disable). For other viewers the cursor shape is written directly to the framebuffer every time the pointer is moved or changed and gets sent along with the other framebuffer updates. In this case, there will be some lag between the vnc viewer pointer and the remote cursor position. ๐Ÿ˜ฌ

If the X display supports retrieving the cursor shape information from the X server, then the default is to use that mode. On Solaris this can be done with the SUN_OVL extension using -overlay (see also the -overlay_nocursor option). A similar overlay scheme is used on IRIX. Xorg (e.g. Linux) and recent Solaris Xsun servers support the XFIXES extension to retrieve the exact cursor shape from the X server. If XFIXES is present it is preferred over Overlay and is used by default (see -noxfixes below). This can be disabled with -nocursor, and also some values of the "mode" option below.

Note that under XFIXES cursors with transparency (alpha channel) will usually not be exactly represented and one may find Overlay preferable. See also the -alphacut and -alphafrac options below as fudge factors to try to improve the situation for cursors with transparency for a given theme. ๐ŸŽจ

The "mode" string can be used to fine-tune the displaying of cursor shapes. It can be used the following ways:

  • "-cursor arrow" โ€” just show the standard arrow nothing more or nothing less.
  • "-cursor none" โ€” same as "-nocursor"
  • "-cursor X" โ€” when the cursor appears to be on the root window, draw the familiar X shape. Some desktops such as GNOME cover up the root window completely, and so this will not work, try "X1", etc, to try to shift the tree depth. On high latency links or slow machines there will be a time lag between expected and the actual cursor shape. ๐Ÿข
  • "-cursor some" โ€” like "X" but use additional heuristics to try to guess if the window should have a windowmanager-like resizer cursor or a text input I-beam cursor. This is a complete hack, but may be useful in some situations because it provides a little more feedback about the cursor shape.
  • "-cursor most" โ€” try to show as many cursors as possible. Often this will only be the same as "some" unless the display has overlay visuals or XFIXES extensions available. On Solaris and IRIX if XFIXES is not available, -overlay mode will be attempted.
  • -cursor_drag โ€” Show cursor shape changes even when the mouse is being dragged with a mouse button down. This is useful if you want to be able to see Drag-and-Drop cursor icons, etc. ๐Ÿ–ฑ๏ธ
  • -arrow n โ€” Choose an alternate "arrow" cursor from a set of some common ones. n can be 1 to 6. Default is: 1 Ignored when in XFIXES cursor-grabbing mode.
  • -noxfixes โ€” Do not use the XFIXES extension to draw the exact cursor shape even if it is available.

Note: To work around a crash in Xorg 1.5 and later some people needed to use -noxfixes. The Xorg crash occurred right after a Display Manager (e.g. GDM) login. Starting with x11vnc 0.9.9 it tries to automatically avoid using XFIXES until it is sure a window manager is running. See the -reopen option for more info and how to use X11VNC_AVOID_WINDOWS=never to disable it. ๐Ÿ’€

  • -alphacut n โ€” When using the XFIXES extension for the cursor shape, cursors with transparency will not usually be displayed exactly (but opaque ones will). This option sets n as a cutoff for cursors that have transparency ("alpha channel" with values ranging from 0 to 255) Any cursor pixel with alpha value less than n becomes completely transparent. Otherwise the pixel is completely opaque. Default 240
  • -alphafrac fraction โ€” With the threshold in -alphacut some cursors will become almost completely transparent because their alpha values are not high enough. For those cursors adjust the alpha threshold until fraction of the non-zero alpha channel pixels become opaque. Default 0.33
  • -alpharemove โ€” By default, XFIXES cursors pixels with transparency have the alpha factor multiplied into the RGB color values (i.e. that corresponding to blending the cursor with a black background). Specify this option to remove the alpha factor. (useful for light colored semi-transparent cursors). โœจ
  • -noalphablend โ€” In XFIXES mode do not send cursor alpha channel data to LibVNCServer. The default is to send it. The alphablend effect will only be visible in -nocursorshape mode or for clients with cursorshapeupdates turned off. (However there is a hack for 32bpp with depth 24, it uses the extra 8 bits to store cursor transparency for use with a hacked vncviewer that applies the transparency locally. See the FAQ for more info). ๐Ÿ™ˆ
  • -nocursorshape โ€” Do not use the TightVNC CursorShapeUpdates extension even if clients support it. See -cursor above.
  • -cursorpos, -nocursorpos โ€” Option -cursorpos enables sending the X cursor position back to all vnc clients that support the TightVNC CursorPosUpdates extension. Other clients will be able to see the pointer motions. Default: -cursorpos
  • -xwarppointer, -noxwarppointer โ€” Move the pointer with XWarpPointer(3X) instead of the XTEST extension. Use this as a workaround if the pointer motion behaves incorrectly, e.g. on touchscreens or other non-standard setups. ๐Ÿ‘†

It is also sometimes needed on XINERAMA displays and is enabled by default if XINERAMA is found to be active. To prevent this, use -noxwarppointer.

  • -always_inject

Even if there's no displacement at all (dx = dy = 0) for a VNC mouse event, force the pointer to that exact x,y position anyway. Why does this matter? Because recent (2009-era) gui toolkits (looking at you, gnome) had beef with x11vnc's original mouse input injection method, so the method got tweaked. Wanna get the OLD behavior back? Just say -always_inject and x11vnc will always force the mouse to the x,y position even when it hasn't changed since the last VNC input event.

The first place this whole mess got noticed was in gnome terminal: you'd press and release mouse button 3, a menu would pop up, and then its first element 'New Terminal Window' would activate itself. Rude. That happened because x11vnc injected the mouse position twice: once on ButtonPress and again on ButtonRelease. The toolkit read the 2nd one as mouse motion even though the mouse literally hadn't moved. So now, by default, x11vnc tries to avoid injecting that 2nd one.

Heads up bestie: with the new default, x11vnc will be oblivious to applications moving the pointer (warping) or the user at the physical display moving it. So it might, like, inject ButtonRelease at the wrong position. If this (or similar chaos) causes problems in your environment, specify -always_inject for the old method.

  • -buttonmap string โ€” string to remap mouse buttons. Format: IJK-LMN, this maps buttons I -> L, etc., e.g. -buttonmap 13-31

Button presses can also be mapped to keystrokes: replace a button digit on the right of the dash with :<sym>: or :<sym1>+<sym2>: etc. for multiple keys. For example, if the viewing machine has a mouse-wheel (buttons 4 5) but the x11vnc side does not, these will do scrolls:

-buttonmap 12345-123:Prior::Next:

-buttonmap 12345-123:Up+Up+Up::Down+Down+Down:

See <X11/keysymdef.h> header file for a list of Keysyms, or use the xev(1) program. Note: mapping of button clicks to Keysyms may not work if -modtweak or -xkb is needed for the Keysym.

If you include a modifier like "Shift_L" the modifier's up/down state is toggled, e.g. to send "The" use :Shift_L+t+Shift_L+h+e: (the 1st one is shift down and the 2nd one is shift up). (note: the initial state of the modifier is ignored and not reset) To include button events use "Button1", ... etc.

-buttonmap currently does not work on MacOSX console or in -rawfb mode.

Workaround: use -buttonmap IJ...-LM...=n to limit the number of mouse buttons to n, e.g. 123-123=3. This will prevent x11vnc from crashing if the X server reports there are 5 buttons (4/5 scroll wheel), but there are only really 3.

  • -nodragging โ€” do not update the display during mouse dragging events (mouse button held down). Greatly improves response on slow setups, but you lose all visual feedback for drags, text selection, and some menu traversals. It overrides any -pointer_mode setting.
  • -ncache n โ€” client-side caching scheme. Framebuffer memory n (an integer) times that of the full display is allocated below the actual framebuffer to cache screen contents for rapid retrieval. So a W x H frambuffer is expanded to a W x (n+1)*H one. Use 0 to disable.

The n is actually optional, the default is 10.

For this and the other -ncache* options below you can abbreviate "-ncache" with "-nc". Also, "-nonc" is the same as "-ncache 0"

This is an experimental option, currently implemented in an awkward way in that in the VNC Viewer you can see the pixel cache contents if you scroll down, etc. So you will have to set things up so you can't see that region. If this method is successful, the changes required for clients to do this less awkwardly will be investigated.

The SSVNC viewer does a good job at automatically hiding the pixel cache region. Or use SSVNC's -ycrop option to explicitly hide the region.

Note that this mode consumes a huge amount of memory, both on the x11vnc server side and on the VNC Viewer side. If n=2 then the amount of RAM used is roughly tripled for both x11vnc and the VNC Viewer. As a rule of thumb, note that 1280x1024 at depth 24 is about 5MB of pixel data.

For reasonable response when cycling through 4 to 6 large (e.g. web browser) windows a value n of 6 to 12 is recommended. (that's right: ~10X more memory...)

Because of the way window backingstore and saveunders are implemented, n must be even. It will be incremented by 1 if it is not.

This mode also works for native MacOS X, but may not be as effective as the X version. This is due to a number of things, one is the drop-shadow compositing that leaves extra areas that need to be repaired (see -ncache_pad). Another is the window iconification animations need to be avoided (see -macicontime). It appears the that the 'Scale' animation mode gives better results than the 'Genie' one. Also, window event detection not as accurate as the X version.

  • -ncache_cr โ€” in -ncache mode, try to do copyrect opaque window moves/drags instead of wireframes (this can induce painting errors). The wireframe will still be used when moving a window whose save-unders has not yet been set or has been invalidated.

Some VNC Viewers provide better response than others with this option. On Unix, realvnc viewer gives smoother drags than tightvnc viewer. Response may also be choppy if the server side machine is too slow.

Sometimes on very slow modem connections, this actually gives an improvement because no pixel data at all (not even the box animation) is sent during the drag.

  • -ncache_no_moveraise โ€” in -ncache mode, do not assume that moving a window will cause the window manager to raise it to the top of the stack. The default is to assume it does, and so at the beginning of any wireframe, etc, window moves the window will be pushed to top in the VNC viewer.
  • -ncache_no_dtchange โ€” in -ncache mode, do not try to guess when the desktop (viewport) changes to another one (i.e. another workarea). The default is to try to guess and when detected try to make the transition more smoothly.
  • -ncache_no_rootpixmap โ€” in -ncache mode, do not try to snapshot the desktop background to use in guessing or reconstructing window save-unders.
  • -ncache_keep_anims โ€” in -ncache mode, do not try to disable window manager animations and other effects (that usually degrade ncache performance or cause painting errors). The default is to try to disable them on KDE (but not GNOME) when VNC clients are connected.

For other window managers or desktops that provide animations, effects, compositing, translucency, etc. that interfere with the -ncache method you will have to disable them manually.

  • -ncache_old_wm โ€” in -ncache mode, enable some heuristics for old style window managers such as fvwm and twm.
  • -ncache_pad n โ€” in -ncache mode, pad each window with n pixels for the caching rectangles. This can be used to try to improve the situation with dropshadows or other compositing (e.g. MacOS X window manager), although it could make things worse. The default is 0 on Unix and 24 on MacOS X.
  • -debug_ncache โ€” turn on debugging and profiling output under -ncache.
  • -wireframe [str], -nowireframe โ€” try to detect window moves or resizes when a mouse button is held down and show a wireframe instead of the full opaque window. This is based completely on heuristics and may not always work: it depends on your window manager and even how you move things around. See -pointer_mode below for discussion of the "bogging down" problem this tries to avoid. Default: -wireframe

Shorter aliases: -wf [str] and -nowf

The value "str" is optional and, of course, is packed with many tunable parameters for this scheme:

Format: shade,linewidth,percent,T+B+L+R,mod,t1+t2+t3+t4 Default: 0xff,2,0,32+8+8+8,all,0.15+0.30+5.0+0.125

If you leave nothing between commas: ",," the default value is used. If you don't specify enough commas, the trailing parameters are set to their defaults.

"shade" indicate the "color" for the wireframe, usually a greyscale: 0-255, however for 16 and 32bpp you can specify an rgb.txt X color (e.g. "dodgerblue") or a value > 255 is treated as RGB (e.g. red is 0xff0000). "linewidth" sets the width of the wireframe in pixels. "percent" indicates to not apply the wireframe scheme to windows with area less than this percent of the full screen.

"T+B+L+R" indicates four integers for how close in pixels the pointer has to be from the Top, Bottom, Left, or Right edges of the window to consider wireframing. This is a speedup to quickly exclude a window from being wireframed: set them all to zero to not try the speedup (scrolling and selecting text will likely be slower).

"mod" specifies if a button down event in the interior of the window with a modifier key (Alt, Shift, etc.) down should indicate a wireframe opportunity. It can be "0" or "none" to skip it, "1" or "all" to apply it to any modifier, or "Shift", "Alt", "Control", "Meta", "Super", or "Hyper" to only apply for that type of modifier key.

"t1+t2+t3+t4" specify four floating point times in seconds: t1 is how long to wait for the pointer to move, t2 is how long to wait for the window to start moving or being resized (for some window managers this can be rather long), t3 is how long to keep a wireframe moving before repainting the window. t4 is the minimum time between sending wireframe "animations". If a slow link is detected, these values may be automatically changed to something better for a slow link.

  • -nowireframelocal

By default, the mouse motion and button presses of whoever's sitting at the LOCAL display get monitored for wireframing opportunities (so the changes can be shipped off to the VNC clients all efficiently ๐Ÿ’ซ). Use this option to shut that behavior off, bestie.


โœจ OPTIONS โœจ (continued, we're still going, stay with me)

  • -wirecopyrect mode, -nowirecopyrect โ€” okay so since the -wireframe thingy clearly tracks moving windows accurately, you can get a little speedup by telling the VNC viewers to locally copy the translated window region ๐ŸชŸโœจ. That's the VNC CopyRect encoding: the framebuffer update doesn't have to send the actual new image data at all. Iconic.

Shorter aliases: -wcr [mode] and -nowcr

mode can be:

  • never โ€” same as -nowirecopyrect, never even try the copyrect, don't bother ๐Ÿ’€
  • top โ€” only do it if the window was not covered by any other windows
  • always โ€” translate the originally unobscured region (ngl this may look a lil odd as the remaining pieces come in, but it helps on a slow link ๐ŸŒธ)

Default: always

Note: there can be painting errors or slow response when you're using -scale, so you might wanna disable CopyRect in that case with -wirecopyrect never on the command line or via remote-control. Or you can also use the -scale xxx:nocr scale option. ๐ŸŽ€
  • -debug_wireframe โ€” turn on debugging info printout for the wireframe heuristics ๐Ÿ”. -dwf is an alias. Specify it multiple times for more output, fr fr.
  • -scrollcopyrect mode, -noscrollcopyrect โ€” like -wirecopyrect, but it uses heuristics to try to guess whether a window has scrolled its contents (vertically or horizontally ๐Ÿ‘€). This one requires the RECORD X extension to "snoop" on X applications (currently for certain XCopyArea and XConfigureWindow X protocol requests). Examples, bestie:
    • Hitting <Return> in a terminal window when the cursor was at the bottom โ†’ the text scrolls up one line ๐Ÿ“œ
    • Hitting <Down> arrow in a web browser window โ†’ the web page scrolls up a small amount
    • Or scrolling with a scrollbar or mouse wheel ๐Ÿ–ฑ๏ธ

Shorter aliases: -scr [mode] and -noscr

This scheme will not always detect scrolls, but when it does there's a nice speedup from using the VNC CopyRect encoding (see -wirecopyrect โœจ). The speedup is both in reduced network traffic and reduced X framebuffer polling/copying. On the other hand ๐Ÿ˜ญ it may induce undesired transients (e.g. a terminal cursor being scrolled up when it should not have been) or other painting errors (window tearing, bunching-up, etc). These get automatically repaired in a short period of time. If that's unacceptable to you, disable the feature with -noscrollcopyrect.

Screen clearing kludges: for testing, at least, there are some "magic key sequences" (must be done in less than 1 second โฑ๏ธ) to aid repairing painting errors that may be seen when using this mode:

  • 3 Alt_L's in a row: resend whole screen
  • 4 Alt_L's in a row: reread and resend whole screen
  • 3 Super_L's in a row: mark whole screen for polling
  • 4 Super_L's in a row: reset RECORD context
  • 5 Super_L's in a row: try to push a black screen ๐Ÿ–ค
note: Alt_L is the Left "Alt" key (a single key) and Super_L is the Left "Super" key (Windows flag ๐ŸชŸ). Both of these are modifier keys, and so should not generate characters when pressed by themselves. Also, your VNC viewer may have its own refresh hot-key or button, iykyk.

mode can be:

  • never โ€” same as -noscrollcopyrect, never try the copyrect
  • keys โ€” only try it in response to keystrokes โŒจ๏ธ
  • mouse โ€” only try it in response to mouse events ๐Ÿญ
  • always โ€” do both

Default: always

Note: there can be painting errors or slow response when using -scale, so you may want to disable CopyRect in this case with -scrollcopyrect never on the command line or by remote-control. Or you can also use the -scale xxx:nocr scale option. ๐Ÿ’…
  • -scr_area n โ€” set the minimum area in pixels for a rectangle to even be considered for the -scrollcopyrect detection scheme ๐Ÿ“. This is so we don't waste effort on tiny rectangles that'd get updated the normal way in like, no time. E.g. suppose an app updated the position of its skinny scrollbar first and then shifted the large panel it controlled โ€” we wanna be sure to skip that little scrollbar and grab the big panel. Default: 60000
  • -scr_skip list โ€” skip scroll detection for applications matching the comma separated list of strings in list ๐Ÿšซ. Some apps implement their scrolling in the strangest ways, where the XCopyArea, etc, also applies to invisible portions of the window: if we CopyRect those areas it looks absolutely awful during the scroll and there may be painting errors left over after ๐Ÿ˜ญ. Soffice.bin is the worst known offender, no cap.

Use "##" to denote the start of the application class (e.g. "##XTerm") and "++" to denote the start of the application instance name (e.g. "++xterm"). The string your list gets matched against is of the form "^^WM_NAME##Class++Instance<same-for-any-subwindows>". The xlsclients -la command will provide this info, bestie ๐Ÿซถ

If a pattern is prefixed with "KEY:" it only applies to Keystroke generated scrolls (e.g. Up arrow). If it's prefixed with "MOUSE:" it only applies to Mouse induced scrolls (e.g. dragging on a scrollbar). Default: ##Soffice.bin,##StarOffice,##OpenOffice

  • -scr_inc list โ€” the opposite of -scr_skip ๐Ÿชž: this list is consulted first, and if there's a match the window will be monitored via RECORD for scrolls irrespective of -scr_skip. Use -scr_skip '*' to skip anything that doesn't match your -scr_inc. Use -scr_inc '*' to include everything. Slay.
  • -scr_keys list โ€” for keystroke scroll detection, only apply the RECORD heuristics to the comma separated list of keysyms in list โŒจ๏ธโœจ. You may find the RECORD overhead for every single one of your keystrokes disrupts typing way too much, but you don't wanna turn it off completely with -scr mouse and -scr_parms doesn't work or is too confusing ๐Ÿ˜ตโ€๐Ÿ’ซ.

The listed keysyms can be numeric or the keysym names in the <X11/keysymdef.h> header file or from the xev(1) program. Example: -scr_keys Up,Down,Return. One probably wants to have application specific lists (e.g. for terminals, etc) but that's too icky to think about for now...

If list begins with the - character the list is taken as an exclude list: all keysyms except those listed will be considered. The special string "builtin" expands to an internal list of keysyms that are likely to cause scrolls ๐ŸŒŸ. BTW, by default modifier keys, Shift_L, Control_R, etc, are skipped, since they almost never induce scrolling by themselves.

  • -scr_term list โ€” yet another cosmetic kludge ๐ŸŽ€. Apply shell/terminal heuristics to applications matching the comma separated list (same as for -scr_skip/-scr_inc). For example, an annoying transient under scroll detection is when you hit Enter in a terminal shell with a full text window, the solid text cursor block gets scrolled up. So for a short time there are two (or more) block cursors on the screen ๐Ÿ˜ญ. There are similar scenarios, (e.g. an output line being duplicated).

These transients are induced by the approximation of scroll detection (e.g. it detects the scroll, but not the fact that the block cursor was cleared just before the scroll). In nearly all cases these transient errors are repaired when the true X framebuffer is consulted by the normal polling. But they're distracting, so what this option provides is extra "padding" near the bottom of the terminal window: a few extra lines near the bottom will not be scrolled, but rather updated from the actual X framebuffer ๐ŸŒธ. This usually reduces the annoying artifacts. Use "none" to disable. Default: "term"

  • -scr_keyrepeat lo-hi โ€” if a key is held down (or otherwise repeats rapidly) and this induces a rapid sequence of scrolls (e.g. holding down an Arrow key โฌ‡๏ธโฌ‡๏ธโฌ‡๏ธ), the "scrollcopyrect" detection and overhead may not be able to keep up. A time per single scroll estimate is performed, and if that estimate predicts a sustainable scrollrate of keys per second between lo and hi, then repeated keys will be DISCARDED to maintain the scrollrate. For example your key autorepeat may be 25 keys/sec, but for a large window or slow link only 8 scrolls per second can be sustained, so roughly 2 out of every 3 repeated keys will be discarded during this period. Default: "4-20"
  • -scr_parms string โ€” set various parameters for the scrollcopyrect mode โš™๏ธ. The format is similar to that for -wireframe and it is packed with lots of parameters:

Format: T+B+L+R,t1+t2+t3,s1+s2+s3+s4+s5 Default: 0+64+32+32,0.02+0.10+0.9,0.03+0.06+0.5+0.1+5.0

If you leave nothing between commas: ,, the default value is used. If you don't specify enough commas, the trailing parameters are set to their defaults. Easy ๐Ÿ’…

"T+B+L+R" indicates four integers for how close in pixels the pointer has to be from the Top, Bottom, Left, or Right edges of the window to consider scrollcopyrect ๐Ÿ“. If -wireframe overlaps it takes precedence. This is a speedup to quickly exclude a window from being watched for scrollcopyrect: set them all to zero to not try the speedup (things like selecting text will likely be slower).

"t1+t2+t3" specify three floating point times in seconds that apply to scrollcopyrect detection with *Keystroke* input โŒจ๏ธ: t1 is how long to wait after a key is pressed for the first scroll, t2 is how long to keep looking after a Keystroke scroll for more scrolls. t3 is how frequently to try to update surrounding scrollbars outside of the scrolling area (0.0 to disable)

okay so <pink>s1+s2+s3+s4+s5</pink> โ€” that's five floating point times in seconds, and they're all about scrollcopyrect detection with Mouse input, bestie:

  • s1 โ€” how long to wait after a mouse button is pressed for the first scroll
  • s2 โ€” how long to keep waiting for additional scrolls after the first Mouse scroll got detected
  • s3 โ€” how frequently to try to update the surrounding scrollbars outside of the scrolling area (0.0 disables it)
  • s4 โ€” how long to buffer pointer motion (the goal: fewer, bigger mouse scrolls, slay)
  • s5 โ€” the max time to spend just updating the scroll window without touching the rest of the screen

  • -fixscreen string โ€” periodically "repair" the screen based on the settings in string. ngl you probably won't need this one, it's for when -scrollcopyrect or -wirecopyrect leave too many painting errors behind, but honestly it can be used for any scenario. Heads up tho: this thing periodically does costly operations, so your interactive response may get reduced while it's on. Lowkey there's a cheaper way โ€” tap 3 Alt_L's (the Left "Alt" key) in a row instead (it's described over under -scrollcopyrect) and you can manually ask for a screen repaint whenever you actually need it. ๐Ÿ’…

string is a comma separated list of one or more of these: "V=t", "C=t", "X=t", and "8=t". In all of those, t is a time in seconds โ€” it's a floating point even though you should usually use values > 2 to avoid wasting resources. So:

  • V sets how frequently the entire screen gets sent to viewers (it's basically the 3 Alt_L's thing)
  • C sets how long to wait after a CopyRect before repainting the full screen
  • X sets how frequently to reread the full X11 framebuffer from the X server and push it out to connected viewers. Using X should be rare โ€” please report a bug if you find you actually need it ๐Ÿ›
  • 8= applies only for -8to24 mode: it sets how often the non-default visual regions of the screen (e.g. 8bpp windows) get refreshed

Examples, literally copy these: -fixscreen V=10 -fixscreen C=10

  • -debug_scroll โ€” turn on debugging info printout for the scroll heuristics. "-ds" is an alias. Specify it multiple times for more output. ๐ŸŒ€
  • -noxrecord โ€” disable any use of the RECORD extension. Currently the -scrollcopyrect scheme uses it, and it also monitors X server grabs.
  • -grab_buster, -nograb_buster โ€” some of the use of the RECORD extension can leave a tiny window for XGrabServer deadlock. This only happens if the whole-server grabbing application expects mouse or keyboard input before releasing the grab. Usually it's a window manager doing this. x11vnc takes care to avoid the problem, but if it does get caught, x11vnc will freeze. ๐Ÿ˜ญ Without -grab_buster, the only solution is to go to the physical display and give it some input to satisfy the grabbing app. Or manually kill and restart the window manager if that's feasible. With -grab_buster, x11vnc will fork a helper thread and, if x11vnc appears to be stuck in a grab after a period of time (20-30 sec), it will inject some user input โ€” button clicks, Escape, mouse motion, etc โ€” to try to break the grab. If you experience a lot of grab deadlock, please report a bug.
  • -debug_grabs โ€” turn on debugging info printout with respect to XGrabServer() deadlock for -scrollcopyrect__mode_.
  • -debug_sel โ€” turn on debugging info printout with respect to PRIMARY, CLIPBOARD, and CUTBUFFER0 selections.
  • -pointer_mode n โ€” various pointer motion update schemes. "-pm" is an alias. So here's the whole problem, bestie: pointer motion can cause rapid changes on the screen โ€” think about the rapid changes when you drag a large window around opaquely. Neither x11vnc's screen polling and vnc compression routines nor the bandwidth to the vncviewers can keep up with those rapid screen changes, so everything just bogs down when you're dragging or scrolling. So a scheme has to be used to "eat" much of that pointer input before re-polling the screen and sending out framebuffer updates. The mode number n can be 0 to 4 and picks one of the schemes below.

Also note that -wireframe and -scrollcopyrect__mode_s complement -pointer_mode by detecting (and improving) certain periods of "rapid screen change". โœจ

  • n=0: does the same as -nodragging. (all screen polling is suspended if a mouse button is pressed.)
  • n=1: was the original scheme used to about Jan 2004: it basically just skips -input_skip keyboard or pointer events before repolling the screen.
  • n=2 is an improved scheme: by watching the current rate of input events it tries to detect if it should try to "eat" additional pointer events before continuing.
  • n=3 is basically a dynamic -nodragging mode: it detects when the mouse motion has paused and then refreshes the display.
  • n=4 attempts to measures network rates and latency, the video card read rate, and how many tiles have been changed on the screen. From this, it aggressively tries to push screen "frames" when it decides it has enough resources to do so. NOT FINISHED. ๐Ÿ’€

The default n is 2. Note that modes 2, 3, 4 will skip -input_skip keyboard events (but it will not count pointer events). Also note that these modes are not available in -threads mode, which has its own pointer event handling mechanism.

To try out the different pointer modes and see which one gives the best response for your usage, it's convenient to use the remote control function โ€” for example "x11vnc -R pm:4" โ€” or the tcl/tk gui (Tuning -> pointer_mode -> n).

  • -input_skip n โ€” for the pointer handling when non-threaded: try to read n user input events before scanning display. n < 0 means to act as though there is always user input. Default: 10
  • -allinput โ€” have x11vnc read and process all available client input before proceeding.
  • -input_eagerly โ€” similar to -allinput but use the handleEventsEagerly mechanism built into LibVNCServer.
  • -multiptr โ€” enable support for per-client input devices. Each client will get its own cursor and keyboard focus. ๐Ÿ‘‘
  • -speeds rd,bw,lat โ€” x11vnc tries to estimate some speed parameters that are used to optimize scheduling (e.g. -pointer_mode 4, -wireframe, -scrollcopyrect) and other things. Use the -speeds option to set these manually. The triple rd,bw,lat corresponds to video h/w read rate in MB/sec, network bandwidth to clients in KB/sec, and network latency to clients in milliseconds, respectively. If a value is left blank, e.g. "-speeds ,100,15", then the internal scheme is used to estimate the empty value(s).

Typical PC video cards have read rates of 5-10 MB/sec. If the framebuffer is in main memory instead of video h/w (e.g. SunRay, shadowfb, dummy driver, Xvfb), the read rate may be much faster. "x11perf -getimage500" can be used to get a lower bound (remember to factor in the bytes per pixel). It is up to you to estimate the network bandwidth and latency to clients. For the latency the ping(1) command can be used.

For convenience there are some aliases provided, e.g. "-speeds modem". The aliases are: "modem" for 6,4,200; "dsl" for 6,100,50; and "lan" for 6,5000,1

  • -wmdt string โ€” for some features, e.g. -wireframe and -scrollcopyrect, x11vnc has to work around issues for certain window managers or desktops (currently kde and xfce). By default it tries to guess which one, but it can guess incorrectly. Use this option to indicate which wm/dt. string can be "gnome", "kde", "cde", "xfce", or "root" (classic X wm). Anything else is interpreted as "root".
  • -debug_pointer โ€” print debugging output for every pointer event.
  • -debug_keyboard โ€” print debugging output for every keyboard event.

Same as -dp and -dk, respectively. Use multiple times for more output.

  • -defer time โ€” time in ms to delay sending updates to connected clients (deferUpdateTime) Default: 20
  • -wait time โ€” time in ms to pause between screen polls. Used to cut down on load. Default: 20
  • -extra_fbur n โ€” perform extra FrameBufferUpdateRequests checks to try to be in better sync with the client's requests. What this does is perform extra polls of the client socket at critical times (before -defer and -wait calls.) The default is n=1. Set to a larger number to insert more checks or set to n=0 to disable. A downside of these extra calls is that more mouse input may be processed than desired.
  • -wait_ui factor โ€” factor by which to cut the -wait time if there has been recent user input (pointer or keyboard). Improves response, but increases the load whenever you are moving the mouse or typing. Default: 2.00
  • -setdefer n โ€” when the -wait_ui mechanism cuts down the wait time ms, set the defer time to the same ms value. n=1 to enable, 0 to disable, and -1 to set defer to 0 (no delay). Similarly, 2 and -2 indicate 'urgent_update' mode should be used to push the updates even sooner. Default: 1
  • -nowait_bog โ€” do not detect if the screen polling is "bogging down" and sleep more. Some activities with no user input can slow things down a lot: consider a large terminal window with a long build running in it continuously streaming text output. By default x11vnc will try to detect this (3 screen polls in a row each longer than 0.25 sec with no user input), and sleep up to 1.5 secs to let things "catch up". Use this option to disable that detection.
  • -slow_fb time โ€” floating point time in seconds to delay all screen polling. For special purpose usage where a low frame rate is acceptable and desirable, but you want the user input processed at the normal rate so you cannot use -wait.
  • -xrefresh time โ€” floating point time in seconds to indicate how often to do the equivalent of xrefresh(1) to force all windows (in the viewable area if -id, -sid, or -clip is used) to repaint themselves. Use this only if applications misbehave by not repainting themselves properly. See also -noxdamage.
  • -nap, -nonap

Monitor activity and if it's low, take longer naps between screen polls so we really cut down the load when things are idle. Default: take naps ๐Ÿ˜ด

  • -sb time โ€” how many seconds after NO activity (like, screen blank type beat) before we really throttle down the screen polls (i.e. sleep for about 1.5 secs) ๐Ÿ’ค. Use 0 to disable it. Default: 60 โ€” and you can set the env var X11VNC_SB_FACTOR to scale it bestie.
  • -readtimeout n โ€” sets LibVNCServer rfbMaxClientWait to n seconds โฑ๏ธ. On slow links that take forever to paint the first screen, LibVNCServer may hit that timeout and just drop the connection ๐Ÿ˜ญ. Default: 20 seconds.
  • -ping n โ€” sends a 1x1 framebuffer update to all the clients every n seconds (basically to try to keep a network connection alive ๐Ÿซถ).
  • -nofbpm, -fbpm โ€” if the system supports the FBPM (Frame Buffer Power Management) extension (so, some Sun systems ๐ŸŒž), then keep the video h/w from going into a reduced power state whenever VNC clients are connected.

FBPM capable video h/w saves energy when the workstation is idle by going into low power states (similar to DPMS for monitors). This interferes with x11vnc's polling of the framebuffer data ๐Ÿ™ˆ.

-nofbpm means prevent FBPM low power states whenever VNC clients are connected, while -fbpm means to not monitor the FBPM state at all. See the xset(1) manpage for details. -nofbpm is basically the same as running xset fbpm force on periodically. Default: -fbpm

  • -nodpms, -dpms โ€” if the system supports the DPMS (Display Power Management Signaling) extension, then keep the monitor from going into a reduced power state whenever VNC clients are connected โœจ.

DPMS reduced power monitor states are a good thing and you normally want the power down to take place (usually x11vnc has no problem exporting the display in this state). You probably only want to use -nodpms to work around problems with Screen Savers kicking on in DPMS low power states ๐Ÿ’€. There's a known problem with kdesktop_lock on KDE where the screen saver keeps kicking in every time user input stops for a second or two. Specifying -nodpms works around it.

-nodpms means prevent DPMS low power states whenever VNC clients are connected, while -dpms means to not monitor the DPMS state at all. See the xset(1) manpage for details. -nodpms is basically the same as running xset dpms force on periodically. Default: -dpms

  • -forcedpms โ€” if the system supports the DPMS (Display Power Management Signaling) extension, then try to keep the monitor in a powered off state ๐Ÿ–ฅ๏ธโŒ. This is to stop nosey people at the physical display from viewing what's on the screen. Be sure to lock the screen before disconnecting.

This method is far from bullet proof ๐Ÿ’€, like, suppose someone attaches a non-DPMS monitor, or loads the machine so that there's a gap of time before x11vnc restores the powered off state? On many machines if he floods it with keyboard and mouse input he can see flashes of what is on the screen before the DPMS off state is reestablished. For this to work securely there would need to be support in the X server to do this exactly rather than approximately with DPMS ๐Ÿ˜ญ.

  • -clientdpms โ€” same as -forcedpms but only when VNC clients are connected ๐Ÿซถ.
  • -noserverdpms โ€” the UltraVNC ServerInput extension is supported ๐Ÿ‘‘. This allows the VNC viewer to click a button that will cause the server (x11vnc) to try to disable keyboard and mouse input at the physical display and put the monitor in dpms powered off state. Use this option to skip powering off the monitor.
  • -noultraext โ€” disable the following UltraVNC extensions: SingleWindow and ServerInput ๐Ÿšซ. The others managed by LibVNCServer (textchat, 1/n scaling, rfbEncodingUltra) are not.
  • -chatwindow โ€” place a local UltraVNC chat window on the X11 display that x11vnc is polling ๐Ÿ’ฌ. That way the person on the VNC viewer-side can chat with the person at the physical X11 console (like, helpdesk w/o telephone, iconic).

For this to work the SSVNC package (version 1.0.21 or later) MUST BE installed on the system where x11vnc runs and the ssvnc command must be available in $PATH. The ssvncviewer is used as a chat window helper. See http://www.karlrunge.com/x11vnc/ssvnc.html

This option implies -rfbversion 3.6 so as to trick UltraVNC viewers, otherwise they assume chat is not available ๐Ÿ™ˆ. To specify a different rfbversion, place it after the -chatwindow option on the cmdline.

See also the remote control chaton and chatoff actions. These can also be set from the tkx11vnc GUI.

  • -noxdamage โ€” do not use the X DAMAGE extension to detect framebuffer changes even if it is available ๐Ÿ™…. Use -xdamage if your default is to have it off.

x11vnc's use of the DAMAGE extension: 1) significantly reduces the load when the screen is not changing much, and 2) detects changed areas (small ones by default) more quickly โœจ.

Currently the DAMAGE extension is overly conservative and often reports large areas (e.g. a whole terminal or browser window) as damaged even though the actual changed region is much smaller (sometimes just a few pixels) ๐Ÿ’€. So heuristics were introduced to skip large areas and use the damage rectangles only as "hints" for the traditional scanline polling. The following tuning parameters are introduced to adjust this behavior:

  • -xd_area A โ€” set the largest DAMAGE rectangle area A (in pixels: width * height) to trust as truly damaged: the rectangle will be copied from the framebuffer (slow) no matter what ๐Ÿซ . Set to zero to trust all rectangles. Default: 20000
  • -xd_mem f โ€” set how long DAMAGE rectangles should be "remembered", f is a floating point number and is in units of the scanline repeat cycle time (32 iterations). The default (1.0) should give no painting problems ๐ŸŒธ. Increase it if there are problems or decrease it to live on the edge (perhaps useful on a slow machine) ๐Ÿ˜Ž.
  • -sigpipe string โ€” Broken pipe (SIGPIPE) handling. string can be "ignore" or "exit". For "ignore" LibVNCServer will handle the abrupt loss of a client and continue, for "exit" x11vnc will cleanup and exit at the 1st broken connection ๐Ÿšช.

This option is not really needed since LibVNCServer is doing the correct thing now for quite some time ๐Ÿซถ. However, for convenience you can use it to ignore other signals, e.g. -sigpipe ignore:HUP,INT,TERM in case that would be useful for some sort of application. You can also put "exit:.." in the list to have x11vnc cleanup on the listed signals. -sig is an alias for this option if you don't like the 'pipe'. Example: -sig ignore:INT,TERM,exit:USR1

  • -threads, -nothreads โ€” whether or not to use the threaded LibVNCServer algorithm [rfbRunEventLoop] if libpthread is available ๐Ÿงต. In this mode new threads (one for input and one for output) are created to handle each new client. Default: -nothreads.

Thread stability is much improved in version 0.9.8 ๐Ÿ‘‘.

Multiple clients in threaded mode should be stable for the ZRLE encoding on all platforms. The Tight and Zlib encodings are currently only stable on Linux for multiple clients ๐Ÿง. Compile with -DTLS=__thread if your OS and compiler and linker support it.

For resizes (randr, etc.) set this env var to the number of milliseconds to sleep: X11VNC_THREADS_NEW_FB_SLEEP at various places in the do_new_fb() action. This is to let various activities settle. Default is about 500ms โณ.

Multiple clients in threaded mode could yield better performance for 'class-room' broadcasting usage ๐Ÿ“š; also in -appshare broadcast mode. See also the -reflect option.

  • -fs f โ€” if the fraction of changed tiles in a poll is greater than f, the whole screen is updated ๐Ÿ”„. Default: 0.75
  • -gaps n โ€” heuristic to fill in gaps in rows or cols of n or less tiles. Used to improve text paging ๐Ÿ“„. Default: 4
  • -grow n โ€” heuristic to grow islands of changed tiles n or wider by checking the tile near the boundary ๐ŸŒฑ. Default: 3
  • -fuzz n โ€” tolerance in pixels to mark a tiles edges as changed ๐ŸŒซ๏ธ. Default: 2
  • -debug_tiles โ€” print debugging output for tiles, fb updates, etc. ๐Ÿ›
  • -snapfb โ€” instead of polling the X display framebuffer (fb) for changes, periodically copy all of X display fb into main memory and examine that copy for changes ๐Ÿ“ธ. (This setting also applies for non-X -rawfb modes). Under some circumstances this will improve interactive response, or at least make things look smoother, but in others (most!) it will make the response worse ๐Ÿ’€. If the video h/w fb is such that reading small tiles is very slow this mode could help. To keep the "framerate" up the screen size x bpp cannot be too large. Note that this mode is very wasteful of memory I/O resources (it makes full screen copies even if nothing changes) ๐Ÿซ . It may be of use in video capture-like applications, webcams, or where window tearing is a problem.
  • -rawfb string โ€” instead of polling X, poll the memory object specified in string ๐Ÿง .

For file polling, to memory map mmap(2) a file use: map:/path/to/a/file@WxHxB, with framebuffer Width, Height, and Bits per pixel. mmap:... is the same.

If there is trouble with mmap, use file:/... for slower lseek(2) based reading ๐ŸŒ.

Use snap:... to imply -snapfb mode and the file: access (this is for unseekable devices that only provide the fb all at once, e.g. a video camera provides the whole frame ๐Ÿ“ท).

For shared memory segments string is of the form: shm:N@WxHxB which specifies a shmid N and with WxHxB as above. See shmat(1) and ipcs(1)

If you do not supply a type map is assumed if the file exists (see the next paragraphs for some exceptions to this.)

Okay so like, if the string is "setup:cmd" then bestie, the command "cmd" gets run and the first line from it is read and used as the string. This lets you initialize the device, figure out WxHxB, all that โœจ. These are often done as root so likeโ€ฆ take care, fr fr. ๐Ÿ™ˆ

If the string begins with "video", go read the VIDEO4LINUX discussion below where the device may be queried for (and possibly set) the framebuffer parameters.

If the string begins with "console", "/dev/fb", "fb", or "vt", head to the LINUX CONSOLE discussion below where the framebuffer device is opened and keystrokes (and possibly mouse events) are inserted into the console.

If the string begins with "vnc", see the VNC HOST discussion below where the framebuffer is taken as that of another remote VNC server. ๐Ÿ’…

Optional suffixes are ":R/G/B" and "+O" to specify red, green, and blue masks (in hex) and an offset into the memory object. If the masks are not provided x11vnc guesses them based on the bpp โ€” and if the colors look wrong, you need to provide the masks. no cap.

Another optional suffix is the Bytes Per Line which in some cases is not WxB/8. Specify it as WxHxB-BPL e.g. 800x600x16-2048. This could be a normal width 1024 at 16bpp fb, but only width 800 shows up.

So the full format is: mode:file@WxHxB:R/G/B+O-BPL


โœจ Examples โœจ

-rawfb shm:210337933@800x600x32:ff/ff00/ff0000

-rawfb map:/dev/fb0@1024x768x32

-rawfb map:/tmp/Xvfb_screen0@640x480x8+3232

-rawfb file:/tmp/my.pnm@250x200x24+37

-rawfb file:/dev/urandom@128x128x8 -rawfb snap:/dev/video0@320x240x24 -24to32 -rawfb video0 -rawfb video -pipeinput VID -rawfb console -rawfb vt2 -rawfb vnc:somehost:0

(see ipcs(1) and fbset(1) for the first two examples) ๐Ÿซถ


In general all user input is discarded by default (see the -pipeinput option for how to use a helper program to insert). Most of the X11 (screen, keyboard, mouse) options do not make sense and many will cause this mode to crash, so please think twice before setting or changing them in a running x11vnc. ๐Ÿ˜ญ

If you DO NOT want x11vnc to close the X DISPLAY in rawfb mode, prepend a "+" e.g. +file:/dev/fb0... Keeping the display open enables the default remote-control channel, which could be useful. Alternatively, if you specify -noviewonly, then the mouse and keyboard input are STILL sent to the X display, this usage should be very rare, i.e. doing something strange with /dev/fb0. ๐Ÿ’€

If the device is not "seekable" (e.g. webcam) try reading it all at once in full snaps via the "snap:" mode (note: this is a resource hog). If you are using file: or map: AND the device needs to be reopened for every snapfb snapshot, set the environment variable: SNAPFB_RAWFB_RESET=1 as well. ๐ŸŒธ

If you want x11vnc to dynamically transform a 24bpp rawfb to 32bpp (note that this will be slower) also supply the -24to32 option. This would be useful for, say, a video camera that delivers the pixel data as 24bpp packed RGB. This is the default under "video" mode if the bpp is 24.

Normally the bits per pixel, B, is 8, 16, or 32 (or rarely 24), however there is also some support for B < 8 (e.g. old graphics displays 4 bpp or 1 bpp). In this case you certainly must supply the masks as well: WxHxB:R/G/B. The pixels will be padded out to 8 bpp using depth 8 truecolor. The scheme currently does not work with snap fb (ask if interested.) B=1 monochrome example: file:/dev/urandom@128x128x1:1/1/1 Some other like this are 128x128x2:3/3/3 128x128x4:7/7/7

For B < 8 framebuffers you can also set the env. var. RAWFB_CGA=1 to try a CGA mapping for B=4 (e.g. linux vga16fb driver.) Note with low bpp and/or resolution VGA and VGA16 modes on the Linux console one's attempt to export them via x11vnc can often be thwarted due to special color palettes, pixel packings, and even video painting buffering. OTOH, often experimenting with the RGB masks can yield something recognizable. ๐Ÿ”ฅ


๐ŸŒˆ VIDEO4LINUX ๐ŸŒˆ

on Linux some attempt is made to handle video devices (webcams or TV tuners) automatically. The idea is the WxHxB will be extracted from the device itself. So if you do not supply "@WxHxB... parameters x11vnc will try to determine them. It first tries the v4l API if that support has been compiled in. Otherwise it will run the v4l-info(1) external program if it is available.

The simplest examples are "-rawfb video" and "-rawfb video1" which imply the device file /dev/video and /dev/video1, respectively. You can also supply the /dev if you like, e.g. "-rawfb /dev/video0"

Since the video capture device framebuffer usually changes continuously (e.g. brightness fluctuations), you may want to use the -wait, -slow_fb, or -defer options to lower the "framerate" to cut down on network VNC traffic. ๐Ÿฆ‹

A more sophisticated video device scheme allows initializing the device's settings using:

-rawfb video:<settings>

The prefix could also be, as above, e.g. "video1:" to specify the device file. The v4l API must be available for this to work. Otherwise, you will need to try to initialize the device with an external program, e.g. xawtv, spcaview, and hope they persist when x11vnc re-opens the device.

<settings> is a comma separated list of key=value pairs. The device's brightness, color, contrast, and hue can be set to percentages, e.g. br=80,co=50,cn=44,hu=60.

The device filename can be set too if needed (if it does not start with "video"), e.g. fn=/dev/qcam.

The width, height and bpp of the framebuffer can be set via, e.g., w=160,h=120,bpp=16.

Related to the bpp above, the pixel format can be set via the fmt=XXX, where XXX can be one of: GREY, HI240, RGB555, RGB565, RGB24, and RGB32 (with bpp 8, 8, 16, 16, 24, and 32 respectively). See http://www.linuxtv.org for more info (V4L api). โญ

For TV/rf tuner cards one can set the tuning mode via tun=XXX where XXX can be one of PAL, NTSC, SECAM, or AUTO.

One can switch the input channel by the inp=XXX setting, where XXX is the name of the input channel (Television, Composite1, S-Video, etc). Use the name that is in the information about the device that is printed at startup.

For input channels with tuners (e.g. Television) one can change which station is selected by the sta=XXX setting. XXX is the station number. Currently only the ntsc-cable-us (US cable) channels are built into x11vnc. See the -freqtab option below to supply one from xawtv. If XXX is greater than 500, then it is interpreted as a raw frequency in KHz.

Example:

-rawfb video:br=80,w=320,h=240,fmt=RGB32,tun=NTSC,sta=47

one might need to add inp=Television too for the input channel to be TV if the card doesn't come up by default in that one. ๐ŸŽ€

Note that not all video capture devices will support all of the above settings.

See the -pipeinput VID option below for a way to control the settings through the VNC Viewer via keystrokes. As a shortcut, if the string begins "Video.." instead of "video.." then -pipeinput VID is implied.

As above, if you specify a "@WxHxB..." after the <settings> string they are used verbatim: the device is not queried for the current values. Otherwise the device will be queried.


๐Ÿ’œ LINUX CONSOLE ๐Ÿ’œ

The following describes some ways to view and possibly interact with the Linux text/graphics console (i.e. not X11 XFree86/Xorg)

Note: If the LibVNCServer LinuxVNC program is on your system you may want to use that instead of the following method because it will be faster and more accurate for the Linux text console and includes mouse support. There is, however, the basic LinuxVNC functionality in x11vnc if you replace "console" with "vt" in the examples below. ๐Ÿ‘‘

If the rawfb string begins with "console" the framebuffer device /dev/fb0 is opened and /dev/tty0 is opened too. The latter is used to inject keystrokes (not all are supported, but the basic ones are). You will need to be root to inject keystrokes, but not necessarily to open /dev/fb0. /dev/tty0 refers to the active VT, to indicate one explicitly, use, e.g., "console2" for /dev/tty2, etc. by indicating the specific VT number.

For the Linux framebuffer device, /dev/fb0, (fb1, etc) to be enabled the appropriate kernel drivers must be loaded. E.g. vesafb or vga16fb and also by setting the boot parameter vga=0x301 (or 0x314, 0x317, etc.) (The vga=... method is the preferred way; set your machines up that way.) Otherwise there will be a 'No such device' error. You can also load a Linux framebuffer driver specific to your make of video card for more functionality. Once the machine is booted one can often 'modprobe' the fb driver as root to obtain a framebuffer device. ๐Ÿ˜ญ

If you cannot get /dev/fb0 working on Linux, try using the LinuxVNC emulation mode by "-rawfb vtN" where N = 1, ... 6 is the Linux Virtual Terminal (aka virtual console) you wish to view, e.g. "-rawfb vt2". Unlike /dev/fb mode, it need not be the active Virtual Terminal. Note that this mode can only show text and not graphics. x11vnc polls the text in /dev/vcsaN ๐ŸŒธ

Set the env. var. RAWFB_VCSA_BW=1 to disable colors in the "vtN" mode (i.e. black and white only.) If you do not prefer the default 16bpp set RAWFB_VCSA_BPP to 8 or 32. If you need to tweak the rawfb parameters by using the 'console_guess' string printed at startup, be sure to indicate the snap: method. ๐Ÿงš

...and uinput?? okay bestie let me tell you about the upgrade path โœจ

So if the Linux version looks like it's 2.6 or later AND the "uinput" module seems to be chillin' there (modprobe uinput), then x11vnc is gonna use the uinput method instead of /dev/ttyN. And like, uinput is the main character here because it lets you inject BOTH keystrokes AND mouse input, so it's the preferred one when you're accessing graphical (think QT-embedded) linux console apps. It also does way more accurate keystroke insertion. ๐Ÿ’…

Peep -pipeinput UINPUT down below for the deets on this mode โ€” and heads up, you're gonna HAVE to use -pipeinput if you wanna tweak any UINPUT parameters. You may also wanna add the -nodragging and -cursor none options while you're at it. And if you're feeling stubborn and want the /dev/ttyN method forced, use "console0", etc, or -pipeinput CONSOLE.

โœจ fun fact: you can change the Linux VT remotely with the chvt(1) command to make the one you want be the active one (like 'chvt 3'). Sometimes switching out and back fixes the framebuffer's graphics state. But for the "-rawfb vtN" mode? No need to switch the VT's at all, you're good. ๐Ÿฆ‹

Wanna skip input injecting entirely? Use "consolex" or "vtx". Simple as.


The string "/dev/fb0" (1, etc.) can be swapped in for "console". You can use this to point at a different framebuffer device, e.g. /dev/fb1. And as a lil shortcut, the "/dev/" part can be dropped entirely. If the name is something nonstandard, go with "console:/dev/foofb".

If you do NOT want x11vnc guessing the framebuffer's WxHxB and masks automatically (because sometimes the kernel is out here giving incorrect info ๐Ÿ˜ญ), just specify them yourself with a @WxHxB (plus optional :R/G/B masks) tacked on the end of the string.

Examples, bestie, take notes ๐Ÿ“:

-rawfb console -rawfb /dev/fb0           (same)
-rawfb console3           (force /dev/tty3)
-rawfb consolex           (no keystrokes or mouse)
-rawfb console:/dev/nonstd
-rawfb console -pipeinput UINPUT:accel=4.0
-rawfb vt3                (/dev/tty3 w/o /dev/fb0)

๐ŸŒˆ VNC HOST ๐ŸŒˆ

If the -rawfb string is shaped like "vnc:host:N", then the VNC display "N" on the remote VNC server "host" gets connected to (so yes, x11vnc is acting as a VNC client itself ๐Ÿ‘‘) and that framebuffer gets exported.

Real talk: this mode is really only useful if you're trying to boost performance when there are like, many (e.g. > 10) simultaneous VNC viewers, and you're doing a divide-and-conquer scheme to cut bandwidth and improve responsiveness. (That said, another user found this mode useful to export a demo display through a slow link: then multiple demo viewers connected to the reflecting x11vnc on the fast side of the link, so they avoided all the demo viewers having to go through the slow link. Iconic workaround honestly. ๐Ÿ’–)

Say there's gonna be 64 simultaneous VNC viewers โ€” that can lead to a LOT of redundant VNC traffic to and from the server host:N, extra CPU usage, and all the viewers' response can get reduced by having to wait for writes to the slowest client to finish. But if you set up 8 reflectors/repeaters started with option -rawfb vnc:host:N, then there are only 8 connections to host:N. Each repeater then handles 8 vnc viewer connections, spreading the load around. In classroom broadcast usage, try to put the repeaters on different switches. This mode is the same as -reflect host:N. And swap "host:N" for "listen" or "listen:port" for a reverse connection. ๐Ÿซถ

Okay ngl, overall performance will NOT be as good as a single direct connection, because among other things there's an additional level of framebuffer polling and pointer motion can still induce many changes per second that must be propagated. Tip: if the remote VNC is x11vnc doing wireframing, or an X display that does wireframing, that gives much better response than opaque window dragging. And consider the -nodragging option if the problem is severe.

The env. var. X11VNC_REFLECT_PASSWORD can be set to the password needed to log into the vnc host server, or to "file:path_to_file" to point at a file containing the password as its first line.

To set the pixel format that x11vnc requests as a VNC CLIENT, set the env. vars: X11VNC_REFLECT_bitsPerSample, X11VNC_REFLECT_samplesPerPixel, and X11VNC_REFLECT_bytesPerPixel; the defaults are 8, 3, 4. And 2, 3, 1 would give a low color mode. See the function rfbGetClient() in libvncclient for more info.

๐Ÿ’€ heads up: the VNC HOST mode implies -shared. Use -noshared as a subsequent cmdline option to disable sharing.

๐Ÿ’… -freqtab file

For use with "-rawfb video" for TV tuner devices, to specify station frequencies. Instead of using the built in ntsc-cable-us mapping of station number to frequency, it uses the data in file. For stations that aren't numeric, e.g. SE20, they get placed above the highest numbered station in the order they're found.

Example: "-freqtab /usr/X11R6/share/xawtv/europe-west.list"

And you can totally make your own freqtab by copying the xawtv format. DIY queen behavior. ๐ŸŽ€

๐Ÿฆ‹ -pipeinput cmd

This one lets you supply an external command in cmd that x11vnc will pipe ALL the user input events to, in a simple format. In -pipeinput mode, by default x11vnc will not process any of the user input events. But if you prefix cmd with "tee:" it'll both send them to the pipe command AND process them. For a description of the format, run "-pipeinput tee:/bin/cat". Another prefix is "reopen" which means to reopen the pipe if it exits. Separate multiple prefixes with commas.

In combination with -rawfb you might be able to do some amusing things (e.g. control non-X devices ๐Ÿ˜ˆ). To facilitate this, if -rawfb is in effect then the value is stored in X11VNC_RAWFB_STR for the pipe command to use if it wants. Do 'env | grep X11VNC' for more.

Built-in pipeinput modes (no external program required, we love efficiency โœจ):

  • If cmd is "VID" and you're using the -rawfb for a video capture device, then an internal list of keyboard mappings is used to set parameters of the video. The mappings are:
    • "B" and "b" adjust the brightness up and down.
    • "H" and "h" adjust the hue.
    • "C" and "c" adjust the colour.
    • "N" and "n" adjust the contrast.
    • "S" and "s" adjust the size of the capture screen.
    • "I" and "i" cycle through input channels.
    • Up and Down arrows adjust the station (if a tuner).
    • F1, F2, ..., F6 will switch the video capture pixel format to HI240, RGB565, RGB24, RGB32, RGB555, and GREY respectively.

See -rawfb video for details.

  • If cmd is "CONSOLE" or "CONSOLEn" where n is a Linux console number, then the linux console keystroke insertion to /dev/ttyN (see -rawfb console) is performed.
  • If cmd begins with "UINPUT" then the Linux uinput module is used to insert both keystroke and mouse events to the Linux console (see -rawfb above). This usually is the /dev/input/uinput device file โ€” you may need to create it with "mknod /dev/input/uinput c 10 223" and insert the module with "modprobe uinput". ๐Ÿ› ๏ธ

The UINPUT mode currently only does US keyboards (a scan code option may be added), and not all keysyms are supported. But it's probably more accurate than the "CONSOLE" method. You may want to use the options -cursor none and -nodragging in this mode.

Additional tuning options may be supplied via: UINPUT:opt1,opt2,... (a comma separated list). If an option begins with "/" it's taken as the uinput device file.

Which uinput is injected can be controlled by an option string made of the characters "K", "M", and "B" (see the -input option), e.g. "KM" allows keystroke and motion but not button clicks.

A UINPUT option of the form: accel=f, or accel=fx+fy sets the mouse motion "acceleration". This is used to correct raw mouse relative motion into how much the application cursor moves (x11vnc has no control over, or knowledge of, how the windowing application interprets the raw mouse motions). Typically the acceleration for an X display is 2 (see xset "m" option). "f" is a floating point number, e.g. 3.0. Use "fx+fy" if you need to supply different corrections for x and y.

โญ Note: the default acceleration is 2.0 since it seems both X and qt-embedded often (but not always) use this value.

Even with a correct accel setting the mouse position will get out of sync (probably due to a mouse "threshold" setting where the acceleration does not apply, set xset(1)). The option reset=N sets the number of ms (default 150) after which the cursor is attempted to be reset (by forcing the mouse to (0, 0) via small increments and then back out to (x, y) in 1 jump). This correction seems to be needed but can cause jerkiness or unexpected behavior with menus, etc. Use reset=0 to disable.

If you set the env. var. X11VNC_UINPUT_THRESHOLDS then the thresh=n mode will be enabled. It is currently not working well. If |dx| <= thresh and |dy| < thresh no acceleration is applied. Use "thresh=+n" |dx| + |dy| < thresh to be used instead (X11?)

Example: -pipeinput UINPUT:accel=4.0 -cursor none

If the uinput device has an absolute pointer (as opposed to a normal mouse that is a relative pointer) you can specify the option "abs". Note that a touchpad on a laptop is an absolute device to some degree. This (usually) avoids all the problems with mouse acceleration. If x11vnc has trouble deducing the size of the device, use "abs=WxH". Furthermore, if the device is a touchscreen (assumed to have an absolute pointer) use "touch" or "touch=WxH". For touchscreens, when a mouse button is pressed, a pressure increase is injected, and when the button is released a pressure of zero is injected. ๐Ÿ“

If touch has been set, use "touch_always=1" to indicate whenever the mouse moves with no button pressed, a touch event of zero pressure should be sent anyway. Also use "btn_touch=1" to indicate a BTN_TOUCH keystroke press or release should be sent instead of a pressure change. Set "dragskip=n" to skip n dragged mouse touches (with pressure applied) before injecting one. To indicate the pressure that should be sent when there is a button click for a touchscreen device, specify pressure=n, e.g. n=5. The default is n=1. ๐Ÿงš

If a touch screen is being used ("touch" up above, bestie) and it's having its input processed by tslib, you can point at the tslib calibration file with tslib_cal=<file>. Like, tslib_cal=/etc/pointercal for example. This is literally required when tslib is in use โ€” otherwise you're not getting accurate positioning, you're not even getting usable positioning. ๐Ÿ’€

The Linux uinput mechanism can be bypassed entirely, and you can write input events DIRECTLY to the devices instead. To do that, specify one or more of these for the input classes: direct_rel=<device> direct_abs=<device> direct_btn=<device> or direct_key=<device>. The <device> file is usually something like /dev/input/event1, but honestly you can specify any device file or pipe. You must specify each one of the above classes even if they correspond to the same device file (rel/abs and btn are often the same, no cap). Go peek at the file /proc/bus/input/devices to get an idea what's available and what the device filenames are.

Note: the /dev/input/mouse* devices do not seem to work ๐Ÿ˜ญ โ€” use the corresponding /dev/input/event* file instead.

Any input class you didn't directly specify as above gets handled via the uinput mechanism. And to disable creating a uinput device (and thereby discarding unhandled input), specify "nouinput". Periodt.

Examples:

-pipeinput UINPUT:direct_abs=/dev/input/event1

this was used on a qtmoko Neo freerunner (armel):

-pipeinput UINPUT:touch,tslib_cal=/etc/pointercal,
direct_abs=/dev/input/event1,nouinput,dragskip=4

(where the long line has been split into two.)

You can set the env. var X11VNC_UINPUT_DEBUG=1 or higher to get debugging output for UINPUT mode. ๐Ÿ›


  • -macnodim โ€” for the native MacOSX server, disable dimming.
  • -macnosleep โ€” for the native MacOSX server, disable display sleep.
  • -macnosaver โ€” for the native MacOSX server, disable screensaver.
  • -macnowait โ€” for the native MacOSX server, do not wait for the user to switch back to his display.
  • -macwheel n โ€” for the native MacOSX server, set the mouse wheel speed to n (default 5).
  • -macnoswap โ€” for the native MacOSX server, do not swap mouse buttons 2 and 3.
  • -macnoresize โ€” for the native MacOSX server, do not resize or reset the framebuffer even if it is detected that the screen resolution or depth has changed.
  • -maciconanim n โ€” for the native MacOSX server, set n to the number of milliseconds that the window iconify/deiconify animation takes. In -ncache mode this value will be used to skip the animation if possible. (default 400)
  • -macmenu โ€” for the native MacOSX server, in -ncache client-side caching mode, try to cache pull down menus (not perfect because they have animated fades, etc.) ๐Ÿ™ˆ
  • -macuskbd โ€” for the native MacOSX server, use the original keystroke insertion code based on a US keyboard.
  • -macnoopengl โ€” for the native MacOSX server, do not use OpenGL for screen capture, but rather use the original, deprecated raw memory access method: addr = CGDisplayBaseAddress().
  • -macnorawfb โ€” for the native MacOSX server, disable the raw memory address screen capture method.

MACOSX NOTE: There are some deprecated MacOSX interfaces to inject keyboard and mouse events and the raw memory access method is deprecated as well (however, OpenGL will be preferred if available because it is faster.) One can force not using any deprecated interfaces at compile time by setting -DX11VNC_MACOSX_NO_DEPRECATED=1 in CPPFLAGS. Or to turn them off one by one: -DX11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS=1, -DX11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS=1 or -DX11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER=1 At run time, for testing and workarounds, one can disable them by using: -env X11VNC_MACOSX_NO_DEPRECATED=1 -env X11VNC_MACOSX_NO_DEPRECATED_LOCALEVENTS=1 -env X11VNC_MACOSX_NO_DEPRECATED_POSTEVENTS=1 or -env X11VNC_MACOSX_NO_DEPRECATED_FRAMEBUFFER=1

Note: When doing either of these for the mouse input not everything works currently, e.g. double clicks and wireframing. Also, screen resolution and pixel depth changes will not be automatically detected unless the deprecated framebuffer interfaces are allowed.

Conversely, if you are compiling on an older machine that does not have some of the newer interfaces, you may need to specify -DX11VNC_MACOSX_NO_CGEVENTCREATESCROLLWHEELEVENT -DX11VNC_MACOSX_NO_CGEVENTCREATEMOUSEEVENT or -DX11VNC_MACOSX_NO_CGEVENTCREATEKEYBOARDEVENT. Use -DX11VNC_MACOSX_USE_GETMAINDEVICE to regain the very old QuickDraw GetMainDevice() interface (rare...) ๐Ÿฆ‹


  • -gui [gui-opts] โ€” start up a simple tcl/tk gui based on the remote control options -remote/-query described below. Requires the "wish" program to be installed on the machine. "gui-opts" is not required: the default is to start up both the full gui and x11vnc with the gui showing up on the X display in the environment variable DISPLAY.

"gui-opts" can be a comma separated list of items. Currently there are these types of items: 1) a gui mode, a 2) gui "simplicity", 3) the X display the gui should display on, 4) a "tray" or "icon" mode, and 5) a gui geometry. ๐Ÿ’…

  1. The gui mode can be "start", "conn", or "wait" "start" is the default mode above and is not required. "conn" means do not automatically start up x11vnc, but instead just try to connect to an existing x11vnc process. "wait" means just start the gui and nothing else (you will later instruct the gui to start x11vnc or connect to an existing one.)
  2. The gui simplicity is off by default (a power-user gui with all options is presented) To start with something less daunting supply the string "simple" ("ez" is an alias for this). Once the gui is started you can toggle between the two with "Misc -> simple_gui".
  3. Note the possible confusion regarding the potentially two different X displays: x11vnc polls one, but you may want the gui to appear on another. For example, if you ssh in and x11vnc is not running yet you may want the gui to come back to you via your ssh redirected X display (e.g. localhost:10).

If you do not specify a gui X display in "gui-opts" then the DISPLAY environment variable and -display option are tried (in that order). Regarding the x11vnc X display the gui will try to communication with, it first tries -display and then DISPLAY. For example, "x11vnc -display :0 -gui otherhost:0", will remote control an x11vnc polling :0 and display the gui on otherhost:0 The "tray/icon" mode below reverses this preference, preferring to display on the x11vnc display.

  1. When "tray" or "icon" is specified, the gui presents itself as a small icon with behavior typical of a "system tray" or "dock applet". The color of the icon indicates status (connected clients) and there is also a balloon status. Clicking on the icon gives a menu from which properties, etc, can be set and the full gui is available under "Advanced". To be fully functional, the gui mode should be "start" (the default).

Note that tray or icon mode will imply the -forever x11vnc option (if the x11vnc server is started along with the gui) unless -connect or -connect_or_exit has been specified. So x11vnc (and the tray/icon gui) will wait for more connections after the first client disconnects. If you want only one viewer connection include the -once option.

For "icon" the gui just a small standalone window. For "tray" it will attempt to embed itself in the "system tray" if possible. If "=setpass" is appended then at startup the X11 user will be prompted to set the VNC session password. If =<hexnumber> is appended that icon will attempt to embed itself in the window given by hexnumber. Use =noadvanced to disable the full gui. (To supply more than one, use "+" sign). E.g. -gui tray=setpass and -gui icon=0x3600028

Other modes: "full", the default and need not be specified. "-gui none", do not show a gui, useful to override a ~/.x11vncrc setting, etc.

  1. When "geom=+X+Y" is specified, that geometry is passed to the gui toplevel. This is the icon in icon/tray mode, or the full gui otherwise. You can also specify width and height, i.e. WxH+X+Y, but it is not recommended. In "tray" mode the geometry is ignored unless the system tray manager does not seem to be running. One could imagine using something like "-gui tray,geom=+4000+4000" with a display manager to keep the gui invisible until someone logs in... ๐Ÿ‘€

More icon tricks, "icon=minimal" gives an icon just with the VNC display number. You can also set the font with "iconfont=...". The following could be useful: "-gui icon=minimal,iconfont=5x8,geom=24x10+0-0"

General examples of the -gui option: "x11vnc -gui", "x11vnc -gui ez" "x11vnc -gui localhost:10", "x11vnc -gui conn,host:0", "x11vnc -gui tray,ez" "x11vnc -gui tray=setpass"

If you do not intend to start x11vnc from the gui (i.e. just remote control an existing one), then the gui process can run on a different machine from the x11vnc server as long as X permissions, etc. permit communication between the two. ๐Ÿซถ

FONTS: On some systems the tk fonts can be too small, jagged, or otherwise unreadable. There are 4 env vars you can set to be the tk font you prefer:

  • X11VNC_FONT_BOLD โ€” main font for menus and buttons.
  • X11VNC_FONT_FIXED โ€” font for fixed width text.
  • X11VNC_FONT_BOLD_SMALL โ€” tray icon font.
  • X11VNC_FONT_REG_SMALL โ€” tray icon menu font.

The last two only apply for the tray icon mode.

Here are some examples:

-env X11VNC_FONT_BOLD='Helvetica -16 bold' -env
X11VNC_FONT_FIXED='Courier -14' -env
X11VNC_FONT_REG_SMALL='Helvetica -12'

You can put the lines like the above (without the quotes) in your ~/.x11vncrc file to avoid having to specify them on the x11vnc command line. โœจ


  • -remote command

okay bestie, so this part is all about remotely controlling some aspects of an already running x11vnc server. โœจ -R and -r are aliases for -remote. after the remote control command gets sent to the running server, the x11vnc -remote ... x11vnc command exits. you can often use the -query command (see below) to see if the x11vnc server processed your -remote command. ๐Ÿ’…

the default communication channel is that of X properties (specifically X11VNC_REMOTE), and so this command must be run with correct settings for DISPLAY and possibly XAUTHORITY to connect to the X server and set the property. alternatively, use the -display and -auth options to set them to the correct values. the running server cannot use the -novncconnect option because that disables the communication channel. see below for alternate channels. ๐Ÿซถ

for example: x11vnc -remote stop (which is the same as x11vnc -R stop) will close down the x11vnc server. x11vnc -R shared will enable shared connections, and x11vnc -R scale:3/4 will rescale the desktop. ๐ŸŒˆ

to use a different name for the X11 property (e.g. to have separate communication channels for multiple x11vnc's on the same display) set the X11VNC_REMOTE environment variable to the string you want, for example: -env X11VNC_REMOTE=X11VNC_REMOTE_12345 both sides of the channel must use the same unique name. ๐Ÿ”‘

to run a bunch of commands in a sequence use something like: x11vnc -R 'script:firstcmd;secondcmd;...'

use x11vnc -R script:file=/path/to/file to read commands from a file (can be multi-line and use the comment # character in the normal way. the ; separator must still be used to separate each command.) ๐Ÿ“„

to not try to contact another x11vnc process and instead just run the command (or query) directly, prefix the command with the string DIRECT: ๐Ÿš€

the following -remote/-R commands are supported:


  • stop โ€” terminate the server, same as "quit" "exit" or "shutdown". ๐Ÿ’€
  • ping โ€” see if the x11vnc server responds. return is: ans=ping:<display> ๐Ÿ‘‹
  • ping:mystring โ€” as above, but use your own unique string. return is: ans=ping:mystring:<xdisplay> ๐Ÿ“
  • blacken โ€” try to push a black fb update to all clients (due to timings a client could miss it). Same as "zero", also "zero:x1,y1,x2,y2" for a rectangle. ๐Ÿ–ค
  • refresh โ€” send the entire fb to all clients. ๐Ÿ”„
  • reset โ€” recreate the fb, polling memory, etc. โ™ป๏ธ
  • id:windowid โ€” set -id window to "windowid". empty or "root" to go back to root window ๐ŸชŸ
  • sid:windowid โ€” set -sid window to "windowid" ๐Ÿ†”
  • id_cmd:cmd โ€” cmds: raise, lower, map, unmap, iconify, move:dXdY, resize:dWdH, geom:WxH+X+Y. dX dY, dW, and dH must have a leading "+" or "-" e.g.: move:-30+10 resize:+20+35 also: wm_delete, wm_name:string and icon_name:string. Also id_cmd:win=N:cmd ๐ŸŽ›๏ธ
  • waitmapped โ€” wait until subwin is mapped. โณ
  • nowaitmapped โ€” do not wait until subwin is mapped. ๐Ÿšซ
  • clip:WxH+X+Y โ€” set -clip mode to "WxH+X+Y" โœ‚๏ธ
  • flashcmap โ€” enable -flashcmap mode. โœจ
  • noflashcmap โ€” disable -flashcmap mode. ๐ŸŒ™
  • shiftcmap:n โ€” set -shiftcmap to n. ๐Ÿ”ข
  • notruecolor โ€” enable -notruecolor mode. ๐ŸŽจ
  • truecolor โ€” disable -notruecolor mode. ๐ŸŒˆ
  • overlay โ€” enable -overlay mode (if applicable). ๐Ÿช„
  • nooverlay โ€” disable -overlay mode. ๐Ÿšซ
  • overlay_cursor โ€” in -overlay mode, enable cursor drawing. ๐Ÿ–ฑ๏ธ
  • overlay_nocursor โ€” disable cursor drawing. same as nooverlay_cursor. ๐Ÿ™ˆ
  • 8to24 โ€” enable -8to24 mode (if applicable). 8๏ธโƒฃ
  • no8to24 โ€” disable -8to24 mode. ๐Ÿšซ
  • 8to24_opts:str โ€” set the -8to24 opts to "str". โš™๏ธ
  • 24to32 โ€” enable -24to32 mode (if applicable). 2๏ธโƒฃ4๏ธโƒฃ
  • no24to32 โ€” disable -24to32 mode. ๐Ÿšซ
  • visual:vis โ€” set -visual to "vis" ๐Ÿ‘€
  • scale:frac โ€” set -scale to "frac" ๐Ÿ“
  • scale_cursor:f โ€” set -scale_cursor to "f" ๐Ÿ–ฑ๏ธ
  • viewonly โ€” enable -viewonly mode. ๐Ÿ‘๏ธ
  • noviewonly โ€” disable -viewonly mode. ๐Ÿ™…
  • shared โ€” enable -shared mode. ๐Ÿค
  • noshared โ€” disable -shared mode. ๐Ÿšซ
  • forever โ€” enable -forever mode. โ™พ๏ธ
  • noforever โ€” disable -forever mode. ๐Ÿ›‘
  • timeout:n โ€” reset -timeout to n, if there are currently no clients, exit unless one connects in the next n secs. โฐ
  • tightfilexfer โ€” enable filetransfer for NEW clients. ๐Ÿ“
  • notightfilexfer โ€” disable filetransfer for NEW clients. ๐Ÿšซ
  • ultrafilexfer โ€” enable filetransfer for clients. ๐Ÿ“‚
  • noultrafilexfer โ€” disable filetransfer for clients. ๐Ÿšซ
  • rfbversion:n.m โ€” set -rfbversion for new clients. ๐Ÿ”ข
  • http โ€” enable http client connections. ๐ŸŒ
  • nohttp โ€” disable http client connections. ๐Ÿšซ
  • deny โ€” deny any new connections, same as "lock" ๐Ÿ”’
  • nodeny โ€” allow new connections, same as "unlock" ๐Ÿ”“
  • avahi โ€” enable avahi service advertising. ๐Ÿ“ข
  • noavahi โ€” disable avahi service advertising. ๐Ÿ”‡
  • mdns โ€” enable avahi service advertising. ๐Ÿ“ข
  • nomdns โ€” disable avahi service advertising. ๐Ÿ”‡
  • zeroconf โ€” enable avahi service advertising. ๐Ÿ“ข
  • nozeroconf โ€” disable avahi service advertising. ๐Ÿ”‡
  • connect:host โ€” do reverse connection to host, "host" may be a comma separated list of hosts or host:ports. See -connect. Passwords required as with fwd connections. See X11VNC_REVERSE_CONNECTION_NO_AUTH=1 ๐Ÿ”—
  • disconnect:host โ€” disconnect any clients from "host" same as "close:host". Use host "all" to close all current clients. If you know the client internal hex ID, e.g. 0x3 (returned by "-query clients" and RFB_CLIENT_ID) you can use that too. โœ‚๏ธ
  • proxy:host:port โ€” set reverse connection proxy (empty to disable). ๐ŸŒ‰
  • allowonce:host โ€” For the next connection only, allow connection from "host". In -ssl mode two connections are allowed (i.e. Fetch Cert) unless X11VNC_NO_SSL_ALLOW_TWICE=1 โœ…
  • allow:hostlist โ€” set -allow list to (comma separated) "hostlist". See -allow and -localhost. Do not use with -allow /path/to/file Use "+host" to add a single host, and use "-host" to delete a single host ๐Ÿ“
  • localhost โ€” enable -localhost mode ๐Ÿ 
  • nolocalhost โ€” disable -localhost mode ๐Ÿšซ
  • listen:str โ€” set -listen to str, empty to disable. ๐Ÿ‘‚
  • noipv6 โ€” enable -noipv6 mode. 6๏ธโƒฃ๐Ÿšซ
  • ipv6 โ€” disable -noipv6 mode. 6๏ธโƒฃโœ…
  • noipv4 โ€” enable -noipv4 mode. 4๏ธโƒฃ๐Ÿšซ
  • ipv4 โ€” disable -noipv4 mode. 4๏ธโƒฃโœ…
  • 6 โ€” enable -6 IPv6 listening mode. 6๏ธโƒฃ
  • no6 โ€” disable -6 IPv6 listening mode. 6๏ธโƒฃ๐Ÿšซ
  • lookup โ€” disable -nolookup mode. ๐Ÿ”
  • nolookup โ€” enable -nolookup mode. ๐Ÿšซ๐Ÿ”
  • lookup โ€” disable -nolookup mode. ๐Ÿ” (yes, it's listed twice in the original, and we keep it twice ๐Ÿ’…)
  • input:str โ€” set -input to "str", empty to disable. โŒจ๏ธ
  • grabkbd โ€” enable -grabkbd mode. โŒจ๏ธ
  • nograbkbd โ€” disable -grabkbd mode. ๐Ÿšซ
  • grabptr โ€” enable -grabptr mode. ๐Ÿ–ฑ๏ธ
  • nograbptr โ€” disable -grabptr mode. ๐Ÿšซ
  • grabalways โ€” enable -grabalways mode. ๐ŸŽฏ
  • nograbalways โ€” disable -grabalways mode. ๐Ÿšซ
  • grablocal:n โ€” set -grablocal to n. ๐Ÿ”ข
  • client_input:str โ€” set the K, M, B -input on a per-client basis. select which client as for disconnect, e.g. client_input:host:MB or client_input:0x2:K ๐Ÿ‘ฅ
  • accept:cmd โ€” set -accept "cmd" (empty to disable). โœ…
  • afteraccept:cmd โ€” set -afteraccept (empty to disable). โญ๏ธ
  • gone:cmd โ€” set -gone "cmd" (empty to disable). ๐Ÿ‘‹
  • noshm โ€” enable -noshm mode. ๐Ÿšซ
  • shm โ€” disable -noshm mode (i.e. use shm). โœ…
  • flipbyteorder โ€” enable -flipbyteorder mode, you may need to set noshm for this to do something. ๐Ÿ”„
  • noflipbyteorder โ€” disable -flipbyteorder mode. ๐Ÿšซ
  • onetile โ€” enable -onetile mode. (you may need to set shm for this to do something) ๐Ÿงฑ
  • noonetile โ€” disable -onetile mode. ๐Ÿšซ
  • solid โ€” enable -solid mode ๐ŸŽจ
  • nosolid โ€” disable -solid mode. ๐Ÿšซ
  • solid_color:color โ€” set -solid color (and apply it). ๐Ÿ–Œ๏ธ
  • blackout:str โ€” set -blackout "str" (empty to disable). See -blackout for the form of "str" (basically: WxH+X+Y,...) Use "+WxH+X+Y" to append a single rectangle use "-WxH+X+Y" to delete one โฌ›
  • xinerama โ€” enable -xinerama mode. (if applicable) ๐Ÿ–ฅ๏ธ
  • noxinerama โ€” disable -xinerama mode. ๐Ÿšซ
  • xtrap โ€” enable -xtrap input mode(if applicable) ๐Ÿชค
  • noxtrap โ€” disable -xtrap input mode. ๐Ÿšซ
  • xrandr โ€” enable -xrandr mode. (if applicable) ๐Ÿ–ฅ๏ธ
  • noxrandr โ€” disable -xrandr mode. ๐Ÿšซ
  • xrandr_mode:mode โ€” set the -xrandr mode to "mode". โš™๏ธ
  • rotate:mode โ€” set the -rotate mode to "mode". ๐Ÿ”„
  • padgeom:WxH โ€” set -padgeom to WxH (empty to disable) If WxH is "force" or "do" the padded geometry fb is immediately applied. ๐Ÿ“
  • quiet โ€” enable -quiet mode. ๐Ÿคซ
  • noquiet โ€” disable -quiet mode. ๐Ÿ“ข
  • modtweak โ€” enable -modtweak mode. โŒจ๏ธ
  • nomodtweak โ€” enable -nomodtweak mode. โŒจ๏ธ
  • xkb โ€” enable -xkb modtweak mode. ๐Ÿ—๏ธ
  • noxkb โ€” disable -xkb modtweak mode. ๐Ÿšซ
  • capslock โ€” enable -capslock mode. ๐Ÿ” 
  • nocapslock โ€” disable -capslock mode. ๐Ÿšซ
  • skip_lockkeys โ€” enable -skip_lockkeys mode. ๐Ÿ”“
  • noskip_lockkeys โ€” disable -skip_lockkeys mode. ๐Ÿšซ
  • skip_keycodes:str โ€” enable -xkb -skip_keycodes "str". โŒจ๏ธ
  • sloppy_keys โ€” enable -sloppy_keys mode. ๐Ÿ“
  • nosloppy_keys โ€” disable -sloppy_keys mode. ๐Ÿšซ
  • skip_dups โ€” enable -skip_dups mode. ๐Ÿ”
  • noskip_dups โ€” disable -skip_dups mode. ๐Ÿšซ
  • add_keysyms โ€” enable -add_keysyms mode. โž•
  • noadd_keysyms โ€” stop adding keysyms. those added will still be removed at exit. ๐Ÿ›‘
  • clear_mods โ€” enable -clear_mods mode and clear them. ๐Ÿงน
  • noclear_mods โ€” disable -clear_mods mode. ๐Ÿšซ
  • clear_keys โ€” enable -clear_keys mode and clear them. ๐Ÿงน
  • noclear_keys โ€” disable -clear_keys mode. ๐Ÿšซ
  • clear_locks โ€” do the clear_locks action. ๐Ÿ”“
  • clear_all โ€” do the clear_all action. ๐Ÿงผ
  • keystate โ€” have x11vnc print current keystate. โŒจ๏ธ
  • remap:str โ€” sets -remap "str" (empty string = off). Wanna know what "str" looks like? Peep -remap, it's basically key1-key2,key3-key4,.... Use "+key1-key2" to append one lil keymapping, or "-key1-key2" to delete one. ๐Ÿ’…
  • norepeat โ€” turns on -norepeat mode.
  • repeat โ€” turns off -norepeat mode.
  • nofb โ€” turns on -nofb mode.
  • fb โ€” turns off -nofb mode.
  • bell โ€” turns the bell on (if it's supported, bestie).
  • nobell โ€” turns the bell off.
  • sendbell โ€” rings the bell right now. ๐Ÿ””
  • nosel โ€” turns on -nosel mode.
  • sel โ€” turns off -nosel mode.
  • noprimary โ€” turns on -noprimary mode.
  • primary โ€” turns off -noprimary mode.
  • nosetprimary โ€” turns on -nosetprimary mode.
  • setprimary โ€” turns off -nosetprimary mode.
  • noclipboard โ€” turns on -noclipboard mode.
  • clipboard โ€” turns off -noclipboard mode.
  • nosetclipboard โ€” turns on -nosetclipboard mode.
  • setclipboard โ€” turns off -nosetclipboard mode.
  • seldir:str โ€” sets -seldir to "str".
  • resend_cutbuffer โ€” resends the most recent CUTBUFFER0 copy. โœจ
  • resend_clipboard โ€” resends the most recent CLIPBOARD copy.
  • resend_primary โ€” resends the most recent PRIMARY copy.
  • cursor:mode โ€” turns on -cursor "mode".
  • show_cursor โ€” turns on showing a cursor. ๐Ÿ‘€
  • noshow_cursor โ€” turns off showing a cursor (same as "nocursor").
  • cursor_drag โ€” turns on cursor changes during drag.
  • nocursor_drag โ€” turns off cursor changes during drag.
  • arrow:n โ€” sets -arrow to alternate n.
  • xfixes โ€” turns on xfixes cursor shape mode.
  • noxfixes โ€” turns off xfixes cursor shape mode.
  • alphacut:n โ€” sets -alphacut to n.
  • alphafrac:f โ€” sets -alphafrac to f.
  • alpharemove โ€” turns on -alpharemove mode.
  • noalpharemove โ€” turns off -alpharemove mode.
  • alphablend โ€” turns off -noalphablend mode. (yes the double negative is real, don't come for me ๐Ÿ˜ญ)
  • noalphablend โ€” turns on -noalphablend mode.
  • cursorshape โ€” turns off -nocursorshape mode.
  • nocursorshape โ€” turns on -nocursorshape mode.
  • cursorpos โ€” turns off -nocursorpos mode.
  • nocursorpos โ€” turns on -nocursorpos mode.
  • xwarp โ€” turns on -xwarppointer mode.
  • noxwarp โ€” turns off -xwarppointer mode.
  • always_inject โ€” turns on -always_inject mode.
  • noalways_inject โ€” turns off -always_inject mode.
  • buttonmap:str โ€” sets -buttonmap "str", empty to disable.
  • dragging โ€” turns off -nodragging mode.
  • nodragging โ€” turns on -nodragging mode.
  • ncache โ€” re-enables -ncache mode.
  • noncache โ€” disables -ncache mode.
  • ncache_size:n โ€” sets -ncache size to n.
  • ncache_cr โ€” turns on -ncache_cr mode.
  • noncache_cr โ€” disables -ncache_cr mode.
  • ncache_no_moveraise โ€” turns on no_moveraise mode.
  • noncache_no_moveraise โ€” disables no_moveraise mode.
  • ncache_no_dtchange โ€” turns on ncache_no_dtchange mode.
  • noncache_no_dtchange โ€” disables ncache_no_dtchange mode.
  • ncache_old_wm โ€” turns on ncache_old_wm mode.
  • noncache_old_wm โ€” disables ncache_old_wm mode.
  • ncache_no_rootpixmap โ€” turns on ncache_no_rootpixmap.
  • noncache_no_rootpixmap โ€” disables ncache_no_rootpixmap.
  • ncache_reset_rootpixmap โ€” rechecks the root pixmap, aka ncrp. ๐ŸŽ€
  • ncache_keep_anims โ€” turns on ncache_keep_anims.
  • noncache_keep_anims โ€” disables ncache_keep_anims.
  • ncache_pad:n โ€” sets -ncache_pad to n.
  • wireframe โ€” turns on -wireframe mode. same as "wf".
  • nowireframe โ€” turns off -wireframe mode. same as "nowf".
  • wireframe:str โ€” turns on -wireframe mode string.
  • wireframe_mode:str โ€” turns on -wireframe mode string.
  • wireframelocal โ€” turns on wireframelocal. same as "wfl".
  • nowireframe โ€” turns off wireframelocal. same as "nowfl". (and yes bestie, this command name shows up twice in the list, that's literally how the page has it, I don't make the rules ๐Ÿ’€)
  • wirecopyrect:str โ€” sets -wirecopyrect string. same as "wcr:".
  • scrollcopyrect:str โ€” sets -scrollcopyrect string. same "scr".
  • noscrollcopyrect โ€” disables -scrollcopyrect__mode_. "noscr".
  • scr_area:n โ€” sets -scr_area to n.
  • scr_skip:list โ€” sets -scr_skip to "list".
  • scr_inc:list โ€” sets -scr_inc to "list".
  • scr_keys:list โ€” sets -scr_keys to "list".
  • scr_term:list โ€” sets -scr_term to "list".
  • scr_keyrepeat:str โ€” sets -scr_keyrepeat to "str".
  • scr_parms:str โ€” sets -scr_parms parameters.
  • fixscreen:str โ€” sets -fixscreen to "str".
  • noxrecord โ€” disables all use of the RECORD extension.
  • xrecord โ€” enables use of the RECORD extension.
  • reset_record โ€” resets the RECORD extension (if it's available, i.e. if avail.).
  • pointer_mode:n โ€” sets -pointer_mode to n. same as "pm".
  • input_skip:n โ€” sets -input_skip to n.
  • allinput โ€” enables use of -allinput mode.
  • noallinput โ€” disables use of -allinput mode.
  • input_eagerly โ€” enables use of -input_eagerly mode.
  • noinput_eagerly โ€” disables use of -input_eagerly mode.
  • ssltimeout:n โ€” sets -ssltimeout to n.
  • speeds:str โ€” sets -speeds to str.
  • wmdt:str โ€” sets -wmdt to str.
  • debug_pointer โ€” enables -debug_pointer, same as "dp".
  • nodebug_pointer โ€” disables -debug_pointer, same as "nodp".
  • debug_keyboard โ€” enables -debug_keyboard, same as "dk".
  • nodebug_keyboard โ€” disables -debug_keyboard, same as "nodk".
  • keycode:n โ€” injects keystroke 'keycode' (that's xmodmap -pk, iykyk).
  • keycode:n,down โ€” injects 'keycode' (down=0,1).
  • keysym:str โ€” injects keystroke 'keysym' (number/name).
  • keysym:str,down โ€” injects 'keysym' (down=0,1).
  • ptr:x,y,mask โ€” injects pointer event x, y, button-mask.
  • fakebuttonevent:button,down โ€” direct XTestFakeButtonEvent.
  • sleep:t โ€” sleeps floating point time t. ๐Ÿ˜ด
  • get_xprop:p โ€” gets X property named 'p'.
  • set_xprop:p:val โ€” sets X property named 'p' to 'val'. and heads up: p -> id=NNN:p for a hex/dec window id.
  • wininfo:id โ€” gets info about X window id. use 'root' for the root window, use +id for children.
  • grab_state โ€” gets the state of the pointer and keyboard grab.
  • pointer_pos โ€” prints XQueryPointer x,y cursor position.
  • pointer_x โ€” prints XQueryPointer x cursor position.
  • pointer_y โ€” prints XQueryPointer y cursor position.
  • pointer_same โ€” prints XQueryPointer ptr on same screen.
  • pointer_root โ€” prints XQueryPointer curr ptr rootwin.
  • pointer_mask โ€” prints XQueryPointer button and mods mask.
  • mouse_x โ€” prints x11vnc's idea of cursor position.
  • mouse_y โ€” prints x11vnc's idea of cursor position.
  • noop โ€” does nothing. literally. main character energy of doing absolutely nothing and still being listed. ๐Ÿ‘‘
  • defer:n โ€” sets -defer to n ms, same as deferupdate:n.
  • wait:n โ€” sets -wait to n ms.
  • extra_fbur:n โ€” sets -extra_fbur to n.
  • wait_ui:f โ€” sets -wait_ui factor to f.
  • setdefer:n โ€” sets -setdefer to -2,-1,0,1, or 2.
  • wait_bog โ€” disables -nowait_bog mode.
  • nowait_bog โ€” enables -nowait_bog mode.
  • slow_fb:f โ€” sets -slow_fb to f seconds.
  • xrefresh:f โ€” sets -xrefresh to f seconds.
  • readtimeout:n โ€” sets read timeout to n seconds.
  • nap โ€” enables -nap mode.
  • nonap โ€” disables -nap mode.
  • sb:n โ€” sets -sb to n s, same as screen_blank:n.
  • fbpm โ€” disables -nofbpm mode.
  • nofbpm โ€” enables -nofbpm mode.
  • dpms โ€” disables -nodpms mode.
  • nodpms โ€” enables -nodpms mode.
  • forcedpms โ€” enables -forcedpms mode.
  • noforcedpms โ€” disables -forcedpms mode.
  • clientdpms โ€” enables -clientdpms mode.
  • noclientdpms โ€” disables -clientdpms mode.
  • noserverdpms โ€” enables -noserverdpms mode.
  • serverdpms โ€” disables -noserverdpms mode.
  • noultraext โ€” enables -noultraext mode.
  • ultraext โ€” disables -noultraext mode.
  • chatwindow โ€” enables local chatwindow mode. ๐Ÿ’ฌ
  • nochatwindow โ€” disables local chatwindow mode.
  • chaton โ€” begins chat using local window.
  • chatoff โ€” ends chat using local window.
  • xdamage โ€” enables xdamage polling hints.
  • noxdamage โ€” disables xdamage polling hints.
  • xd_area:A โ€” sets -xd_area max pixel area to "A".
  • xd_mem:f โ€” sets -xd_mem remembrance to "f".
  • fs:frac โ€” sets -fs fraction to "frac", e.g. 0.5.
  • gaps:n โ€” sets -gaps to n.
  • grow:n โ€” sets -grow to n.
  • fuzz:n โ€” sets -fuzz to n.
  • snapfb โ€” enables -snapfb mode.
  • nosnapfb โ€” disables -snapfb mode.
  • rawfb:str โ€” sets -rawfb mode to "str".
  • uinput_accel:f โ€” sets uinput_accel to f.
  • uinput_thresh:n โ€” sets uinput_thresh to n.
  • uinput_reset:n โ€” sets uinput_reset to n ms.
  • uinput_always:n โ€” sets uinput_always to 1/0.
  • progressive:n โ€” sets LibVNCServer -progressive slice height parameter to n.
  • desktop:str โ€” sets -desktop name to str for new clients.
  • rfbport:n โ€” sets -rfbport to n.
  • macnosaver โ€” enables -macnosaver mode.
  • macsaver โ€” disables -macnosaver mode.
  • macnowait โ€” enables -macnowait mode.
  • macwait โ€” disables -macnowait mode.
  • macwheel:n โ€” sets -macwheel to n.
  • macnoswap โ€” enables -macnoswap mouse button mode.
  • macswap โ€” disables -macnoswap mouse button mode.
  • macnoresize โ€” enables -macnoresize mode.
  • macresize โ€” disables -macnoresize mode.
  • maciconanim:n โ€” sets -maciconanim to n.
  • macmenu โ€” enables -macmenu mode.
  • macnomenu โ€” disables -macmenu mode.
  • macuskbd โ€” enables -macuskbd mode.
  • macnouskbd โ€” disables -macuskbd mode.
  • httpport:n โ€” sets -httpport to n.
  • httpdir:dir โ€” sets -httpdir to dir (and enables http while it's at it).
  • enablehttpproxy โ€” enables -enablehttpproxy mode.
  • noenablehttpproxy โ€” disables -enablehttpproxy mode.
  • alwaysshared โ€” enables -alwaysshared mode.
  • noalwaysshared โ€” disables -alwaysshared mode. (heads up bestie: may interfere with other options ๐Ÿ˜ฌ)
  • nevershared โ€” enables -nevershared mode.
  • nonevershared โ€” disables -nevershared mode. (may interfere with other options)
  • dontdisconnect โ€” enables -dontdisconnect mode.
  • nodontdisconnect โ€” disables -dontdisconnect mode. (may interfere with other options)
  • debug_xevents โ€” enables debugging X events. ๐Ÿ›
  • nodebug_xevents โ€” turns OFF debugging of X events.
  • debug_xdamage โ€” turns ON debugging for the X DAMAGE mechanism.
  • nodebug_xdamage โ€” turns OFF debugging for the X DAMAGE mechanism.
  • debug_wireframe โ€” turns ON debugging for the wireframe mechanism.
  • nodebug_wireframe โ€” turns OFF debugging for the wireframe mechanism.
  • debug_scroll โ€” turns ON debugging for the scrollcopy mechanism.
  • nodebug_scroll โ€” turns OFF debugging for the scrollcopy mechanism.
  • debug_tiles โ€” turns ON -debug_tiles.
  • nodebug_tiles โ€” turns OFF -debug_tiles.
  • debug_grabs โ€” turns ON -debug_grabs.
  • nodebug_grabs โ€” turns OFF -debug_grabs.
  • debug_sel โ€” turns ON -debug_sel.
  • nodebug_sel โ€” turns OFF -debug_sel.
  • debug_ncache โ€” turns ON -debug_ncache.
  • nodebug_ncache โ€” turns OFF -debug_ncache.
  • dbg โ€” turns ON the -dbg crash shell. ๐Ÿ’€
  • nodbg โ€” turns OFF the -dbg crash shell.
  • noremote โ€” kills the -remote command processing. And bestie, listen: it literally cannot be turned back on. One-way door, no takebacks, no undo. ๐Ÿ™ˆ

bcx_xattach:str โ€” okay this one is a whole thing so buckle up. ๐ŸŽ€

This remote control command is built for use with the BARCO xattach program, or the x2x program. Both of these are about sharing pointer and keyboard between separate X displays. Usually the two displays sit right next to each other (same desk energy, yk), and this is what lets the user share a single pointer and keyboard between them. You move the mouse to an edge, and then the pointer like... 'jumps' over to the other display screen. So it's emulating what a single X server would do for two screens (like :0.0 and :0.1). The whole illusion of one X server with multiple screens is pulled off by forwarding events to the second one through the XTEST extension. โœจ

So what the x11vnc bcx_xattach command actually does is perform some pointer movements to try to INDUCE xattach/x2x to 'jump' over to the other display. Quick vocab, because it matters: the 'master' display is the one that, when it has 'focus', is basically doing nothing except watching for the mouse to cross an edge. The 'slave' display is the one the mouse and keyboard get redirected to once an edge on the master has been crossed. And heads up โ€” the x11vnc running the bcx_xattach command MUST be the one connected to the master display.

Also note: when input is being redirected (via XTEST) from the master to the slave, the master display's pointer and keyboard are grabbed by xattach/x2x. x11vnc can use that info to check that the master/slave mode change actually happened correctly. If you pass the "ifneeded" option (more on that below) and the initial grab state is already the desired final state, then no pointer movements get injected and it just returns "DONE,GRAB_OK".

"str" must contain one of "up", "down", "left", or "right" to say which direction the 'jump' goes. "str" must ALSO contain one of "master_to_slave" or "slave_to_master" to say what kind of mode change the jump induces. You can use "M2S" and "S2M" as shorter aliases. ๐Ÿฆ‹

"str" can also be a "+"-separated list of extra tuning options:

  • shift=n โ€” an offset shift position away from (0,0). Default is 20.
  • final=x+y โ€” the final position of the cursor at the end of the normal move sequence. Default is 30+30.
  • extra_move=x+y โ€” do one more pointer move after final, over to x+y.
  • dt=n โ€” sets the sleep time in milliseconds between pointer moves. Default: 40ms.
  • retry=n โ€” the max number of retries if the grab state change fails.
  • ifneeded โ€” don't apply the pointer movements if the initial grab state is already the desired final state.
  • nograbcheck โ€” don't check whether the grab state changed as expected, and just apply the pointer movements. (Default is to check the grab states.)

If you don't specify "up", etc., to bcx_xattach, nothing gets attempted and the command returns the string FAIL,NO_DIRECTION_SPECIFIED. If you don't specify "master_to_slave" or "M2S", etc., nothing gets attempted and the command returns the string FAIL,NO_MODE_CHANGE_SPECIFIED.

Otherwise, the returned string will contain "DONE". It'll be "DONE,GRAB_OK" if the grab state changed as expected (or if "ifneeded" was supplied and the initial grab state was already the desired one). If the initial grab state was wrong but the final grab state was right, it's "DONE,GRAB_FAIL_INIT". If the initial grab state was right but the final grab state was wrong, it's "DONE,GRAB_FAIL_FINAL". If both are wrong, it's "DONE,GRAB_FAIL". Under grab failure the string gets followed by :p1,k1-p2,k2 where p1,k1 is the initial pointer and keyboard grab states and p2,k2 is the final ones. If GRAB_FAIL or GRAB_FAIL_FINAL happens, the action gets retried up to 3 times โ€” trying to reset the state and sleeping a bit between each try. Set retry=n to adjust the number of retries, or zero to disable retries entirely.

Examples:

-R bcx_xattach:down+M2S
-R bcx_xattach:up+S2M
-R bcx_xattach:up+S2M+nograbcheck+dt=30
-R bcx_xattach:down+M2S+extra_move=100+100

or use -Q instead of -R to retrieve the result text. ๐Ÿ‘‘

End of the bcx_xattach:str description.


The vncconnect(1) command from standard VNC distributions can also be used, if the string is prefixed with "cmd=". E.g. 'vncconnect cmd=stop'. And under some circumstances xprop(1) can be used too, if it supports -set (check the FAQ for that one). ๐Ÿ’…

If "-connect /path/to/file" has been supplied to the running x11vnc server, then that file can be used as a communication channel โ€” and heads up, this is the only way to remote control one of many x11vnc's polling the same X display. Simply run:

x11vnc -connect /path/to/file -remote ...

or you can write straight to the file with something like: "echo cmd=stop > /path/to/file", etc. ๐Ÿซถ


โœจ -query variable โœจ

Like -remote, except it just queries the value of variable. "-Q" is an alias for "-query". You can do multiple queries by separating the variables with commas, e.g. -query var1,var2. The results come back in the form ans=var1:value1,ans=var2:value2,... on standard output. And if a variable is read-only, it comes back with the prefix "aro=" instead of "ans=". ๐ŸŒธ

Some -remote commands are pure actions that make zero sense as variables, e.g. "stop" or "disconnect". In those cases the value returned is "N/A". And to direct a query straight to the X11VNC_REMOTE property or connect file, use "qry=..." instead of "cmd=...". ๐Ÿ’–

ans= stop quit exit shutdown ping resend_cutbuffer
resend_clipboard resend_primary blacken zero refresh reset close
disconnect id_cmd id sid waitmapped nowaitmapped clip flashcmap
noflashcmap shiftcmap truecolor notruecolor overlay nooverlay
overlay_cursor overlay_yescursor nooverlay_nocursor
nooverlay_cursor nooverlay_yescursor overlay_nocursor 8to24
no8to24 8to24_opts 24to32 no24to32 visual scale scale_cursor
viewonly noviewonly shared noshared forever noforever once
timeout tightfilexfer notightfilexfer ultrafilexfer
noultrafilexfer rfbversion deny lock nodeny unlock avahi mdns
zeroconf noavahi nomdns nozeroconf connect proxy allowonce allow
noipv6 ipv6 noipv4 ipv4 no6 6 localhost nolocalhost listen lookup
nolookup accept afteraccept gone shm noshm flipbyteorder
noflipbyteorder onetile noonetile solid_color solid nosolid
blackout xinerama noxinerama xtrap noxtrap xrandr noxrandr
xrandr_mode rotate padgeom quiet q noquiet modtweak nomodtweak
xkb noxkb capslock nocapslock skip_lockkeys noskip_lockkeys
skip_keycodes sloppy_keys nosloppy_keys skip_dups noskip_dups
add_keysyms noadd_keysyms clear_mods noclear_mods clear_keys
noclear_keys clear_all clear_locks keystate remap repeat norepeat
fb nofb bell nobell sendbell sel nosel primary noprimary
setprimary nosetprimary clipboard noclipboard setclipboard
nosetclipboard seldir cursorshape nocursorshape cursorpos
nocursorpos cursor_drag nocursor_drag cursor show_cursor
noshow_cursor nocursor arrow xfixes noxfixes xdamage noxdamage
xd_area xd_mem alphacut alphafrac alpharemove noalpharemove
alphablend noalphablend xwarppointer xwarp noxwarppointer noxwarp
always_inject noalways_inject buttonmap dragging nodragging
ncache_cr noncache_cr ncache_no_moveraise noncache_no_moveraise
ncache_no_dtchange noncache_no_dtchange ncache_no_rootpixmap
noncache_no_rootpixmap ncache_reset_rootpixmap ncrp
ncache_keep_anims noncache_keep_anims ncache_old_wm
noncache_old_wm ncache_pad ncache noncache ncache_size
debug_ncache nodebug_ncache wireframe_mode wireframe wf
nowireframe nowf wireframelocal wfl nowireframelocal nowfl
wirecopyrect wcr nowirecopyrect nowcr scr_area scr_skip scr_inc
scr_keys scr_term scr_keyrepeat scr_parms scrollcopyrect scr
noscrollcopyrect noscr fixscreen noxrecord xrecord reset_record
pointer_mode pm input_skip allinput noallinput input_eagerly
noinput_eagerly input grabkbd nograbkbd grabptr nograbptr
grabalways nograbalways grablocal client_input ssltimeout speeds
wmdt debug_pointer dp nodebug_pointer nodp debug_keyboard dk
nodebug_keyboard nodk keycode keysym ptr fakebuttonevent sleep
get_xprop set_xprop wininfo bcx_xattach deferupdate defer
setdefer extra_fbur wait_ui wait_bog nowait_bog slow_fb xrefresh
wait readtimeout nap nonap sb screen_blank fbpm nofbpm dpms
nodpms clientdpms noclientdpms forcedpms noforcedpms noserverdpms
serverdpms noultraext ultraext chatwindow nochatwindow chaton
chatoff fs gaps grow fuzz snapfb nosnapfb rawfb uinput_accel
uinput_thresh uinput_reset uinput_always progressive rfbport http
nohttp httpport httpdir enablehttpproxy noenablehttpproxy
alwaysshared noalwaysshared nevershared noalwaysshared
dontdisconnect nodontdisconnect desktop debug_xevents
nodebug_xevents debug_xevents debug_xdamage nodebug_xdamage
debug_xdamage debug_wireframe nodebug_wireframe debug_wireframe
debug_scroll nodebug_scroll debug_scroll debug_tiles dbt
nodebug_tiles nodbt debug_tiles debug_grabs nodebug_grabs
debug_sel nodebug_sel dbg nodbg macnosaver macsaver nomacnosaver
macnowait macwait nomacnowait macwheel macnoswap macswap
nomacnoswap macnoresize macresize nomacnoresize maciconanim
macmenu macnomenu nomacmenu macuskbd nomacuskbd noremote

aro=  noop display vncdisplay icon_mode autoport loop loopbg
desktopname guess_desktop guess_dbus http_url auth xauth users
rootshift clipshift scale_str scaled_x scaled_y scale_numer
scale_denom scale_fac_x scale_fac_y scaling_blend scaling_nomult4
scaling_pad scaling_interpolate inetd privremote unsafe safer
nocmds passwdfile unixpw unixpw_nis unixpw_list ssl ssl_pem
sslverify stunnel stunnel_pem https httpsredir usepw using_shm
logfile o flag rmflag rc norc h help V version lastmod bg sigpipe
threads readrate netrate netlatency pipeinput clients
client_count pid ext_xtest ext_xtrap ext_xrecord ext_xkb ext_xshm
ext_xinerama ext_overlay ext_xfixes ext_xdamage ext_xrandr
rootwin num_buttons button_mask mouse_x mouse_y grab_state
pointer_pos pointer_x pointer_y pointer_same pointer_root
pointer_mask bpp depth indexed_color dpy_x dpy_y wdpy_x wdpy_y
off_x off_y cdpy_x cdpy_y coff_x coff_y rfbauth passwd viewpasswd

-QD variable ๐Ÿ’…

Bestie it's literally -query but make it โœจdefaultโœจ. Same energy, except it hands you the default value for that parameter instead โ€” and no running x11vnc server gets consulted at all. No server, no tea, just the factory settings. ๐ŸŽ€

-sync โณ

Okay so by default, -remote commands are asynchronous โ€” the request gets posted and the program dips immediately. Like, bye. ๐Ÿ‘‹ But pass -sync and the program actually waits for an acknowledgement from the x11vnc server that the command was processed (somehow). ๐Ÿซถ

Meanwhile -query requests are always processed synchronously, because they literally have to sit there and wait for the answer. No shortcuts, iykyk. ๐Ÿ’โ€โ™€๏ธ

Also note: if you supply both -remote and -query requests on the command line, the -remote goes first (synchronously โ€” no need for -sync), and then the -query request is processed the normal way. This is a reliable little trick to see if the -remote command was actually processed, by querying for any new settings. ๐Ÿ•ต๏ธโ€โ™€๏ธ

โš ๏ธ But heads up bestie โ€” there's a timeout of a few seconds (see next paragraph), so if x11vnc takes longer than that to process the requests, the requester will just think a failure happened. ๐Ÿ˜ญ

The default is to wait 3.5 seconds. Or if cmd=stop then only 1.0 seconds. If cmd matches 'script:' then it waits up to 10.0 seconds. Set X11VNC_SYNC_TIMEOUT to however many seconds you want it to wait. โฐ

-query_retries str ๐Ÿ”

If a query fails to get a response from an x11vnc server, retry up to n times. str is specified as n[:t][/match]. Optionally the delay between tries may be specified by t, a floating point time (default 0.5 seconds). ๐Ÿซง

๐Ÿ’€ Note: the response is not checked for validity or whether it corresponds to the query sent.

The query "ping:mystring" may be used to help uniquely identify the query. Optionally, a matching string after a / will be used to check the result text. Up to n retries will take place until the matching string is found in the output text. If the match string is never found, the program's exit code is 1; if the match is found it exits with 0. ๐ŸŒธ

Note that there may be stdout printed for each retry (i.e. multiple lines printed out to stdout). Example:

-query_retries 4:1.5/grab_state

-remote_prefix str ๐Ÿ“ก

Enables a remote-control communication channel for connected VNC clients. str is a non-empty string. If a VNC client sends rfbCutText having the prefix str, then the part after it is processed as though it were sent via 'x11vnc -remote ...'. If it begins with neither cmd= nor qry= then qry= is assumed. ๐Ÿ“จ

Any corresponding output text for that remote control command is sent back to all client as rfbCutText. The returned output is also prefixed with str. Example:

-remote_prefix DO_THIS:
โš ๏ธ Bestie, listen. Enabling -remote_prefix lets the remote VNC viewers run x11vnc -remote commands. Do not use this option if they are not to be trusted. Periodt. ๐Ÿšซ

-noremote, -yesremote ๐Ÿ›‘

  • -noremote โ€” do not process any remote control commands or queries.
  • -yesremote โ€” do process remote control commands or queries. Default: -yesremote โœจ

A note about security wrt remote control commands. If someone can connect to the X display and change the property X11VNC_REMOTE, then they can remotely control x11vnc. Normally access to the X display is protected. Note that if they can modify X11VNC_REMOTE on the X server, they have enough permissions to also run their own x11vnc and thus have complete control of the desktop. ๐Ÿ’€

If the "-connect /path/to/file" channel is being used, obviously anyone who can write to /path/to/file can remotely control x11vnc. So be sure to protect the X display and that file's write permissions. See -privremote below. ๐Ÿ”

If you are paranoid and don't think -noremote is enough, to disable the X11VNC_REMOTE property channel completely use -novncconnect, or use the -safer option that shuts many things off. ๐Ÿ›ก๏ธ

-unsafe ๐Ÿ™ˆ

A few remote commands are disabled by default (currently: id:pick, accept:<cmd>, gone:<cmd>, and rawfb:setup:<cmd>) because they're associated with running external programs. If you specify -unsafe, then these remote-control commands are allowed. ๐Ÿซฃ

Note that you can still specify these parameters on the command line โ€” they just cannot be invoked via remote-control. ๐Ÿ’…

-safer ๐Ÿงท

Equivalent to: -novncconnect -noremote and prohibiting -gui and the -connect file. Shuts off communication channels. Simple as that. โœจ

-privremote ๐Ÿ”

Performs some sanity checks and disables remote-control commands if it appears that the X DISPLAY and/or connectfile can be accessed by other users. Once remote-control is disabled it cannot be turned back on. So it's a one-way door, bestie. ๐Ÿšช

-nocmds ๐Ÿšซ๐Ÿ’ป

No external commands (e.g. system(3), popen(3), exec(3)) will be run at all. Nope, not even one. ๐Ÿ’€

-allowedcmds list โœ…

list contains a comma separated list of the only external commands that can be run. The full list of associated options is:

stunnel, ssl, unixpw, WAIT, zeroconf, id, accept, afteraccept,
gone, pipeinput, v4l-info, rawfb-setup, dt, gui, ssh,
storepasswd, passwdfile, custom_passwd, findauth, crash.

See each option's help to learn the associated external command. ๐Ÿ‘€

โš ๏ธ Note that the -nocmds option takes precedence and disables all external commands. ๐Ÿ‘‘

-deny_all ๐Ÿšท

  • -remote nodeny โ€” start out denying all incoming clients until -remote nodeny is used to let them in. ๐Ÿšซ

โœจ these get passed straight to LibVNCServer โœจ

Like, we're just handing these off to the big sibling library, bestie. They handle the RFB stuff. ๐Ÿ’…

  • -rfbport port โ€” the TCP port for the RFB protocol. That's where the magic talks. ๐ŸŒ
  • -rfbwait time โ€” max time in ms to wait for an RFB client. Impatient much? ๐Ÿ˜ค
  • -rfbauth passwd-file โ€” use authentication on the RFB protocol. Pro tip from the source: use x11vnc -storepasswd pass file to create a password file. Keep it secret, keep it safe. ๐Ÿ”
  • -rfbversion 3.x โ€” set the version of the RFB we choose to advertise. Gotta announce yourself, queen. ๐Ÿ“ข
  • -permitfiletransfer โ€” permit file transfer support. Sharing is caring. ๐Ÿซถ
  • -passwd plain-password โ€” use authentication, using plain-password as the password. And the manpage is SCREAMING at you: USE AT YOUR OWN RISK. Like, it's right there in all caps. Don't come crying to me. ๐Ÿ’€
  • -deferupdate time โ€” time in ms to defer updates, default 40. โœจ
  • -deferptrupdate time โ€” time in ms to defer pointer updates, default none. ๐Ÿ–ฑ๏ธ
  • -desktop name โ€” the VNC desktop name, default "LibVNCServer". Name your vibe. ๐Ÿ‘‘
  • -alwaysshared โ€” always treat new clients as shared. The more the merrier. ๐ŸŒˆ
  • -nevershared โ€” never treat new clients as shared. Exclusive, and honestly, iconic. ๐Ÿ’…
  • -dontdisconnect โ€” don't disconnect existing clients when a new non-shared connection comes in; instead refuse the new connection. Loyal to the old ones. ๐Ÿฅฐ
  • -httpdir dir-path โ€” enable the http server using dir-path as home. ๐Ÿ 
  • -httpport portnum โ€” use portnum for the http connection. ๐Ÿ”ข
  • -enablehttpproxy โ€” enable http proxy support. ๐Ÿงš
  • -progressive height โ€” enable progressive updating for slow links. We love a low-bandwidth queen. ๐ŸŒ
  • -listen ipaddr โ€” listen for connections only on the network interface with address ipaddr. And yes, '-listen localhost' and hostname work too. ๐Ÿ‘‚

๐ŸŒธ libvncserver-tight-extension options ๐ŸŒธ

  • -disablefiletransfer โ€” disable file transfer. ๐Ÿ”’
  • -ftproot string โ€” set the ftp root. ๐Ÿ“

๐ŸŽ€ FILES ๐ŸŽ€

  • $HOME/.x11vncrc, $HOME/.Xauthority

๐ŸŒธ ENVIRONMENT ๐ŸŒธ

  • DISPLAY, XAUTHORITY, HOME

These next ones get set for the auxiliary commands run by -accept, -gone and other cases. So when x11vnc spawns a lil helper, it knows who it's talking about:

  • RFB_CLIENT_IP, RFB_CLIENT_PORT, RFB_SERVER_IP, RFB_SERVER_PORT, RFB_X11VNC_PID, RFB_CLIENT_ID, RFB_CLIENT_COUNT, RFB_MODE RFB_STATE RFB_LOGIN_VIEWONLY RFB_LOGIN_TIME RFB_CURRENT_TIME RFB_USERNAME RFB_SSL_CLIENT_CERT

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

Like, go read these too, bestie:


๐Ÿ’œ AUTHORS ๐Ÿ’œ

x11vnc was written by Karl J. Runge <runge@karlrunge.com>, and it's part of the LibVNCServer project at https://github.com/LibVNC/libvncserver. This manual page is based on the one written by Ludovic Drolez <ldrolez@debian.org> for the Debian project โ€” and both may be used by others. Giving credit where it's due, as we should. ๐Ÿ‘‘


and that's a wrap on the whole page, bestie!! you read all of it, no skimming (I can tell). go forth and VNC responsibly ๐Ÿ’…โœจ

This fine piece of documentation is from the x11vnc release dated February 2018, and it's the X11VNC(1) manual page, fr fr. ๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from