53

Would like to be able to connect to an existing X display, so can access my work environment and everything I left open from home. I vaguely remember something about using x11vnc in the past. But the package does not exists for Fedora 11, so I am thinking there is some built in method now.

NOTE: I connect to my work machine through a VPN so password protection is all I need security wise.

grom
  • 759
  • 2
  • 8
  • 11

8 Answers8

57

Use x11vnc, It will attach to a running session and let you share the desktop. If you run it as root to connect to an xdm session, you will need to do some research into Xauth as it can be a bit fiddly to set up.

Edit to add: Karl Runge no longer appears to be maintaining the original x11vnc however development is continuing on github. Or you could do as suggested below by @ivan-talalaev and use x0vncserver.

Another advantage of this server is that it supports alot of the advanced VNC features used by UltraVNC including large bitmap caching and file-transfer.

Sekenre
  • 2,913
  • 1
  • 18
  • 17
  • If you go this route, be aware that you might hit the problem hinted at with this question: http://serverfault.com/questions/19855/how-do-i-change-the-default-location-for-a-login-sessions-xauthority-file – David Mackintosh Jun 17 '09 at 16:45
  • okay so x11vnc still the go. So where is the fedora package for it :( – grom Jun 18 '09 at 01:16
  • Have a look here: http://rpm.pbone.net/index.php3/stat/3/srodzaj/1/search/x11vnc You might not have much luck though. Fedora 11 is too new. Try installing the Fedora 10 packages. – Sekenre Jun 18 '09 at 09:20
  • 1
    it also has a long standing and well documented bug that crashes the server constantly with many standard window functions and the code is orphaned and will likely never be fixed. – Scott Mar 15 '19 at 01:55
  • @Scott please provide links. Also If you could suggest alternatives I would be happy to update my answer. – Sekenre Mar 15 '19 at 14:07
  • 1
    x11vnc is deprecated, use x0vncserver instead (see an other answer) – sebix Jul 07 '19 at 11:16
  • @sebix Updated thanks. – Sekenre Jul 12 '19 at 11:25
19

According documentation Tigervnc has support for this.

x0vncserver is a TigerVNC Server which makes any X display remotely accessible via VNC, TigerVNC or compatible viewers. Unlike Xvnc(1), it does not create a virtual display. Instead, it just shares an existing X server (typically, that one connected to the physical screen).

x0vncserver -display :0

Make sure vncserver isn't already running, or you'll get the error failed to bind socket: Address already in use (98)

glibg10b
  • 5
  • 3
Ivan Talalaev
  • 293
  • 2
  • 7
2

If you're using KDE at work, KDE already has a VNC server built in.

Presumably, GNOME does too.

Convict
  • 1,593
  • 9
  • 8
1

As an alternative, you might want to look at NX. It is usually much faster than VNC over the Internet, and I know you can configure it to be able to access the running X session on the console.

Evan
  • 349
  • 1
  • 3
  • 6
1

x11vnc (http://www.karlrunge.com/x11vnc/)

0

VirtScreen may be also interesting option/wrapper , helping in setting up x11vnc with xrandr : https://github.com/kbumsik/VirtScreen

Also: Extending your X11 Desktop using VNC https://ogbe.net/blog/moar_monitors.html

0

Use xrfb.

Edit 2022-04-05: xrfb is, no my knowledge, not the same as xvfb. Someone suggested an edit changing this to xvfb, but I think xvfb is not actually an answer to the question of how to VNC into an existing session.

But xrfb no longer exists in debian/ubuntu, it seems, and seems to generally have been disappeared from the Internet.

So my answer was fine 13 years ago, but not a good answer today.

Thomas
  • 1,446
  • 11
  • 16
0

I did a fairly elaborate setup for a customer site that might be appropriate for you.

This is based on a configuration I did for a customer. They wanted the following:

  • that users could remote-desktop into an already-running desktop running on the system console;
  • that users could initiate a session running on the console if one wasn't already running, and then use that; and
  • that other users could connect to an already-running desktop, sharing access with the user who was already logged in.

See the details here.

Beware the security implications too.

David Mackintosh
  • 14,223
  • 6
  • 46
  • 77