Page 1 of 1

vnc on the actual desktop

Posted: Sat Mar 30, 2013 3:54 pm
by agatek
If you take some popular Linux distribution like Debian, Ubuntu, Centos etc they typically come with the function of desktop remote display (port 5900)

Image

How to enable this kind of functionality?
Just to make it double-clear: I am looking for a remote access to the very desktop that opens from the console as of F7 (typically) be it trigered by startx or by lightgdm at the boot time. I am NOT looking for a vnc server that just opens a virtual desktop.
Alternatively, this could be also a vncserver that opens on a console.

Re: vnc on the actual desktop

Posted: Sat Mar 30, 2013 6:00 pm
by Jim Manley
A Google search of "raspberry pi vnc" shows that there are at least 100 tutorials from reputable sites on how to set up VNC on the Pi. It seems that you want to remotely view the initial desktop that is started on the Pi, so you will want to connect to port 5900 (equivalent to X Window display device :0 if you're familiar with that terminology).

Re: vnc on the actual desktop

Posted: Sun Mar 31, 2013 12:27 am
by agatek
If this is really as trivial as the search you suggested, please point me to the tutorial giving the answer to my problem. I will really appreciate it.

- using an "external" vncserver (i.e. tightvnc) whatever display is to be chosen does not automatically give the image to the physical monitor and it seems you can not run the server on the same display as the already initiated
- using the default to the Debian distribution for RaspberryPi, lightgdm and enabling the server in
/etc/lightdm/lightdm.conf, the section below

Code: Select all

[VNCServer]
enabled=true
port=5900
opens another display (i.e. :1).

Re: vnc on the actual desktop

Posted: Sun Mar 31, 2013 1:00 am
by klricks
I have been wanting to do the same thing. Have to search around using a more general Linux context.
I Googled [rdp current session linux] and came up with these but haven't tried them.

http://blog.markloiseau.com/2012/03/vnc ... t-session/
http://askubuntu.com/questions/133343/h ... ng-session

Re: vnc on the actual desktop

Posted: Sun Mar 31, 2013 1:13 am
by agatek
I think I found the answer but did not have time yet to put it all together.
This functionality within the other distribution is provided by the Vino server. It is originally for the Gnome but It is included to the Raspberry Debian as well so should be only a matter of proper integration with lightgdm.

RDP is a different protocol. It allows roughly the same but as it is kind of related to the Microsoft platforms I prefer the one based on VNC.

I will check out the first link - thank you kiricks.

Re: vnc on the actual desktop

Posted: Sun Mar 31, 2013 7:20 am
by agatek
Ok, using vino, step by step. Checked with 2013-02-09-wheezy-raspbian with the updates up-to-date.
1. Enable "desktop on boot" if not done earlier

Code: Select all

sudo raspi-config
chose: boot_behaviour     Start desktop on boot? 
2. Reboot or go to runlevel 5 (init 5)
3. Install the vino server.

Code: Select all

sudo apt-get install vino
4. After the desktop appears, open a terminal window and execute the vine preferences script

Code: Select all

vino-preferences
it will open a window similar to the one included in my initial post. Set the permissions and access mode as per your intentions. You only need to do it once (unless you want later to alter the settings). The preferences will be set for the user currently owning the desktop so for the default setting it will be for the pi user.

5. Create an autostart file (below using a terminal window and my favorite editor).

Code: Select all

sudo nano /etc/xdg/autostart/vino.desktop
The content of mine:

Code: Select all

[Desktop Entry]
Type=Application
Exec=/usr/lib/vino/vino-server
Hidden=false
NoDisplay=true
Name=vino
Comment=shared access desktop server
6. Log-out and log back in for the desktop session
7. Check whether what you want is there (it takes some time for vine-server to kick-off so please wait a bit)

Code: Select all

sudo netstat -nlp | grep vino
tcp        0      0 0.0.0.0:5800            0.0.0.0:*               LISTEN      2757/vino-server
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      2757/vino-server
Remarks:
- probably it is wise to tell the vino server only to listen to the localhost (I still have to figure out how)
- some people report failure if the server is executed the above way and suggest to execute the server with some delay. This could be done by wrapping it up inside a script with a command like sleep 5 preceding the vine-server execution.

Re: vnc on the actual desktop

Posted: Sun Mar 31, 2013 8:51 am
by simplesi
This is what I use on all my RPi to let me view the "real" desktop :)
http://www.raspberrypi.org/phpBB3/viewt ... 62#p108862

