man x11vnc (Commandes) - allow VNC connections to real X11 displays version: 0.7.3, lastmod: 2005-08-07


x11vnc - allow VNC connections to real X11 displays version: 0.7.3, lastmod: 2005-08-07


x11vnc [OPTION]...


Typical usage is:

Run this command in a shell on the remote machine "far-host" with 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 -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 recommend.

For additional info see: and

Rudimentary 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).


-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.

-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.

-id windowid

Show the 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.

-clip WxH+X+Y

Only show the sub-region of the full display that corresponds to the rectangle 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.


In 8bpp indexed color, let the installed colormap flash as the pointer moves from window to window (slow).

-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


For 8bpp displays, force indexed color (i.e. a colormap) even if it looks like 8bpp TrueColor (rare problem).

-visual n

Experimental option: probably does not do what you think. It simply *forces* the visual used for the framebuffer; this may be a bad thing... (e.g. messes up colors or cause a crash). It is useful for testing and for some workarounds. n may be a decimal number, or 0x hex. Run xdpyinfo(1) for the values. One may also use "TrueColor", etc. see <X11/X.h> for a list. If the string ends in ":m" then for better or for worse the visual depth is forced to be m.


Handle multiple depth visuals on one screen, e.g. 8+24 and 24+8 overlay visuals (the 32 bits per pixel are packed with 8 for PseudoColor and 24 for TrueColor).
Currently -overlay only works on Solaris via XReadScreen(3X11) and IRIX using XReadDisplay(3). On Solaris there is 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 will use 8bpp PseudoColor even when the default visual is depth 24 TrueColor (24+8). In these 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 due to the extra image transformations required. For optimal performance do not use -overlay, but rather 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).


Sets -overlay, but does not try to draw the exact mouse cursor shape using the overlay mechanism.

-scale fraction

Scale the framebuffer by factor fraction. Values less than 1 shrink the fb, larger ones expand it. Note: image may not be sharp and response may be slower. If fraction contains a decimal point "." it is taken as a floating point number, alternatively the notation "m/n" may be used to denote fractions exactly, e.g. -scale 2/3
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 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).

-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.


All VNC clients can only watch (default off).


VNC display is shared, i.e. more than one viewer can connect at the same time (default off).


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


Keep listening for more connections rather than exiting as soon as the first client(s) disconnect. Same as -many

-timeout n

Exit unless a client connects within the first n seconds after startup.


Launched by inetd(1): stdio instead of listening socket. Note: if you are not redirecting stderr to a log file (via shell 2> or -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.


Instead of using -httpdir (see 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).

-connect string

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.
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 for this usage mode if x11vnc is running as root (e.g. via gdm(1) , etc).

-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" establish a reverse connection. Using xprop(1) instead of vncconnect may work (see the FAQ). The -remote control mechanism also uses this VNC_CONNECT channel. Default: -vncconnect

-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 a 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.


Same as "-allow".
Note: if you want to restrict which network interface x11vnc listens on, see the -listen option below. E.g. "-listen localhost" or "-listen". As a special case, the option "-localhost" implies "-listen localhost".
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.


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, and "B" for Button-click input. Their presence in the string enables that type of input. E.g. "-input M" means normal users can only move the mouse and "-input KMB,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).

-viewpasswd string

Supply a 2nd password for view-only logins. The -passwd (full-access) password must also be supplied.

-passwdfile filename

Specify libvncserver -passwd via the first line of the file filename instead of via command line (where others might see it via ps(1) ). If a second non blank line exists in the file it is taken as a view-only password (i.e. -viewpasswd) To supply an empty password for either field the string "__EMPTY__" may be used. Note: -passwdfile is a simple plaintext passwd, see also -rfbauth and -storepasswd below for obfuscated VNC password files. Neither file should be readable by untrusted users.


Disable the big warning message when you use x11vnc without some sort of password.

-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"

-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(1) 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"
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).
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.

-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. 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(1) 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) 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. Note that the -connect file is also sometimes written to.
So be careful with this option since in many situations its use can decrease security.
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 user "barney" by quickly using "xhost +" when logging in may get x11vnc to switch to user "fred". What happens next?
Under display managers it may be a long time before the switch succeeds (i.e. a user logs in). To make it switch immediately regardless if the display can be reopened prefix the username with the "+" character. E.g. "-users +bob" or "-users +nobody". The latter (i.e. switching immediately to user "nobody") is probably the only use of this option that increases security.
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 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 -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 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. 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.


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.


Sometimes needed if remotely polled host has different endianness. Ignored unless -noshm is set.


Do not use the new copy_tiles() framebuffer mechanism, just use 1 shm tile for polling. Limits shm segments used to 3.

-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, and classic X (i.e. with the background image on the root window). The "gconftool-2" and "dcop" external commands are run for GNOME and KDE respectively. Other desktops won't work, e.g. Xfce (send us the corresponding commands if you find them). If x11vnc is running as root ( inetd(1) or gdm(1) ), the -users option may be needed for GNOME and KDE. If x11vnc guesses your desktop incorrectly, you can force it by prefixing color with "gnome:", "kde:", "cde:" or "root:".

-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.


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).
In general, we have noticed on XINERAMA displays you may need to use the "-xwarppointer" option if the mouse pointer misbehaves.


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 options 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).
"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.

-padgeom WxH

Whenever a new vncviewer connects, the framebuffer is replaced with a fake, solid black one of geometry WxH. Shortly afterwards the framebuffer is replaced with the real one. This is intended for use with vncviewers that do not support NewFBSize and one wants to make sure the initial viewer geometry will be big enough to handle all subsequent resizes (e.g. under -xrandr, -remote id:windowid, rescaling, etc.)

-o logfile

Write stderr messages to file logfile instead of to the terminal. Same as "-logfile file". To append to the file use "-oa file" or "-logappend file".

-flag file

Write the "PORT=NNNN" (e.g. PORT=5900) string to file in addition to stdout. This option could be useful by wrapper script to detect when x11vnc is ready.

-rc filename

Use filename instead of $HOME/.x11vncrc for rc file.


Do not process any .x11vncrc file for options.

-h, -help

Print this help text. -?, -opts Only list the x11vnc options.

-V, -version

Print program version and last modification date.


Instead of exiting after cleaning up, run a simple "debug crash shell" when fatal errors are trapped.


Be quiet by printing less informational output to stderr. Same as -quiet.


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 $host "x11vnc -display :0 -bg" | grep PORT`
port=`echo "$port" | sed -e 's/PORT=//'`
port=`expr $port - 5900`
vncviewer $host:$port

-modtweak, -nomodtweak

Option -modtweak automatically tries to adjust the AltGr and Shift modifiers for differing language keyboards between client and host. Otherwise, only a single key press/release of a Keycode is simulated (i.e. ignoring the state of the modifiers: this usually works for identical keyboards). Also useful in resolving cases where a Keysym is bound to multiple keys (e.g. "<" + ">" and "," + "<" keys). Default: -modtweak

-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 by itself. The default is to check whether some common keysyms, e.g. !, @, [, are only accessible via -xkb mode and if so then automatically enable the mode. To disable this automatic detection use -noxkb.

-skip_keycodes string

Ignore the comma separated list of decimal keycodes. Perhaps 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 in 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"


Experimental option that tries to correct some "sloppy" key behavior. E.g. if at the viewer you press Shift+Key but then release the Shift before Key that could give rise to extra unwanted characters (usually only between keyboards of different languages). Only use this option if you 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 and 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 does not exist in the X server, then add the Keysym to the X server's keyboard mapping on an unused key. Added Keysyms will be removed periodically and also when x11vnc exits. Default: -add_keysyms


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 pressed down.


As -clear_mods, except try to release any pressed key. Note that this option and -clear_mods can interfere with a person typing at the physical keyboard.

-remap string

Read Keysym remappings from 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 is instead interpreted as this form: key1-key2,key3-key4,... See <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)
Dead keys: "dead" (or silent, mute) keys are keys that do not produce a character but must be followed by a 2nd keystroke. This is often used for accenting characters, e.g. to put "`" on top of "a" by pressing the dead key and then "a". Note that this interpretation is not part of core X11, it is 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. However 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
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.


Ignore video framebuffer: only process keyboard and pointer. Intended for use with Win2VNC and x2vnc dual-monitor setups.


Do not watch for XBell events. (no beeps will be heard) Note: XBell monitoring requires the XKEYBOARD extension.


Do not manage exchange of X selection/cutbuffer between VNC viewers and the X server.


Do not poll the PRIMARY selection for changes to send back to clients. (PRIMARY is still set on received changes, however).

-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.

-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.


Do not use the XFIXES extension to draw the exact cursor shape even if it is available.

-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


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).


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).


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


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. Also sometimes needed on XINERAMA displays.

-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.


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.

-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,3,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.

-wirecopyrect mode, -nowirecopyrect

Since the -wireframe mechanism evidently tracks moving windows accurately, a speedup can be obtained by telling the VNC viewers to locally copy the translated window region. This is the VNC CopyRect encoding: the framebuffer update doesn't need to send the actual new image data.
Shorter aliases: -wcr [mode] and -nowcr
"mode" can be "never" (same as -nowirecopyrect) to never try the copyrect, "top" means only do it if the window was not covered by any other windows, and "always" means to translate the orginally unobscured region (this may look odd as the remaining pieces come in, but helps on a slow link). Default: "always"
Note: there can be painting errors or slow response when using -scale so you may want to disable CopyRect in this case "-wirecopyrect never" on the command line or by remote-control. Or you can also use the "-scale xxx:nocr" scale option.


Turn on debugging info printout for the wireframe heuristics. "-dwf" is an alias. Specify multiple times for more output.

-scrollcopyrect mode, -noscrollcopyrect

Like -wirecopyrect, but use heuristics to try to guess if a window has scrolled its contents (either vertically or horizontally). This requires the RECORD X extension to "snoop" on X applications (currently for certain XCopyArea and XConfigureWindow X protocol requests). Examples: 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 is 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 be) or other painting errors (window tearing, bunching-up, etc). These are automatically repaired in a short period of time. If this is unacceptable 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) 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.
"mode" can be "never" (same as -noscrollcopyrect) to never try the copyrect, "keys" means to try it in response to keystrokes only, "mouse" means to try it in response to mouse events only, "always" means to 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 "-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 be considered for the -scrollcopyrect detection scheme. This is to avoid wasting the effort on small rectangles that would be quickly updated the normal way. E.g. suppose an app updated the position of its skinny scrollbar first and then shifted the large panel it controlled. We want to be sure to skip the small scrollbar and get the large panel. Default: 60000

-scr_skip list

Skip scroll detection for applications matching the comma separated list of strings in list. Some applications implement their scrolling in strange ways where the XCopyArea, etc, also applies to invisible portions of the window: if we CopyRect those areas it looks awful during the scroll and there may be painting errors left after the scroll. Soffice.bin is the worst known offender.
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 is matched against is of the form "^^WM_NAME##Class++Instance<same-for-any-subwindows>" The "xlsclients -la" command will provide this info.
If a pattern is prefixed with "KEY:" it only applies to Keystroke generated scrolls (e.g. Up arrow). If it is prefixed with "MOUSE:" it only applies to Mouse induced scrolls (e.g. dragging on a scrollbar). Default: ##Soffice.bin,##StarOffice

-scr_inc list

Opposite of -scr_skip: this list is consulted first and if there is a match the window will be monitored via RECORD for scrolls irrespective of -scr_skip. Use -scr_skip '*' to skip anything that does not match your -scr_inc. Use -scr_inc '*' to include everything.

-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 one of your keystrokes disrupts typing too much, but you don't want to turn it off completely with "-scr mouse" and -scr_parms does not 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 is 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 list 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 comma separated list (same as for -scr_skip/-scr_inc). For example an annoying transient under scroll detection is if you hit Enter in a terminal shell with full text window, the solid text cursor block will be 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 is 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 are 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, then 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 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.
"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)
"s1+s2+s3+s4+s5" specify five floating point times in seconds that apply to scrollcopyrect detection with *Mouse* input: s1 is how long to wait after a mouse button is pressed for the first scroll, s2 is how long to keep waiting for additional scrolls after the first Mouse scroll was detected. s3 is how frequently to try to update surrounding scrollbars outside of the scrolling area (0.0 to disable). s4 is how long to buffer pointer motion (to try to get fewer, bigger mouse scrolls). s5 is the maximum time to spend just updating the scroll window without updating the rest of the screen.

