Fact-checked by Grok 2 weeks ago

x11vnc

x11vnc is a free and open-source (Virtual Network Computing) server that enables remote viewing and interaction with existing, real X11 display sessions on operating systems, corresponding to physical monitors, keyboards, and mice, using any compatible VNC viewer. Developed initially by Karl J. Runge starting in 2002, x11vnc functions as the Unix/X11 equivalent to WinVNC for Windows, allowing users to share and control a live without requiring a separate virtual session. After Runge's final release (version 0.9.13) around 2010, the project transitioned to community maintenance under the LibVNC umbrella, with subsequent community releases, the latest being version 0.9.17 as of May 2025. It is licensed under the GNU General Public License version 2 or later, with an exception permitting linkage to the library. Among its notable features, x11vnc supports robust security options including built-in SSL/TLS encryption, 2048-bit authentication, VeNCrypt protocol integration, and UNIX account/password logins to protect remote connections. It offers practical enhancements such as server-side scaling for varying client resolutions, single-port /HTTP tunneling for VNC traffic, compatibility, and file transfer capabilities compatible with and viewers. Additionally, x11vnc extends usability to diverse environments, including Mac OS X (Aqua/), embedded systems, and non-X devices like webcams or TV tuners, while advertising services via Zeroconf for easier discovery. As of 2025, the project remains available through major Linux distributions and is noted for its reliability in providing headless or remote desktop access, though it currently seeks a new maintainer due to limited ongoing development.

Overview and History

Description

x11vnc is a VNC server program designed for remote access to existing X Window sessions on Unix and systems. It enables users to view and interact with a physical display from a remote location using standard VNC client software, effectively mirroring the local monitor, keyboard, and mouse inputs over the network. At its core, x11vnc operates by continuously polling the X11 to capture changes in real time and transmitting these updates to connected VNC clients. Developed originally by Karl J. Runge starting in 2002, it is distributed as part of the LibVNCServer project under version 2 or later (GPL-2.0-or-later). The software primarily supports systems including and OS X, with a focus on X11 but also extending to non-X devices, featuring an English-language .

Development and Releases

x11vnc was initially developed by Karl J. Runge in 2002 as a standalone VNC server designed to provide remote access to existing real X displays, addressing limitations in earlier tools like x0rfbserver on platforms such as . Written in plain for wide Unix compatibility, it quickly evolved from a proof-of-concept into a feature-rich application through Runge's enhancements, focusing on performance improvements and broad platform support. Over the years, x11vnc integrated with the LibVNCServer project, leveraging its core VNC library to facilitate broader development within the VNC ecosystem and enabling easier maintenance and extensions. Runge maintained the project until releasing version 0.9.13 in December 2010, after which the LibVNC assumed responsibility, marking a shift from individual to collaborative development. The project's repository is hosted at github.com/LibVNC/x11vnc, with the official website available at libvnc.github.io, serving as hubs for , , and issue tracking. efforts continued post-2010 with version 0.9.14 (first release, adding X Composite Extension support and support via deskshot), 0.9.15 ( fixes, 1.1.0 support), culminating in version 0.9.16 on January 5, 2019, which included build fixes and updates, followed by version 0.9.17 on May 1, 2025, adding support for multi-touch, additional mouse buttons, and compatibility. This progression reflects x11vnc's transformation into a highly configurable VNC sustained by ongoing contributions, despite ongoing calls for a new dedicated maintainer as of 2025.

Core Features

Remote Display Access

