X11vnc
Encyclopedia
In computing
Computing
Computing is usually defined as the activity of using and improving computer hardware and software. It is the computer-specific part of information technology...

, x11vnc is a Virtual Network Computing
Virtual Network Computing
In computing, Virtual Network Computing is a graphical desktop sharing system that uses the RFB protocol to remotely control another computer...

 (VNC) server program. It allows remote access
Remote desktop software
In computing, the term remote desktop refers to a software or an OS feature allowing applications, either command line programs or graphical applications, to be run remotely on a server, while being displayed locally. Remote desktop applications have varying features...

 from a remote client to a computer hosting an X Window
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

 session and the x11vnc software, continuously polling the X server's frame buffer for changes. This allows the user to control their X11 desktop (KDE
KDE
KDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems...

, GNOME
GNOME
GNOME is a desktop environment and graphical user interface that runs on top of a computer operating system. It is composed entirely of free and open source software...

, XFCE
Xfce
Xfce is a free software desktop environment for Unix and other Unix-like platforms, such as Linux, Solaris, and BSD – though recent compatibility issues have arisen with regard to BSD Unix platforms...

, etc) from a remote computer either on the user's own network, or from over the Internet as if the user were sitting in front of it. x11vnc can also poll non-X11 frame buffer devices, such as webcams or TV tuner card
TV tuner card
A TV tuner card is a kind of television tuner that allows television signals to be received by a computer. Most TV tuners also function as video capture cards, allowing them to record television programs onto a hard disk much like the Tivo digital video recorder does.-Variants: The interfaces for...

s, iPAQ
IPAQ
iPAQ presently refers to a Pocket PC and personal digital assistant first unveiled by Compaq in April 2000; the name was borrowed from Compaq's earlier iPAQ Desktop Personal Computers. Since Hewlett-Packard's acquisition of Compaq, the product has been marketed by HP. The devices use a Windows...

, Neuros OSD, the Linux console
Linux console
The Linux console is a system console support in the Linux kernel. The Linux console was the first functionality of the kernel, developed as early as in 1991 . On PC architecture, it is common to use VGA-compatible video hardware. Implementations of computer graphics on Linux are excluded from the...

, and the Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

 graphics display.

x11vnc does not create an extra display (or X desktop) for remote control. Instead, it uses the existing X11 display shown on the monitor of a Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 computer in real time. However, it is possible to use Xvnc or Xvfb
Xvfb
In the X Window System, Xvfb or X virtual framebuffer is an X11 server that performs all graphical operations in memory, not showing any screen output. From the point of view of the client, it acts exactly like any other server, serving requests and sending events and errors as appropriate....

 to create a 'virtual' extra display, and have x11vnc connect to it, enabling X-11 access to headless
Headless
Being headless is acrania, the failure of an individual animal to develop a head, despite belonging to a species that normally does so.Headless may also refer to:*Headless system, a server with no monitor, keyboard, or mouse attached...

 servers..

x11vnc has security features that allows the user to set an access password or to use Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 usernames and passwords. It also has options for connection via a secure SSL
Transport Layer Security
Transport Layer Security and its predecessor, Secure Sockets Layer , are cryptographic protocols that provide communication security over the Internet...

 link. An SSL Java VNC viewer applet
Java applet
A Java applet is an applet delivered to users in the form of Java bytecode. Java applets can run in a Web browser using a Java Virtual Machine , or in Sun's AppletViewer, a stand-alone tool for testing applets...

 is provided that enables secure connections from a web browser
Web browser
A web browser is a software application for retrieving, presenting, and traversing information resources on the World Wide Web. An information resource is identified by a Uniform Resource Identifier and may be a web page, image, video, or other piece of content...

. The VeNCrypt SSL/TLS VNC security type is also supported.

Many of the UltraVNC
UltraVNC
UltraVNC is an open source application for the Microsoft Windows operating system that uses the VNC protocol to control another computer's screen remotely.-Features:...

 extensions to VNC are supported by x11vnc, including file transfer.

x11vnc is part of the LibVNCServer
Libvncserver
LibVNCServer and LibVNCClient are cross-platform C libraries that allow to easily implement VNC server or client functionality in an application. Both libraries support version 3.8 of the Remote Framebuffer Protocol and can handle most known VNC encodings. LibVNCClient furthermore supports IPv6 and...

 project and is free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

 available under the GNU General Public License
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....

.

x11vnc was written by Karl Runge.

Polling algorithm

x11vnc keeps a copy of the X server's frame buffer in RAM
Ram
-Animals:*Ram, an uncastrated male sheep*Ram cichlid, a species of freshwater fish endemic to Colombia and Venezuela-Military:*Battering ram*Ramming, a military tactic in which one vehicle runs into another...

. The X11 programming interface XShmGetImage is used to retrieve the frame buffer pixel
Pixel
In digital imaging, a pixel, or pel, is a single point in a raster image, or the smallest addressable screen element in a display device; it is the smallest unit of picture that can be represented or controlled....

 data. x11vnc compares the X server's frame buffer against its copy to see which pixel
Pixel
In digital imaging, a pixel, or pel, is a single point in a raster image, or the smallest addressable screen element in a display device; it is the smallest unit of picture that can be represented or controlled....

 regions have changed (and hence need to be sent to the VNC viewers.) Reading pixel data from the physical frame buffer can be much slower than writing to it (because graphics devices are not optimized for reading) and so a sequential pixel by pixel check would often be too slow.

To improve the situation, x11vnc reads in full rows of pixels separated by 32 pixels vertically. Once it gets to the bottom of the screen it starts again near the top with a slightly different offset. After 32 passes like this it has covered the entire screen. This method enables x11vnc to detect changes on the screen roughly 32 times more quickly than a sequential check would (unless the changes are very small, say only 1 pixel tall.) If the X11 DAMAGE extension is present, x11vnc uses it to provide hints where to focus its polling, thereby finding changes even more quickly and also lowering the system load.

Input injection

When x11vnc receives user input events (keystrokes, pointer motion, and pointer button clicks) from a VNC viewer, it must inject them synthetically into the X server. The X11 programming interfaces XTestFakeKeyEvent, XTestFakeMotionEvent, and XTestFakeButtonEvent of the XTEST extension are used to achieve this.

For non-X11 managed devices (such as the Mac OS X
Mac OS X
Mac OS X is a series of Unix-based operating systems and graphical user interfaces developed, marketed, and sold by Apple Inc. Since 2002, has been included with all new Macintosh computer systems...

 graphics display) different programming interfaces must be used. x11vnc also provides an interface where the user can supply his own input injection program.

Interesting uses

Often special-purpose systems are built using the X Window System
X Window System
The X window system is a computer software system and network protocol that provides a basis for graphical user interfaces and rich input device capability for networked computers...

 to manage the graphical display. x11vnc can be used to export the system's display for remote VNC access. This enables remote monitoring, control, and troubleshooting of the special-purpose system. Sometimes this saves sending a technician to a remote site or allows users to control equipment from their workstation or laptop. x11vnc is known to have been run on the following types of systems: Electron microscope
Electron microscope
An electron microscope is a type of microscope that uses a beam of electrons to illuminate the specimen and produce a magnified image. Electron microscopes have a greater resolving power than a light-powered optical microscope, because electrons have wavelengths about 100,000 times shorter than...

, MRI and Radiology
Radiology
Radiology is a medical specialty that employs the use of imaging to both diagnose and treat disease visualized within the human body. Radiologists use an array of imaging technologies to diagnose or treat diseases...

 image analysis system, Power plant and Oil platform
Oil platform
An oil platform, also referred to as an offshore platform or, somewhat incorrectly, oil rig, is a lаrge structure with facilities to drill wells, to extract and process oil and natural gas, and to temporarily store product until it can be brought to shore for refining and marketing...

 management consoles, Materials distribution control, Ship self-defense system testing, NMR
NMR
NMR may refer to:Applications of Nuclear Magnetic Resonance:* Nuclear magnetic resonance* NMR spectroscopy* Solid-state nuclear magnetic resonance* Protein nuclear magnetic resonance spectroscopy* Proton NMR* Carbon-13 NMR...

 systems, Silicon wafer analysis microscope, and Theater and concert lighting control. x11vnc is used to export the X11 displays in embedded systems such as Linux-based PDAs and Home theater PC
