How to share an X session ?

Old method: Xvnc / vncviewer

This server is provided by RealVNC and TightVNC (better).

What is it ?

Xvnc runs a virtual X server: it doesn't interact with real hardware but only with VNC viewers.

In other words, it starts a new X session.


local vncviewer --- X --- hardware devices
 applications --- Xvnc --- remote vncviewer

Applications must be launched in the Xvnc session context. The consequence is that you cannot decide to share an application after launching it.

In order to connect Xvnc with the real X server, an instance of vncviewer must locally run in the X session context.


Assuming we are in the context of a real X session named :0, let's create a virtual session :1 which runs twm:

Xvnc :1 -geometry 800x600 -depth 24 -dpi 75 -alwaysshared &
DISPLAY=:1 twm &
vncviewer -fullscreen :1

Reverse connection

Xvnc can connect to a listening viewer thanks to the vncconnect.

Simple method: x11vnc

What is it ?

x11vnc attaches to a session of a real running X server.

In other words, it doesn't start a new X session.


applications --- X --- hardware devices
               x11vnc --- remote vncviewer

x11vnc can be launched at any time. It is possible to share a graphical session after launching it.


Assuming an X session :0 exists, let's attach to it:

x11vnc -display :0

Reverse connection

x11vnc can connect to a listening viewer thanks to the option -connect.

Topic revision: r3 - 21 May 2010 - 16:02:50 - ThomasMonjalon
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback