How to connect to existing X session without unlocking physical display?

I usually leave many programs running on my workstation and sometimes I need to use it remotely. So I need to connect to existing X session, while keeping physical display (workstation's monitor) locked all time.

I tried vino (vino-server & vinagre as client), but they open new, empty X session, so it doesn't give me access to running applications.

I also tried x11vnc but it looks to unlock physical screen and leave it unlocked (!) when client finish, so there we have security issue...

On both ends there is Ubuntu 12.04 running, with default GUI, so no GNOME specific solution will work (applets, etc.).

Ideal solution should give me access to all programs running on both monitors and several "virtual desktops". Which can need capturing of special keys like Crtl+[number] and Alt-TAB.

Alternatively... if it is possible to forward existing window (program already running) through ssh -X it will be a good workaround.

EDIT: x1vnc, not "x11server" of course...


It is not possible to forward already existing windows through SSH as far as I know.

I'd suggest going for x11vnc. You might need to install it first. This command should enable a one-time only passwordless VNC server sharing your current running desktop (first come, first served):

x11vnc -noxdamage -display :0 -safer -nopw -once -xrandr

You might need to adjust the display. You can also get it programatically by using ConsoleKit dbus interface, but that's too much trouble and :0 is fine most of the time. If that doesn't work, just use :1 and so.

This comes in handy, because you can run it from a SSH sesion from elsewhere, just whrn you need it.


You should take a look at x2go and just connect to "Connection to Local Desktop" instead of specifying a window manager or desktop environment.

It uses SSH, so once you install and start the server on your workstation, you should be able to connect to it with the x2goclient if you can already SSH into it.