Home theater PC
A Home Theater PC or Media Center appliance is a convergence device that combines some or all the capabilities of a personal computer with a software application that supports video, photo, music playback, and sometimes video recording functionality...

s.

If x11vnc cannot be run on the special-purpose system, sometimes it can be run on a nearby computer and poll the X server frame buffer over the network. This is how proprietary X terminal
X terminal
In computing, an X terminal is a display/input terminal for X Window System client applications. X terminals enjoyed a period of popularity in the early 1990s when they offered a lower total cost of ownership alternative to a full Unix workstation....

 devices can be accessed via x11vnc.

Xvnc emulation

Although x11vnc's primary use is for X servers associated with physical graphics hardware, it can also attach to virtual X servers (whose frame buffers exist in RAM only) such as Xvfb
Xvfb
In the X Window System, Xvfb or X virtual framebuffer is an X11 server that performs all graphical operations in memory, not showing any screen output. From the point of view of the client, it acts exactly like any other server, serving requests and sending events and errors as appropriate....

 or a Sun Ray
Sun Ray
The Sun Ray from Oracle is a stateless thin client solution aimed at corporate environments, originally introduced by Sun Microsystems in September 1999...

 session. x11vnc has options (-create and -svc) to start Xvfb automatically, possibly as the Unix user that logged in. The interactive response of x11vnc and Xvfb may not be as fast as Xvnc
Virtual Network Computing
In computing, Virtual Network Computing is a graphical desktop sharing system that uses the RFB protocol to remotely control another computer...

, however this mode enables features that Xvnc does not have, such as SSL encryption and Unix usernames and passwords.

Client-side caching

The RFB
RFB Protocol
RFB is a simple protocol for remote access to graphical user interfaces. Because it works at the framebuffer level it is applicable to all windowing systems and applications, including X11, Windows and Macintosh...

 (VNC) protocol is odd when compared to other network graphics protocols, such as X11 and RDP
Remote Desktop Protocol
Remote Desktop Protocol is a proprietary protocol developed by Microsoft, which provides a user with a graphical interface to another computer. The protocol is an extension of the ITU-T T.128 application sharing protocol. Clients exist for most versions of Microsoft Windows , Linux, Unix, Mac OS...

, in that there is no provision for viewer-side caching of pixel data. While this makes the client easier to implement, there is a price to pay in terms of interactive response. For example, every re-exposure of a window or background region needs to have its (compressed) pixel data resent over the network. This effect is particularly noticeable for windows with complex or photo regions (such as a web browser window) that gets iconified and deiconified or re-exposed often.

x11vnc has an experimental and somewhat brute-force implementation of client-side caching. It is enabled via the -ncache option. When creating the RFB frame buffer in this mode, x11vnc allocates a very large scratch region below the top portion used for the actual (on-screen) pixel data. x11vnc can then use the RFB CopyRect command to instruct the viewer to move rectangles of pixel data into and out of the scratch region. These moves are done locally on the viewer side. In this way x11vnc can manage the scratch region to store and retrieve pixel data without having to resend it over the network.

x11vnc's client-side caching mode can give noticeable interactive response improvements for many activities. Since it uses the existing RFB CopyRect command, the scheme will work with any (i.e. unmodified) VNC viewer. There are some disadvantages, however. The first is that it consumes a large amount of memory. For good performance a scratch region 10 to 20 times larger than the actual screen should be used. So instead using 5 MB for a 1280x1024 truecolor frame buffer, closer to 100 MB will be used (on both the VNC client and server sides.) This is not so much of an issue on modern computers, but would not be possible on a low memory device. Second, the VNC viewer may treat the scratch region in ways that confuse the user, for example displaying it to the user or automatically panning down into it if the mouse reaches the bottom of the real screen. The Unix VNC viewer in SSVNC automatically hides the scratch region. Finally, x11vnc's heuristics for caching and reusing window pixel data are not perfect and can lead to unexpected flashing of a window's contents and other undesired effects.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK