C

Qt VNC Server

Qt VNC Server provides APIs for creating a simple VNC®-compatible server with Qt. The VNC®-compatible server uses the "Remote Frame Buffer protocol" (RFB®) to share graphics and input between the server and one or more remote VNC®-compatible clients.

A typical use case is to share parts of a Qt Quick application with a remote user or remote screen, by using the QtVncServer module. Using VNC®-compatible client software, the remote user will be able to see and interact with the application.

The module can be combined with Qt Wayland Compositor in order to make a remote desktop solution.

Using the Module

QML API

The QML types of the module are available through the QtVncServer import. To use the types, add the following import statement to your .qml file:

import QtVncServer

C++ API

Using a Qt module requires linking against the module library, either directly or through other dependencies. Several build tools have dedicated support for this, including CMake and qmake.

Examples

The best way to see what Qt VNC Server can do is to check out the examples:

Supported features

The Qt VNC Server supports a subset of features from the RFB® specification.

Encodings

Qt VNC Server supports clients connecting with the following encodings:

  • Raw - Graphics is transmitted as uncompressed data.
  • Hextile - Graphics is transmitted using hextile compression.
  • Zlib - Uses zlib for compressing data before transmission.

The QT_VNCSERVER_PREFERRED_ENCODING environment variable can be used to set the preferred encodings for the server as a semi-colon separated list of the encodings above. It also decides the order of preference.

If unset, the server will respect the preferences of the client. But if the environment variable is set, it will be used as basis of negotiation. The first encoding in the semi-colon separated list which is also supported by the client will be used.

The "raw" encoding will always be the fall back if no other suitable encoding is found, even if not listed.

In addition to the compression algorithms mentioned here, Qt VNC Server also defaults to detecting dirty regions in updated frames. This can be disabled by setting QT_VNC_NO_DIRTYMAP to 1 in the environment. Under certain circumstances where the application updates all or most of the surface each frame, it can be more efficient to skip the detection of dirty regions.

Security

If LibTomCrypt is available, Qt VNC Server will be built with support for password protection using DEC Authentication. This is considered weak security, and may protect against accidental access, but not against targeted attacks.

There is otherwise no encryption on the connection, and the recommendation is to use the server on trusted networks and VPNs.

Reference

Technology Preview

Qt VNC Server is a technology preview. There are no source or binary compatibility guarantees, as APIs may change based on user feedback and general improvements.

License and Attributions

Qt VNC Server is available under the commercial license from The Qt Company. See Qt Licensing for further details.

VNC® and RFB® are registered trademarks of RealVNC® Ltd.

Available under certain Qt licenses.
Find out more.