RPi VNC Screen Sharing

From eLinux.org
Revision as of 23:07, 6 November 2013 by JaixBly (talk | contribs) (Instructions)
Jump to: navigation, search

Back to RPi Guides.

Raspberry Pi VNC Screen Sharing

What does it do?

Sometimes it is convenient to share screens to be able to do support from your own computer this works just like the VNC Server with the difference you don't log in to another user then the one the console is using.

What do you need?

  • A Raspberry Pi, model B.
  • A boot SD card for the Raspberry Pi.
  • A network connection (Ethernet or WiFi).
  • Special software on both the Raspberry Pi and the remote, controlling computer

What skill level is required?

This project does not require any coding or compilation. Very basic Linux and networking knowledge would be useful, but not essential.

You need to...

  • Install software
  • Enter basic Linux commands
  • Use standard software tools (Windows/Linux/Mac) to add software to your PC
  • Connect computers using ethernet cables

How does it work?

The commands described below start a "virtual" graphical session. It allows a user to controll mouse, keyboard and screen on a remote Raspberry Pi to for example do support.

Overview of this project

You need to

  • Install Vino VNC (Virtual Network Computing) server software on the Raspberry Pi
  • Start and configure the VNC server software
  • Install a VNC client on another computer
  • Connect over a network from your computer to the Raspberry Pi


Log in to your Pi and install the Vino Package

$ sudo apt-get install vino

Next Run X11

$ startx

Once that is done you can run the vino-preferences from the terminal.

$ vino-preferences

Configure it like you want it to work, if you want to be able to controll the remote Raspberry Pi computer without remote confirmation you have to check booth "Allow" boxes on top, uncheck the third "confirm" box and as a good recommendation check the 4 box about "Require user password" and enter a password you'll remember. The rest isn't that important so just click "Close" after that. Now Raspbian doesn't autostart vino, so we have to fix that, make a script in the /etc/sudoers.d folder.

$ sudo leafpad /etc/sudoers.d/vsrv.sh &

and put the following in that file.

#! /bin/bash

Set the file to Execute

$ sudo chmod +x vsrv.sh

Then this file has to autorun when we start X11, on Raspbian this can be done by editing the /etc/xdg/lxsession/LXDE/autostart file:

$ sudo leafpad /etc/xdg/lxsession/LXDE/autostart &

Just add one line at the end of the file


Reboot the Raspberry Pi

Install UltraVNC (if you run windows) or Tight VNC on your desktop from the link below.


Or install it using your package manager. The following works on my ubuntu 11.10 workstation

$ sudo apt-get install xtightvncviewer


$ sudo apt-get install remmina

Remmina is a remote client that can handle multiple protocolls, really handy.

Then use <Your Pi IP>:1 (e.g. as the host name when connecting.[1]

  1. You can put your raspberry pi in /etc/hosts on Linux systems. I think you can make such a file on windows too. Then you can refer to your raspberry pi as "rpi" or whatever you called it.