x11vnc enables remote access to real X11 displays by continuously polling the to mirror the content of physical screens, allowing users to view and interact with the as if present locally. This mirroring targets existing X sessions on displays such as :0, using efficient mechanisms to detect and transmit only changed regions of the screen. Beyond standard X11 environments, x11vnc extends support to non-X11 devices, including webcams for via the -rawfb video option, Mac OS X Aqua/ displays with native handling, and various frame buffers like those in systems or TV tuners. For instance, frame buffer access can be configured with -rawfb map:/dev/fb0@1024x768x32 to share console or raw video output remotely. These capabilities allow x11vnc to serve as a versatile tool for displaying diverse visual sources over VNC connections. x11vnc integrates several extensions to enhance remote sessions, including enabled by -tightfilexfer or -ultrafilexfer for secure data exchange, text chat for communication between client and server, and single-window mode via -id windowid to focus on specific application windows. These features, compatible with viewers like SSVNC, provide additional utilities without disrupting the core display mirroring. For efficient frame buffer access, x11vnc employs the XShmGetImage function via MIT-SHM extension to quickly retrieve screen data, minimizing CPU overhead during polling. It further leverages the X DAMAGE extension to receive notifications of modified screen regions, reducing unnecessary full-screen scans and improving update responsiveness. Cursor display is handled accurately using the XFIXES extension for shape rendering, with options like -cursor most to include various cursor types, and scaling via -scale_cursor to adapt to remote resolutions. Performance tuning options include the , which outlines moving windows with wireframes instead of full redraws to accelerate interactions like dragging, and brief polling in 32-pixel increments for incremental updates. These mechanisms ensure smooth transmission of screen updates, with handled by the underlying libvncserver library to optimize usage. As of version 0.9.17 (released May 2025), x11vnc has added support for the X Composite Extension to enable off-screen window sharing and experimental double-buffered and rawfb /shm support, further improving remote display capabilities.

Security Mechanisms

x11vnc provides several built-in security mechanisms to protect remote to X11 displays, including , , and access controls, which help mitigate risks associated with exposing VNC sessions over networks. For , x11vnc supports Unix username and verification using the -unixpw option, which prompts for credentials and switches to the authenticated user for either view-only or full-control depending on the configuration. This method leverages the system's native , such as su or NIS, ensuring that only valid Unix users can initiate sessions. Additionally, standard VNC protection is available via the -rfbauth or -passwdfile options, where passwords are stored in an obfuscated file created with tools like vncpasswd or -storepasswd. View-only modes can be enforced with -viewonly to restrict clients to observation without input, or a separate view-only can be set using -viewpasswd for differentiated levels. Encryption is supported through SSL/TLS via the -ssl option, which enables secure communication using and a PEM certificate, defaulting to a self-signed one if none is provided. This integrates with the VeNCrypt protocol, allowing encrypted VNC connections that combine TLS with standard VNC authentication subtypes like or TLSVnc. For added flexibility, x11vnc can use external tools like stunnel with the -stunnel option to wrap non-SSL VNC servers in an SSL tunnel. Access control features include the -allow and -deny options, which restrict connections to or from specified hosts, addresses, or networks (e.g., -allow 192.168.1.0/24), providing IP-based filtering. Reverse connections are facilitated by the -connect option, enabling the server to initiate outbound connections to clients, often combined with SSH for . SSH tunneling is recommended for enhanced protection, such as running ssh -t -L 5900:[localhost](/page/Localhost):5900 user@host 'x11vnc -localhost' to forward traffic securely without exposing the VNC port directly. x11vnc integrates with external tools like SSVNC, an enhanced viewer that supports SSL/TLS , VeNCrypt, and automatic SSH tunneling, allowing secure viewer-side connections to x11vnc servers with features like certificate management and proxy support.

Technical Implementation

Polling Algorithm

