agatek
Posts: 9
Joined: Sat Mar 30, 2013 3:31 pm
Location: Singapore

vnc on the actual desktop

Sat Mar 30, 2013 3:54 pm

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

User avatar
Jim Manley
Posts: 1600
Joined: Thu Feb 23, 2012 8:41 pm
Location: SillyCon Valley, California, and Powell, Wyoming, USA, plus The Universe
Contact: Website

Re: vnc on the actual desktop

Sat Mar 30, 2013 6:00 pm

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).
The best things in life aren't things ... but, a Pi comes pretty darned close! :D
"Education is not the filling of a pail, but the lighting of a fire." -- W.B. Yeats
In theory, theory & practice are the same - in practice, they aren't!!!

agatek
Posts: 9
Joined: Sat Mar 30, 2013 3:31 pm
Location: Singapore

Re: vnc on the actual desktop

Sun Mar 31, 2013 12:27 am

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

klricks
Posts: 6550
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: vnc on the actual desktop

Sun Mar 31, 2013 1:00 am

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
Unless specified otherwise my response is based on the latest and fully updated Raspbian Buster w/ Desktop OS.

agatek
Posts: 9
Joined: Sat Mar 30, 2013 3:31 pm
Location: Singapore

Re: vnc on the actual desktop

Sun Mar 31, 2013 1:13 am

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

agatek
Posts: 9
Joined: Sat Mar 30, 2013 3:31 pm
Location: Singapore

Re: vnc on the actual desktop

Sun Mar 31, 2013 7:20 am

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

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: vnc on the actual desktop

Sun Mar 31, 2013 8:51 am

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 :)
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

agatek
Posts: 9
Joined: Sat Mar 30, 2013 3:31 pm
Location: Singapore

Re: vnc on the actual desktop

Sun Mar 31, 2013 1:25 pm

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

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

Re: vnc on the actual desktop

Sun Mar 31, 2013 2:03 pm

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?
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

jnihil
Posts: 36
Joined: Sat Dec 29, 2012 12:29 pm

Re: vnc on the actual desktop

Sun Mar 31, 2013 2:59 pm

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.

agatek
Posts: 9
Joined: Sat Mar 30, 2013 3:31 pm
Location: Singapore

Re: vnc on the actual desktop

Mon Apr 01, 2013 1:30 am

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.

sshanky
Posts: 3
Joined: Sun Apr 13, 2014 8:04 am

Re: vnc on the actual desktop

Sun Apr 13, 2014 8:07 am

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.

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: vnc on the actual desktop

Sun Apr 13, 2014 1:06 pm

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
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

User avatar
Nitrogen
Posts: 7
Joined: Mon Jul 09, 2012 9:18 am
Location: Ukraine, Kryvyi Rih

Re: vnc on the actual desktop

Tue Feb 03, 2015 11:06 am

Article from previous post was moved to http://simplesi.net/auto-install-x11vnc/
Thanks for that script!
Raspberry Pi Model B
Linux raspberrypi 3.18.4+ #743 PREEMPT Wed Jan 28 17:14:53 GMT 2015 armv6l GNU/Linux

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: vnc on the actual desktop

Tue Feb 03, 2015 11:37 am

No -prob - thanks for providing updated link :)
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

Return to “General discussion”