17

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...

3
  • Partial solution I found here: karlrunge.com/x11vnc/faq.html#faq-gone-lock
    – sfp
    May 1, 2013 at 17:20
  • Partial solution I found on x11vnc Author page but I'm not sure if it works with LCD display. How it works? There is program blockdpy setting monitor in DPMS off mode (standard for CRT monitors; off - power saving) and looking some times per second if it changed. If so -- it execute command like "turn on screen-saver". So screen should be black or locked (for vnc remote user too).
    – sfp
    May 1, 2013 at 17:32
  • Note that you could partially solve the issue of unlocking the screen by just running DISPLAY=:0 gnome-screensaver-command -l when you're done. The screen will still be unlocked for the duration of your session though. Oct 8, 2013 at 22:40

3 Answers 3

11

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.

1
  • I've tried x11vnc, only mistyped when preparing question. Corrected. Anyway... I can't see how these options save me from unlocking screen.
    – sfp
    May 1, 2013 at 11:59
2

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.

1
  • No, this unlocks the local desktop. Mar 18, 2019 at 12:26
1
+100

You should take a look on the X11RDP.

It's really a great update of the Xrdp in addition you can customize the behavior as u need. I had have the same issues as yours before and i install x11rdp and edit the xrdp.conf file to enable login to the previous session... Anyway check the site and try the version7. The guy there "Kevin Cave" is genius and now he make some update so you can install x11rdp as Debian packages.

1
  • The link to X11RDP seems broken.
    – kabZX
    Apr 24, 2023 at 14:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .