LibVNCServer/LibVNCClient are cross-platform C libraries that allow you to easily implement VNC server or client functionality in your program. If you don't know VNC and what it's good for, read about it here.

See the documentation for an API reference, the build howto for info on how to compile the libraries on your platform and the project news for a list of recent changes.

To give an example, the simplest server looks like this:

#include <rfb/rfb.h>

int main(int argc,char** argv)
  rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,400,300,8,3,4);

This sample creates a 400x300 frame buffer in true colour. There are 4 bytes per pixel, because 3 (which are only used instead of all 4) is such an odd number. Then the server is initialized and a blocking event loop is started.

Of course, this program only shows rubbish (whatever is in the frame buffer you malloc'd) and does not do any error checking at all, but it proves that writing a server can be very easy.

For more in-depth information (especially if you want to write a real server or client) look into the provided examples and into the documentation for LibVNCServer and LibVNCClient.

LibVNCServer and LibVNCClient are free software licensed under the GPL. If you use them, you must adhere to the terms of th GPL.

Looking for help or want to participate in the active development of LibVNCServer/LibVNCClient? Subscribe to the libvncserver-common mailing list.



LibVNCServer 0.9.12 released!

Over two years of work have now culminated in 0.9.12. We have ditched the legacy Autotools build system in favour of the truly cross-platform CMake and extended the continuous integration tests to run MS Windows builds as well. LibVNCServer saw quite some memory management issues fixed, LibVNCClient received X509 server certificate verification, Tight decoding optimizations, support for overriding the default rectangle decode handlers and a port of the SDL-based VNC viewer to SDL 2.0. 42 issues were fixed with this release.

Get it here.


LibVNCServer 0.9.11 released!

After quite some time finally a major release featuring continous integration to make sure the code builds on all supported platforms. LibVNCClient saw a lot of robustness fixes making it more stable when dealing with broken or malicious servers. LibVNCServer received WebSocket improvements, its built-in webserver got more secure and systemd support was added.

Grab it here.


LibVNCServer 0.9.10 released!

Another major release that saw a massive code re-organisation, merged some Debian patches, addressed some security issues and fixed building on Windows 8.

As always, you can get it here.


LibVNCServer 0.9.9 released!

This is a major release that contains numerous bugfixes and a nice bag of shiny new features, mainly full IPv6 support, the new TurboVNC encoder and support for WebSockets.

You can get it here.

Besides the fixed bugs, the cool stuff is:

- Overall changes:
  • Added noVNC HTML5 VNC viewer connect possibility to our http server. Pure JavaScript, no Java plugin required anymore! (But a recent browser...)
  • Added a GTK+ VNC viewer example.
- LibVNCServer/LibVNCClient:
  • Added support to build for Google Android.
  • Complete IPv6 support in both LibVNCServer and LibVNCClient.
- LibVNCServer:
  • Split two event-loop related functions out of the rfbProcessEvents() mechanism. This is required to be able to do proper event loop integration with Qt. Idea was taken from Vino's libvncserver fork.
  • Added TightPNG encoding support. Like the original Tight encoding, this still uses JPEG, but ZLIB encoded rects are encoded with PNG here.
  • Added suport for serving VNC sessions through WebSockets, a web technology providing for multiplexing bi-directional, full-duplex communications channels over a single TCP connection.
  • Support connections from the Mac OS X built-in VNC client to LibVNCServer instances running with no password.
  • Replaced the Tight encoder with a TurboVNC one which is tremendously faster in most cases, especially with high-color video or 3D workloads.
- LibVNCClient:
  • Added support to only listen for reverse connections on a specific IP address.
  • Support for using OpenSSL instead of GnuTLS. This could come in handy on embedded devices where only this TLS implementation is available.
  • Added support to connect to UltraVNC Single Click servers.

A hearty thanks to all that contributed!


LibVNCServer released!

This is a maintenance release that fixes a regression in libvncclient that crept in with Apple Remote Desktop support added with 0.9.8. Viewers that were not adapted to the new functionality would fail connecting to ARD servers before.

You can get it here.


LibVNCServer released!

This is a maintenance release that fixes an ABI compatibility issue introduced with 0.9.8.

You can get it here.


LibVNCServer version 0.9.8 has been released today!

You can get it here.

To keep the story short, this is what's new:

Overall changes:
  • Automagically generated API documentation using doxygen.
  • Added support for pkg-config.
  • Fixed Mingw32 cross compilation.
  • Fixed CMake build system.
  • All files used by _both_ LibVNCServer and LibVNCClient were put into a 'common' directory, reducing code duplication.
  • Implemented xvp VNC extension.
  • Updated minilzo library used for Ultra encoding to ver 2.04. According to the minilzo README, this brings a significant speedup on 64-bit architechtures.
  • Thread safety for ZRLE, Zlib, Tight, RRE, CoRRE and Ultra encodings. This makes all VNC encodings safe to use with a multithreaded server.
  • A DisplayFinishedHook for LibVNCServer. If set, this hook gets called just before rfbSendFrameBufferUpdate() returns.
  • Fix for tight security type for RFB 3.8 in TightVNC file transfer (Debian Bug #517422).
  • Unix sockets support.
  • Anonymous TLS security type support.
  • VeNCrypt security type support.
  • MSLogon security type support.
  • ARD (Apple Remote Desktop) security type support.
  • UltraVNC Repeater support.
  • A new FinishedFrameBufferUpdate callback that is invoked after each complete framebuffer update.
  • A new non-forking listen (reverse VNC) function that works under Windows.
  • IPv6 support. LibVNCClient is now able to connect to IPv6 VNC servers.
  • IP QoS support. This enables setting the DSCP/Traffic Class field of IP/IPv6 packets sent by a client. For example starting a client with -qosdscp 184 marks all outgoing traffic for expedited forwarding. Implementation for Win32 is still a TODO, though.
  • Fixed hostname resolution problems under Windows.
  • Is now resizable and can do key repeat, mouse wheel scrolling and clipboard copy and paste.
  • Fix for no input possible because of ctrl key being stuck. Issue was reported as Debian bug #555988.

Thanks to all that contributed!


LibVNCServer/LibVNCClient now have a new website (inspired by the FFmpeg one) including API documentation.


LibVNCServer now sports a brand new method to extend the protocol, thanks to Rohit Kumar! He also extended the library to support RFB 3.7. Furthermore, he contributed TightVNC file transfer protocol support to LibVNCServer!


LibVNCClient now features ZRLE decoding!


Another round of valgrinding completed. This time it is augmented by changes instigated by using Linus' sparse. In the course, the complete sources were converted to ANSI C.


The member socketInitDone was renamed to socketState, and no longer contains a bool value. This allows us to quit a server cleanly from the event loop via rfbShutdownServer(), so that the structures can be cleaned up properly. This is demonstrated in examples/example.c.


The function rfbMakeMaskFromAlphaSource() applies a Floyd-Steinberg dither to approximate a binary mask from a cursor with alpha channel. A demonstration can be found in test/cursortest.c.


Renamed this page to reflect that LibVNCClient is actually very usable.


Karl Runge has done awesome work to support cursors with alpha blending! You can try it with x11vnc as in CVS, or wait a few more days for x11vnc to be released officially!


Happy new year! It begins with a new macro recorder based on LibVNCServer/LibVNCClient using perl as script language. The macro recorder is itself written in perl, and writes out perl scripts, acting as a VNC proxy, so that you can connect a vncviewer to it, and it records all your input, possibly looking for a certain button, image, word, etc. before continuing. I called it VisualNaCro, and it's in CVS.


Just before christmas, a new release! Version 0.7 brings you the first non-beta of LibVNCServer...


Finally MinGW32 support. I only had problems with a vncviewer which wouldn't connect to localhost: I use SDLvncviewer...


LibVNCClient is getting better and better... Expect a very powerful client soon!


LibVNCServer has automated test, thanks to LibVNCClient (included). It doesn't do ZRLE yet, and exposed some bugs, the only remaining of these is CoRRE (not sure yet if it's a bug in the client or the server).


Added Success stories.


The API was cleaned up. The structures and functions now have a prefix (mostly "rfb", sometimes "zrle" or "sra") in order not to clutter the namespace, while the structure's members don't need such a prefix.


I finally came around to fix mouse behaviour in QEMU's VNC frontend for Windows 98. Please find the patch here. If mouse behaves strangely, try to wiggle the pointer to a free spot on the desktop, hit Ctrl+Shift and release them. After that, the mouse should behave nicely.


After silently being added almost a year ago, libvncclient's API was modified for real use, and three examples were added: ppmtest (a very simple demo), SDLvncviewer, and vnc2mpg (which lets you record your VNC session to a movie). Automated regression tests of the libraries are planned.


x11vnc-0.6.1 was released! This reflects the long way the original, small example has gone, improved in many possible ways and having a broad user base.


Some patches were created for QEMU, a FAST! emulator by Fabrice Bellard, to control those sessions with a vncviewer.


LibVNCServer is listed as a project using Valgrind!


Version 0.6 is out! x11vnc performance boosts! You no longer need a c++ compiler in order to have ZRLE coding! LinuxVNC was added (This is to the text console what x11vnc is to X11)!


rdp2vnc is in rdesktop's CVS.


A preliminary patch for rdesktop (CVS) to make rdp2vnc, a translator from Windows Terminal Server's protocol to VNC's protocol, is available. It needs a new version of libvncserver; try CVS until I release 0.6.


Version 0.5 is out! Features include autoconf based configure, rpm package (YMMV), cleanup of directory structure, NEW x11vnc! ZRLE encoding! HTTP tunnelling through LibVNCServer's HTTP support! Many bug fixes!


Version 0.4 is out! Biggest feature: NewFB encoding. Quite a few bugfixes also (Thanks to all!).


A new version of rdesktop+vnc is available! (Includes support for other platforms keyboard mapping with plain rdesktop!)


Added a link to my homepage at the end.


I released the rdp2vnc extensions as well as patches for general keyboard handling, working inside Xvnc and process_text2 (the famous "font:" error) to rdesktop. Please find it on the download page.


A snapshot of LibVNCServer and RDP2VNC is now available. You can also download the diff against rdesktop-1.1.0. rdp2vnc also contains the patches for keyboards other than PC keyboards, and you can specify "-k fr" again.

How to Build

The prerequisites:


LibVNCServer uses CMake, so you can build via:

mkdir build
cd build
cmake ..
cmake --build .

For some more comprehensive examples that include installation of dependencies, see the Unix CI and Windows CI build setups.

If building for Android (see the NDK CMake guide as a reference):

mkdir build
cd build
cmake --build .

That's it....