Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Previously I was connecting to my Xubuntu machine1 by running on it VNC server first and then using VNC client on machine2 to connect to machine1. The problem is that i had to login anew to my desktop, so I got new X11 session, I believe.

I would like to connect to my already running X11 session if it's running. Is it possible to do that? If yes, than what should I do?

Thanks in advance.

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted
+50

vncviewer allows to specify the display number in the connection string:

If you run the viewer with no arguments it will prompt you for a VNC server to connect to. Alternatively, specify the VNC server as an argument, e.g.: vncviewer snoopy:2

where 'snoopy' is the name of the machine, and '2' is the display number of the VNC server on that machine. Either the machine name or display number can be omitted. So for example ":1" means display number 1 on the same machine, and "snoopy" means "snoopy:0" i.e. display 0 on machine "snoopy".

Source: manpage for vncviewer

I could not find an explicit option in Remmina to specify display number, however:

By default, a VNC server will listen for connections from a VNC viewer on TCP port "5900+N", where N is the "Display Number" (usually just zero). So a VNC server setup for Display-0 will listen on TCP-5900, Display-1 is TCP-5901, etc.

Additionally, the VNC server will listen for connections from a web-browser on TCP port "5800+N", where N is as above. If you point a web-browser to this port, the VNC server will automatically provide a Java VNC viewer that runs right in your web-browser. This Java Viewer will then exchange data with the VNC Server on the same ports a normal VNC Viewer would use: "5900+N".

(source)

So I guess you may try to connect to a specific display by specifying port number in connection settings.

share|improve this answer
    
Thank you very much for your answer. I tried using x11vnc, but no luck, can't connect. –  dhblah Dec 11 '12 at 14:49
1  
Hmm... do you want to connect to an existing "real" X11 session (i.e. the one displayed on the physical monitor of the remote machine) or re-connect to a previously created "virtual" screen provided by VNC? In the first case you can use x11vnc, in the latter - vncserver. Here's a good article on configuring x11vnc: karlrunge.com/x11vnc –  Sergey Dec 12 '12 at 1:25
add comment

I install and use vino, and I believe it comes standard with regular Ubuntu (with a menu item called something like Remote Desktop). It puts a little icon in your system tray so you can easily access the program preferences. It works with any vnc client. You just have it start with your startup programs.
Run /usr/lib/vino/vino-server

enter image description here

After you login, it connects immediately to your running desktop.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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