The polling algorithm in x11vnc is designed to detect changes in the X11 display efficiently by continuously monitoring the for updates that need to be transmitted to remote VNC clients. The primary method involves real-time polling of the X11 using the XShmGetImage function, which leverages extensions for faster access to pixel data compared to standard XGetImage calls. This approach allows x11vnc to retrieve rectangular regions of the screen and compare them against a locally maintained copy to identify differences, encoding only the modified areas for transmission. To optimize performance and reduce computational overhead, x11vnc employs a row-based scanning technique, reading full horizontal scanlines that are one tall but separated vertically by increments of pixels. This sparse sampling method scans the entire screen in a top-to-bottom fashion, restarting at the top upon reaching the bottom, and proves effective for detecting most visual changes without examining every . By focusing on these spaced rows, the algorithm minimizes the amount of data processed per polling cycle while still capturing significant updates, such as window movements or text insertions. When the X DAMAGE extension is available on the display—which x11vnc enables by default since version 0.9.10—it integrates this protocol to receive notifications from the about damaged (changed) regions, further refining the polling process. These notifications provide bounding rectangles that serve as hints, allowing x11vnc to skip scanlines that do not intersect recent DAMAGE areas and prioritize polling within affected zones, thereby reducing unnecessary framebuffer reads and accelerating change detection. The extension requires the libXdamage library and can be disabled via the -noxdamage option if compatibility issues arise. x11vnc distinguishes between full-screen updates and incremental changes in its polling strategy to balance completeness and efficiency. Upon initial connection or significant events like screen resizing, it performs a full poll and transmission to ensure the client receives the complete display state. For ongoing operation, the algorithm focuses on incremental updates by polling only suspected changed regions, using the row scans and DAMAGE hints to limit data to small rectangles, which are then encoded (e.g., via Tight or ZRLE) before sending. This selective approach prevents redundant full updates during typical interactive use. Despite these optimizations, the polling mechanism can impact on high-latency , where the local polling remains fast but the transmission of even small incremental updates may introduce delays due to round-trip times exceeding 20 . In such scenarios, x11vnc's bandwidth-efficient encoding helps mitigate issues, but users may experience in responsive applications; options like -defer 100 () can update frequency to better suit constrained connections without overwhelming the network. Additionally, on systems with high screen update rates, the CPU overhead from frequent XShmGetImage calls may rise, though DAMAGE integration typically keeps it under 5-10% utilization for standard desktops.

Input Injection

x11vnc simulates user inputs from remote VNC clients to the local X session primarily through the of the . This extension enables the injection of synthetic events directly into the without requiring physical hardware input. Specifically, events are handled via XTestFakeKeyEvent, mouse button events via XTestFakeButtonEvent, and pointer movements via XTestFakeMotionEvent. The tool supports both relative and absolute pointer movements to accommodate different client behaviors and multi-monitor setups. Absolute movements set the pointer to specific screen coordinates using XTestFakeMotionEvent, while relative movements compute deltas from the current position, often leveraging acceleration parameters via uinput-based injection (e.g., accel=f in -pipeinput UINPUT) for finer control in environments. For complex input scenarios beyond standard XTEST capabilities, x11vnc allows custom injection through external programs using the -pipeinput option, which pipes keystroke and mouse events to user-specified commands or devices such as /dev/input/uinput for direct event writing. This enables tailored handling, for instance, in systems or when emulating specific input devices. Keyboard mappings and modifiers are managed to ensure across layouts, with options like -modtweak adjusting for differences in AltGr and Shift between client and keyboards, and -xkb utilizing the XKEYBOARD extension for accurate modifier state tracking. Remapping is supported via -remap for custom keysym translations, while lock keys like can be skipped or emulated as needed. In configurations enabled by -xinerama, inputs are directed appropriately across screens, potentially switching to XWarpPointer for reliable pointer relocation instead of XTEST. Limitations arise in certain environments, particularly with modern managers or secure X sessions where input grabbing via -grabkbd or -grabptr may fail due to restricted or . for input permissions is required in protected sessions, as detailed in the security mechanisms section.

Xvnc Emulation

x11vnc interfaces with virtual X s to enable remote in headless environments or when no physical is active, emulating key behaviors of Xvnc for and seamless . This capability allows users to connect to dynamically created sessions without requiring a pre-existing X , supporting scenarios where traditional real- is unavailable. The -create option instructs x11vnc to automatically launch a virtual , such as , if no suitable is found. It operates via the FINDCREATEDISPLAY , probing for numbers starting from :20 up to a maximum of 80 attempts, and serves as an alias for the command -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb. This feature ensures session availability by initializing a virtual framebuffer-based on demand, facilitating remote interaction in automated setups. In -svc mode, x11vnc activates a services optimized for secure, multi-user , incorporating SSL and Unix via the alias -display WAIT:cmd=FINDCREATEDISPLAY-Xvfb -unixpw -users unixpw= -ssl SAVE. This supports automatic session attachment by creating a virtual if needed, allowing integration with service management systems for persistent, on-demand VNC availability without manual port memorization. x11vnc emulates Xvnc behavior through redirection modes, such as -display WAIT:cmd=FINDCREATEDISPLAY-Xvnc.redirect, which forwards directly to an Xvnc instance without the overhead of polling. This approach maintains with VNC clients and servers expecting Xvnc's screen handling, enabling smoother in mixed environments. For multiple s, x11vnc handles enumeration using the -finddpy option to list active X s and supports region-specific access via -clip, which limits viewing to sub-areas of a for targeted session . Session persistence is ensured by the -forever option, which prevents the server from exiting upon client disconnection, or -loop, which restarts the process cyclically to maintain availability across . These mechanisms allow sessions created by -create or -svc to remain active, supporting shared or long-running remote interactions. Common use cases for x11vnc's Xvnc include automated background VNC servers on headless systems, such as those initialized at boot for or integrated with for on-demand service provisioning. In these scenarios, -svc or -create modes provide virtual desktops to users via encrypted channels, ideal for terminal services-like access in server environments without physical monitors.