-fixscreen string

Periodically "repair" the screen based on settings in string. Hopefully you won't need this option, it is intended for cases when the -scrollcopyrect or -wirecopyrect features leave too many painting errors, but it can be used for any scenario. This option periodically performs costly operations and so interactive response may be reduced when it is on. You can use 3 Alt_L's (the Left "Alt" key) taps in a row described under -scrollcopyrect instead to manually request a screen repaint when it is needed.
string is a comma separated list of one or more of the following: "V=t", "C=t", and "X=t". In these "t" stands for a time in seconds (it is a floating point even though one should usually use values > 2 to avoid wasting resources). V sets how frequently the entire screen should be sent to viewers (it is like the 3 Alt_L's). C sets how long to wait after a CopyRect to repaint the full screen. X sets how frequently to reread the full X11 framebuffer from the X server and push it out to connected viewers. Use of X should be rare, please report a bug if you find you need it. Examples: -fixscreen V=10 -fixscreen C=10


Turn on debugging info printout for the scroll heuristics. "-ds" is an alias. Specify it multiple times for more output.


Disable any use of the RECORD extension. This is currently used by the -scrollcopyrect scheme and to monitor X server grabs.

-grab_buster, -nograb_buster

Some of the use of the RECORD extension can leave a tiny window for XGrabServer deadlock. This is only if the whole-server grabbing application expects mouse or keyboard input before releasing the grab. It is usually a window manager that does this. x11vnc takes care to avoid the the problem, but if caught x11vnc will freeze. Without -grab_buster, the only solution is to go the physical display and give it some input to satisfy the grabbing app. Or manually kill and restart the window manager if that is 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) then 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.


Turn on debugging info printout with respect to XGrabServer() deadlock for -scrollcopyrect__mode_.

-pointer_mode n

Various pointer motion update schemes. "-pm" is an alias. The problem is pointer motion can cause rapid changes on the screen: consider 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 these rapid screen changes: everything will bog down when 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 selects one of the schemes desribed below.
Note that the -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 to see which one gives the best response for your usage, it is 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

-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 bandwith 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".


Print debugging output for every pointer event.


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 wait for updates before sending to client (deferUpdateTime) Default: 30

-wait time

Time in ms to pause between screen polls. Used to cut down on load. Default: 30

-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


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 continously 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 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.

-readtimeout n

Set libvncserver rfbMaxClientWait to n seconds. On slow links that take a long time to paint the first screen libvncserver may hit the timeout and drop the connection. Default: 20 seconds.


Monitor activity and if it is low take longer naps


between screen polls to really cut down load when idle. Default: take naps

-sb time

Time in seconds after NO activity (e.g. screen blank) to really throttle down the screen polls (i.e. sleep for about 1.5 secs). Use 0 to disable. Default: 60


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. Default: "ignore". This option is obsolete.

-threads, -nothreads

Whether or not to use the threaded libvncserver algorithm [rfbRunEventLoop] if libpthread is available Default: -nothreads

-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


Print debugging output for tiles, fb updates, etc.


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. 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, or where window tearing is a problem.

-rawfb string

Experimental option, instead of polling X, poll the memory object specified in string. For shared memory segments it is of the form: "shm:N@WxHxB" which specifies a shmid N and framebuffer Width, Height, and Bits per pixel. To memory map mmap(2) a file use: "map:/path/to/a/file@WxHxB". If there is trouble with mmap, use "file:/..." for slower lseek(2) based reading. If you do not supply a type "map" is assumed if the file exists.
If string is "setup:cmd", then the command "cmd" is run and the first line from it is read and used as string. This allows initializing the device, determining WxHxB, etc. These are often done as root so take care.
Optional suffixes are ":R/G/B" and "+O" to specify red, green, and blue masks and an offset into the memory object. If the masks are not provided x11vnc guesses them based on the bpp.
-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
(see ipcs(1) and fbset(1) for the first two examples)
All user input is discarded by default (but see the -pipeinput option). 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/changing them.
If you don't want x11vnc to close the X DISPLAY in rawfb mode, then capitalize the prefix, SHM:, MAP:, FILE: Keeping the display open enables the default remote-control channel, which could be useful. Also, if you also 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.

