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.

8 Answers 8

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.

7
  • If you go this route, be aware that you might hit the problem hinted at with this question: serverfault.com/questions/19855/… Jun 17, 2009 at 16:45
  • okay so x11vnc still the go. So where is the fedora package for it :(
    – grom
    Jun 18, 2009 at 1:16
  • Have a look here: 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, 2009 at 9: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, 2019 at 1:55
  • 1
    x11vnc is deprecated, use x0vncserver instead (see an other answer)
    – sebix
    Jul 7, 2019 at 11:16
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)

3
  • 3
    Just note you will usually need to specify vnc password file too: x0vncserver -display :0 -rfbauth .vnc/passwd
    – Honza
    Oct 3, 2019 at 13:31
  • 2
    For the record, Debian provides the package tigervnc-scraping-server for this use-case
    – Joril
    Apr 1, 2021 at 12:29
2

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

Presumably, GNOME does too.

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

1

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

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.

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.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.