Client-Side Caching

Client-side caching in x11vnc is an experimental feature designed to optimize remote display performance by storing pixel data on the viewer side, thereby reducing bandwidth consumption and latency for recurring screen elements. Activated through the -ncache n command-line option, where n specifies the cache multiplier (defaulting to 10, with a minimum of 0 to disable), this mode expands the server's framebuffer vertically by creating an off-screen "scratch" region equivalent to n times the display height, resulting in a total height of (n+1) times the original for a display of width W and height H. For instance, at 1280x1024 resolution and 24 bits per pixel, this can allocate approximately 7.5 MB of additional memory for n=2 (total ≈11.5 MB), scaling to approximately 37.5 MB additional (total over 41 MB) for the default n=10, with both server and client requiring substantial RAM to handle the extended buffer. The mechanism operates by having the copy frequently accessed screen regions—such as static windows or menus—into the off-screen area, then transmitting references or updates to the client via VNC protocol extensions like copyrect, allowing the viewer to retrieve and pixels locally without full resends. Compatible viewers, such as SSVNC, conceal the extra cache region to maintain a seamless display, enabling rapid updates when users cycle through multiple windows or revisit unchanged areas. Recommended settings include n=6 to 12 for scenarios involving 4 to 6 large windows, like web browsers, where repeated visibility of elements benefits most from local storage. Benefits include significantly faster response times and lower usage, particularly for bandwidth-constrained connections, as the client avoids redundant transmissions for persistent or reappearing content. However, the feature remains experimental, incurring high overhead that can strain resources on both ends, and it may introduce issues with unsupported viewers or lead to visual artifacts like painting errors during window drags if -ncache_cr is enabled for optimized copyrect handling of opaque moves. Additional parameters, such as -ncache_pad n (default 0 on Unix systems, 24 on macOS for handling), further tune the caching rectangles around windows, but overall adoption is limited by the need for viewer-specific support and potential inefficiencies on composited desktops like macOS X. This caching approach complements broader in remote access but focuses specifically on client-local data retention post-transmission.

Usage and Applications

Installation and Configuration

