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

31,784

Solution 1

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.

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

Solution 3

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.

Share:
31,784

Related videos on Youtube

sfp
Author by

sfp

Updated on September 18, 2022

Comments

  • sfp
    sfp over 1 year

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

    • sfp
      sfp almost 11 years
      Partial solution I found here: karlrunge.com/x11vnc/faq.html#faq-gone-lock
    • sfp
      sfp almost 11 years
      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).
    • Michael Mior
      Michael Mior over 10 years
      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.
  • sfp
    sfp almost 11 years
    I've tried x11vnc, only mistyped when preparing question. Corrected. Anyway... I can't see how these options save me from unlocking screen.
  • Robert Pollak
    Robert Pollak about 5 years
    No, this unlocks the local desktop.