Simon

PS I can now install this in about 60 secs from start to finish as I've done it that many times :)

Re: vnc on the actual desktop

Posted: Sun Mar 31, 2013 1:25 pm
by agatek
Thank you Simon. I like flexibility of x11vnc so likely I will end up using it, unless I conclude this would be an overkill or it is much more demanding in terms of resources. Not that I have any problem with it at this moment but who knows what this small cutie (model B) is going to be running eventually.

Re: vnc on the actual desktop

Posted: Sun Mar 31, 2013 2:03 pm
by Joe Schmoe
My first thought on seeing this thread was : use x11vnc
And, frankly, I thought this was all settled science.

But now you've mentioned this new thing called "Vino". So, how does Vino compare to x11vnc? Better? Worse? How?

Re: vnc on the actual desktop

Posted: Sun Mar 31, 2013 2:59 pm
by jnihil
Personally I use x11vnc for xfce. After installing x11vnc, I setup two aliases:

alias startvnc='sudo /usr/bin/x11vnc -xkb -auth /var/run/lightdm/root/:0 -noxrecord -noxfixes -noxdamage -rfbauth /etc/x11vnc.pass -forever -bg -rfbport 5900 -display :0 -o /var/log/x11vnc.log'
alias stopvnc='x11vnc -display :0 -remote stop'

However, I use only the cli via ssh (headless) and don't run xfce on my Rasbian Pi (only my other Xubuntu desktop), but I should think this would work just fine.

Re: vnc on the actual desktop

Posted: Mon Apr 01, 2013 1:30 am
by agatek
Joe Schmoe wrote:So, how does Vino compare to x11vnc? Better? Worse? How?
I guess the answer is: different.
Vino is intrinsic to the Gnome environment and it is hardly configurable via the command line. It also has pretty limited functionality. To make it running in principle a gui is needed. It comes "pre-installed" with many desktop, GTK based distributions. It is simple, straight-forward and from my experience hassle free. Probably it is a better choice for the environment with an inexperienced user sitting behind a physical monitor where we want this user to maintain some control over the desktop accessibility. I've been using it (not fully consciously) for years to remotely fix some problems with my wife's desktop (etc.).

As far as I can see from my rather limited experience, x11vnc is a fully blown and of great functionality command line based server which is probably not intended to be messed up by the end user. It does not depend on any Gnome/KDE specific libraries so if not in use may be also a better choice for that reason.

Re: vnc on the actual desktop

Posted: Sun Apr 13, 2014 8:07 am
by sshanky
Hi,

I have followed the directions I've found on multiple sites for setting up Vino to autostart, but it won't. It works fine, when I start the server, but it won't start on its own. I've followed the instructions on this page:

http://elinux.org/RPi_VNC_Screen_Sharing

Any help would be most appreciated....I would love to be able to log in remotely!

Thanks a lot.

Re: vnc on the actual desktop

Posted: Sun Apr 13, 2014 1:06 pm
by simplesi
I've automated an X11vnc install to take any pain away (hopefully)

http://cymplecy.wordpress.com/2014/02/0 ... ll-x11vnc/

Not tried Vino as the above works for me :)

Simon

Re: vnc on the actual desktop

Posted: Tue Feb 03, 2015 11:06 am
by Nitrogen
Article from previous post was moved to http://simplesi.net/auto-install-x11vnc/
Thanks for that script!

Re: vnc on the actual desktop

Posted: Tue Feb 03, 2015 11:37 am
by simplesi
No -prob - thanks for providing updated link :)