x11vnc can be installed on systems using s provided by major distributions. For Debian-based systems such as , the command sudo apt install x11vnc retrieves and installs the latest packaged version from the repositories. As of November 2025, major distributions package version 0.9.17 or later. On , sudo pacman -S x11vnc performs the installation. For other distributions, equivalent commands like sudo dnf install x11vnc on or sudo emerge x11vnc on Gentoo are available. Note: x11vnc requires an X11 (Xorg) session. On distributions defaulting to (e.g., 24.04, 41 as of 2025), log in using the Xorg session option at the login screen or configure the display manager to use X11. To compile from source, download the latest release tarball from the project's releases page (LibVNC/x11vnc), such as x11vnc-0.9.17.tar.gz (as of May 2025). Extract the archive and run autoreconf -fiv followed by ./configure and make. Dependencies including libvncserver, , and zlib must be installed beforehand, with options like --with-jpeg=/usr/local for custom paths on systems like . Basic startup requires specifying the X and a password for . The command x11vnc -display :0 -passwd mypassword launches the on the default :0 with the given password. To make the persistent, add the -forever option, which restarts it after client disconnections: x11vnc -display :0 -passwd mypassword -forever. Passwords can also be stored in a file using x11vnc -storepasswd to create ~/.vnc/passwd, then referenced with -rfbauth ~/.vnc/passwd. Key command-line options allow customization of server behavior. The -rfbport 5901 option sets the listening (default is 5900), useful for avoiding conflicts. For multiple simultaneous clients, include -shared. To enable reverse connections where the initiates to a viewer, use -connect viewerhost:[port](/page/Port). Desktop scaling is achieved with -scale 1/2 to reduce by half, aiding low-bandwidth scenarios. Common issues often involve and network access. If the denies connection due to , specify the with -auth /path/to/.Xauthority or use -auth guess for automatic detection. For display managers like GDM, set -env FD_XDM=1 -auth guess. setups require opening the chosen port, such as sudo ufw allow 5900 on , to permit incoming VNC traffic. For secure remote access, integrate x11vnc with SSH tunneling to encrypt connections. On the , run ssh -L 5900:localhost:5900 user@serverhost to forward the local port 5900 to the server's :5900, then connect a VNC viewer to :5900. On the server, start x11vnc with -localhost to restrict listening to : x11vnc -display :0 -passwd mypassword -localhost -forever. This method leverages SSH for and avoids exposing the VNC port directly.

Specialized Uses

x11vnc facilitates remote control of scientific instruments, such as (NMR) spectrometers, enabling operators to interact with instrument interfaces from distant locations without physical presence. In research environments, it supports headless deployments for simulation platforms like GibsonEnv, where researchers access graphical X sessions remotely to run and monitor experiments in and . In industrial settings, x11vnc provides remote access for systems, including (NI) Real-Time targets used in and applications. This allows monitoring and adjustment of system statuses in resource-constrained environments, such as those in or test equipment, by streaming the existing X display over VNC. For educational purposes, x11vnc enables shared sessions in classroom settings through its multi-client support, allowing instructors to demonstrate or collaborate on graphical applications across multiple student machines. It has been integrated into tools like the Student Control Panel for Ubuntu-based learning environments, facilitating remote assistance and screen sharing during programming or technical sessions. Docker images incorporating x11vnc further support unified teaching setups for programming courses, providing consistent remote access to development environments. x11vnc integrates with scripts for unattended remote , often configured as a service to start automatically and persist across reboots, enabling scripted control of graphical interfaces without user intervention. Examples include on-demand startup scripts for deployments, where it launches via jobs or event triggers to support automated testing or monitoring tasks. In healthcare, x11vnc underpins privacy-preserving screen capture systems for health IT studies, capturing electronic medical record () interfaces from real deployments at large providers while automatically redacting sensitive patient data using techniques like Gabor filters. This approach, tested on 80 screenshots, allows clinicians to document interface issues—such as dropdown errors—for developers without compromising , closing the feedback loop in mission-critical systems.

References

  1. [1]
    LibVNC/x11vnc: a VNC server for real X displays - GitHub
    x11vnc allows one to view remotely and interact with real X displays (ie a display corresponding to a physical monitor, keyboard, and mouse) with any VNC ...
  2. [2]
    x11vnc - Homebrew Formulae
    https://github.com/LibVNC/x11vnc. License: GPL-2.0-or-later WITH x11vnc-openssl-exception. Formula JSON API: /api/formula/x11vnc.json. Formula code: x11vnc.rb ...
  3. [3]
    X11vnc - ArchWiki
    Feb 8, 2025 · While it is not developed any longer by its original author Karl Runge, LibVNC and x11vnc's community on GitHub have taken over the development.
  4. [4]
    LibVNCServer/LibVNCClient
    LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program.
  5. [5]
    Releases · LibVNC/x11vnc - GitHub
    May 1, 2025 · Releases: LibVNC/x11vnc · x11vnc 0.9.17 · New Features: · Bug Fixes: · Documentation & Maintenance: · Other Changes: · x11vnc 0.9.16 · x11vnc 0.9.15.Missing: stable | Show results with:stable
  6. [6]
  7. [7]
    x11vnc(1) - Linux man page
    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.
  8. [8]
    ssvnc: SSL/SSH VNC viewer
    The Enhanced TightVNC Viewer, SSVNC, adds encryption security to VNC connections. The package provides a GUI for Windows, Mac OS X, and Unix.<|separator|>
  9. [9]
    x11vnc-0.9.13.tar.gz: x11vnc-0.9.13/x11vnc/README | Fossies
    1 2 Copyright (C) 2002-2011 Karl J. Runge <runge@karlrunge.com> 3 All rights reserved. 4 5 x11vnc README file Date: Wed Aug 10 18:32:09 EDT 2011 6 7 The ...
  10. [10]
    x11vnc is slow, but using only 10% of available bandwidth
    Jun 4, 2012 · I am using x11vnc over 15Mbit/s network with 20ms latency. When the screen is changing a lot x11vnc is slow - for example when I switch a ...Missing: incremental | Show results with:incremental
  11. [11]
    XTEST Extension Protocol - X.Org
    Chapter 1. Overview. This extension is a minimal set of client and server extensions required to completely test the X11 server with no user intervention.
  12. [12]
    deepin-community/x11vnc - GitHub
    While 0.9.13 was the last release by the original author Karl Runge, 0.9.14 was the first community-based release here on GitHub. This repo represents ...
  13. [13]
    Support x11vnc ncache mode (#2031) · Issue - Remmina - GitLab
    Dec 16, 2019 · The ncache mode of x11vnc makes the frame buffer N times taller than the real display, to provide a space for pixel data to be cached on the ...
  14. [14]
    Wrong vertical size when using x11vnc with -ncache #525 - GitHub
    Aug 26, 2015 · When I use x11vnc with its "client-side pixel caching" (e.g. -ncache 10), the noVNC view is wrongly enlarged vertically by the buffersize. and ...
  15. [15]
    Remote operation of Spectrometer using VNC Viewer
    Jan 6, 2023 · The VNC server (x11vnc) is automatically started on demand when a connection is attempted, so there is no need to manually start a VNC server.Missing: scientific | Show results with:scientific
  16. [16]
    StanfordVL/GibsonEnv: Gibson Environments: Real-World ... - GitHub
    Notes on deployment on a headless server. Gibson Env supports deployment on a headless server and remote access with x11vnc . You can build your own docker ...
  17. [17]
  18. [18]
    Installing and using x11vnc on a 2016 x64 target (remote UI access ...
    Aug 15, 2016 · This is a package that allows you to serve the current UI over a VNC connection to the target (meaning that you can remotely check the status of ...
  19. [19]
    x11vnc - allow VNC connections to real X11 displays
    ... version: 0.9.16, lastmod: 2019-01-05. SYNOPSIS. x11vnc [OPTION] ... For additional info see: http://www.karlrunge.com/x11vnc/ and http://www ...
  20. [20]
    StudentControlPanelSpec - Ubuntu Wiki
    Jun 9, 2006 · Since x11vnc reads the password on every new connection from that file it *could* affect existing Student Control Panel sessions. Because of ...
  21. [21]
    x11vnc/docker-desktop - Docker Image
    This repository offers a Docker/Singularity image for Ubuntu with X11 and VNC. It can be useful in delivering a unified enviroment for teaching programming ...
  22. [22]
    How to install x11vnc vnc server as a service on Ubuntu 20.04, for ...
    Install lightdm, then x11vnc. Create a service file, reload systemd, enable the service, and test by rebooting. Don't lock the screen.Missing: emulation compatibility
  23. [23]
    Auto Install Remote Control for Raspberry PI (X11VNC) for non-Geeks
    This is an old method of accessing a Pi remotely – I now use the built in VNC server but I'm leaving this here for posterity. This is only for non-geek ...
  24. [24]
    Privacy-preserving screen capture: Towards closing the loop for ...
    We discuss how these techniques can translate into instrumentation systems that improve real-world health IT deployments. Graphical abstract. Download ...
  25. [25]
    [PDF] Privacy-preserving screen capture - Dartmouth Computer Science
    However, real-world health IT systems are typically replete with privacy-sensitive data regarding patients, diagnoses, clinicians, and EMR user interface ...