-pipeinput cmd

Another experimental option: it lets you supply an external command in cmd that x11vnc will pipe all of the user input events to in a simple format. In -pipeinput mode by default x11vnc will not process any of the user input events. If you prefix cmd with "tee:" it will 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 pipe if it exits. Separate multiple prefixes with commas.
In combination with -rawfb one might be able to do 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.

-gui [gui-opts]

Start up a simple tcl/tk gui based on the 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.
4) 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).
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.
5) 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.

-remote command

Remotely control some aspects of an already running x11vnc server. "-R" and "-r" are aliases for "-remote". After the remote control command is sent to the running server the 'x11vnc -remote ...' 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 VNC_CONNECT), 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.
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:<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"
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.
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.
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"
connect:host do reverse connection to host, "host" may be a comma separated list of hosts or host:ports. See -connect.
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.
allowonce:host For the next connection only, allow connection from "host".
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.
nolookup enable -nolookup mode.
lookup disable -nolookup mode.
input:str set -input to "str", empty to disable.
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).
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".
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.
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.
remap:str set -remap "str" (empty to disable). See -remap for the form of "str" (basically: key1-key2,key3-key4,...) Use "+key1-key2" to append a single keymapping, use "-key1-key2" to delete.
norepeat enable -norepeat mode.
repeat disable -norepeat mode.
nofb enable -nofb mode.
fb disable -nofb mode.
bell enable bell (if supported).
nobell disable bell.
nosel enable -nosel mode.
sel disable -nosel mode.
noprimary enable -noprimary mode.
primary disable -noprimary mode.
seldir:str set -seldir to "str"
cursor:mode enable -cursor "mode".
show_cursor enable showing a cursor.
noshow_cursor disable showing a cursor. (same as "nocursor")
arrow:n set -arrow to alternate n.
xfixes enable xfixes cursor shape mode.
noxfixes disable xfixes cursor shape mode.
alphacut:n set -alphacut to n.
alphafrac:f set -alphafrac to f.
alpharemove enable -alpharemove mode.
noalpharemove disable -alpharemove mode.
alphablend disable -noalphablend mode.
noalphablend enable -noalphablend mode.
cursorshape disable -nocursorshape mode.
nocursorshape enable -nocursorshape mode.
cursorpos disable -nocursorpos mode.
nocursorpos enable -nocursorpos mode.
xwarp enable -xwarppointer mode.
noxwarp disable -xwarppointer mode.
buttonmap:str set -buttonmap "str", empty to disable
dragging disable -nodragging mode.
nodragging enable -nodragging mode.
wireframe enable -wireframe mode. same as "wf"
nowireframe disable -wireframe mode. same as "nowf"
wireframe:str enable -wireframe mode string.
wireframe_mode:str enable -wireframe mode string.
wirecopyrect:str set -wirecopyrect string. same as "wcr:"
scrollcopyrect:str set -scrollcopyrect string. same "scr"
noscrollcopyrect disable -scrollcopyrect__mode_. "noscr"
scr_area:n set -scr_area to n
scr_skip:list set -scr_skip to "list"
scr_inc:list set -scr_inc to "list"
scr_keys:list set -scr_keys to "list"
scr_term:list set -scr_term to "list"
scr_keyrepeat:str set -scr_keyrepeat to "str"
scr_parms:str set -scr_parms parameters.
fixscreen:str set -fixscreen to "str".
noxrecord disable all use of RECORD extension.
xrecord enable use of RECORD extension.
reset_record reset RECORD extension (if avail.)
pointer_mode:n set -pointer_mode to n. same as "pm"
input_skip:n set -input_skip to n.
speeds:str set -speeds to str.
wmdt:str set -wmdt to str.
debug_pointer enable -debug_pointer, same as "dp"
nodebug_pointer disable -debug_pointer, same as "nodp"
debug_keyboard enable -debug_keyboard, same as "dk"
nodebug_keyboard disable -debug_keyboard, same as "nodk"
defer:n set -defer to n ms,same as deferupdate:n
wait:n set -wait to n ms.
wait_ui:f set -wait_ui factor to f.
wait_bog disable -nowait_bog mode.
nowait_bog enable -nowait_bog mode.
slow_fb:f set -slow_fb to f seconds.
readtimeout:n set read timeout to n seconds.
nap enable -nap mode.
nonap disable -nap mode.
sb:n set -sb to n s, same as screen_blank:n
xdamage enable xdamage polling hints.
noxdamage disable xdamage polling hints.
xd_area:A set -xd_area max pixel area to "A"
xd_mem:f set -xd_mem remembrance to "f"
fs:frac set -fs fraction to "frac", e.g. 0.5
gaps:n set -gaps to n.
grow:n set -grow to n.
fuzz:n set -fuzz to n.
snapfb enable -snapfb mode.
nosnapfb disable -snapfb mode.
rawfb:str set -rawfb mode to "str".
progressive:n set libvncserver -progressive slice height parameter to n.
desktop:str set -desktop name to str for new clients.
rfbport:n set -rfbport to n.
httpport:n set -httpport to n.
httpdir:dir set -httpdir to dir (and enable http).
enablehttpproxy enable -enablehttpproxy mode.
noenablehttpproxy disable -enablehttpproxy mode.
alwaysshared enable -alwaysshared mode.
noalwaysshared disable -alwaysshared mode. (may interfere with other options)
nevershared enable -nevershared mode.
nonevershared disable -nevershared mode. (may interfere with other options)
dontdisconnect enable -dontdisconnect mode.
nodontdisconnect disable -dontdisconnect mode. (may interfere with other options)
debug_xevents enable debugging X events.
nodebug_xevents disable debugging X events.
debug_xdamage enable debugging X DAMAGE mechanism.
nodebug_xdamage disable debugging X DAMAGE mechanism.
debug_wireframe enable debugging wireframe mechanism.
nodebug_wireframe disable debugging wireframe mechanism.
debug_scroll enable debugging scrollcopy mechanism.
nodebug_scroll disable debugging scrollcopy mechanism.
debug_tiles enable -debug_tiles
nodebug_tiles disable -debug_tiles
debug_grabs enable -debug_grabs
nodebug_grabs disable -debug_grabs
dbg enable -dbg crash shell
nodbg disable -dbg crash shell
noremote disable the -remote command processing, it cannot be turned back on.
The vncconnect(1) command from standard VNC
distributions may also be used if string is prefixed
with "cmd=" E.g. 'vncconnect cmd=stop'. Under some
circumstances xprop(1) can used if it supports -set
(see the FAQ).
If "-connect /path/to/file" has been supplied to the
running x11vnc server then that file can be used as a
communication channel (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 directly write to the file via something
like: "echo cmd=stop > /path/to/file", etc.

-query variable

Like -remote, except just query the value of variable. "-Q" is an alias for "-query". Multiple queries can be done by separating variables by commas, e.g. -query var1,var2. The results come back in the form ans=var1:value1,ans=var2:value2,... to the standard output. If a variable is read-only, it comes back with prefix "aro=" instead of "ans=".
Some -remote commands are pure actions that do not make sense as variables, e.g. "stop" or "disconnect", in these cases the value returned is "N/A". To direct a query straight to the VNC_CONNECT property or connect file use "qry=..." instead of "cmd=..."
Here is the current list of "variables" that can be supplied to the -query command. This includes the "N/A" ones that return no useful info. For variables names that do not correspond to an x11vnc option or remote command, we hope the name makes it obvious what the returned value corresponds to (hint: the ext_* variables correspond to the presence of X extensions):
ans= stop quit exit shutdown ping blacken zero refresh reset close disconnect id sid waitmapped nowaitmapped clip flashcmap noflashcmap shiftcmap truecolor notruecolor overlay nooverlay overlay_cursor overlay_yescursor nooverlay_nocursor nooverlay_cursor nooverlay_yescursor overlay_nocursor visual scale scale_cursor viewonly noviewonly shared noshared forever noforever once timeout deny lock nodeny unlock connect allowonce allow localhost nolocalhost listen lookup nolookup accept gone shm noshm flipbyteorder noflipbyteorder onetile noonetile solid_color solid nosolid blackout xinerama noxinerama xtrap noxtrap xrandr noxrandr xrandr_mode padgeom quiet q noquiet modtweak nomodtweak xkb noxkb skip_keycodes sloppy_keys nosloppy_keys skip_dups noskip_dups add_keysyms noadd_keysyms clear_mods noclear_mods clear_keys noclear_keys remap repeat norepeat fb nofb bell nobell sel nosel primary noprimary seldir cursorshape nocursorshape cursorpos nocursorpos 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 buttonmap dragging nodragging wireframe_mode wireframe wf nowireframe nowf 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 input client_input speeds wmdt debug_pointer dp nodebug_pointer nodp debug_keyboard dk nodebug_keyboard nodk deferupdate defer wait_ui wait_bog nowait_bog slow_fb wait readtimeout nap nonap sb screen_blank fs gaps grow fuzz snapfb nosnapfb rawfb 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 dbg nodbg noremote
aro= noop display vncdisplay desktopname guess_desktop http_url auth xauth users rootshift clipshift scale_str scaled_x scaled_y scale_numer scale_denom scale_fac scaling_blend scaling_nomult4 scaling_pad scaling_interpolate inetd privremote unsafe safer nocmds passwdfile using_shm logfile o flag 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 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

Just like -query variable, but returns the default value for that parameter (no running x11vnc server is consulted)


By default -remote commands are run asynchronously, that is, the request is posted and the program immediately exits. Use -sync to have the program wait for an acknowledgement from the x11vnc server that command was processed (somehow). On the other hand -query requests are always processed synchronously because they have to wait for the answer.
Also note that if both -remote and -query requests are supplied on the command line, the -remote is processed first (synchronously: no need for -sync), and then the -query request is processed in the normal way. This allows for a reliable way to see if the -remote command was processed by querying for any new settings. Note however that there is timeout of a few seconds so if the x11vnc takes longer than that to process the requests the requestor will think that a failure has taken place.

-noremote, -yesremote

Do not process any remote control commands or queries. 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 VNC_CONNECT, then they can remotely control x11vnc. Normally access to the X display is protected. Note that if they can modify VNC_CONNECT 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 do not think -noremote is enough, to disable the VNC_CONNECT property channel completely use -novncconnect, or use the -safer option that shuts many things off.


A few remote commands are disabled by default (currently: id:pick, accept:<cmd>, gone:<cmd>, and rawfb:setup:<cmd>) because they are 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.


Equivalent to: -novncconnect -noremote and prohibiting -gui and the -connect file. Shuts off communcation channels.


Perform some sanity checks and disable 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.


No external commands (e.g. system(3) , popen(3) , exec(3) ) will be run.


For use with -remote nodeny: start out denying all incoming clients until "-remote nodeny" is used to let them in.

These options are passed to libvncserver:

-rfbport port

TCP port for RFB protocol

-rfbwait time

max time in ms to wait for RFB client

-rfbauth passwd-file

use authentication on RFB protocol (use 'storepasswd' to create a password file)

-passwd plain-password

use authentication (use plain-password as password, USE AT YOUR RISK)

-deferupdate time

time in ms to defer updates (default 40)

-desktop name

VNC desktop name (default "LibVNCServer")


always treat new clients as shared


never treat new clients as shared


don't disconnect existing clients when a new non-shared connection comes in (refuse new connection instead)

-httpdir dir-path

enable http server using dir-path home

-httpport portnum

use portnum for http connection


enable http proxy support

-progressive height

enable progressive updating for slow links

-listen ipaddr

listen for connections only on network interface with addr ipaddr. '-listen localhost' and hostname work too.


$HOME/.x11vncrc, $HOME/.Xauthority



The following are set for the auxiliary commands run by -accept and -gone:



vncviewer(1), vncpasswd(1), vncconnect(1), vncserver(1), Xvnc(1), inetd(1), xev(1), xmodmap(1), Xserver(1), xauth(1), xhost(1), Xsecurity(7), xmessage(1), ipcrm(1),,,,


x11vnc was written by Karl J. Runge <>, it is part of the LibVNCServer project <>. This manual page is based one the one written by Ludovic Drolez <>, for the Debian project (both may be used by others).