Setup VNC

From SingletonMillerWiki
Revision as of 17:52, 22 June 2013 by Martin (Talk | contribs) (Start a VNC desktop)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

VNC is a tool for accessing a remote desktop. It works as a client-server model.

In order for you to view a desktop on a remote computer, that computer has to be serving (server) the desktop and you local machine has to be able to communicate to the server (client).

VNC [en.wikipedia.org/wiki/Virtual_Network_Computing] is implemented on most computers these days. vncserver - a wrapper to launch an X server for VNC.

Install VNC

sudo apt-get install tightvncserver

Start a VNC desktop

The most common way to launch a VNC server is to connect to the remote PC via SSH Enable SSH#Connect_via_SSH_on_a_Local_network and then launching VNC using:

vncserver

or

vncserver :1 -geometry 1024x728 -depth

The defaults should be fine and will yield a response like this:

Follow the on screen instructions.

You will require a password to access your desktops.
 
Password:
Verify:  
Would you like to enter a view-only password (y/n)? n
xauth:  creating new authority file /home/<newusername>/.Xauthority
 
New 'X' desktop is raspberrypi:1
 
Creating default startup script /home/<newusername>/.vnc/xstartup
Starting applications specified in /home/<newusername>/.vnc/xstartup
Log file is /home/<newusername>/.vnc/raspberrypi:1.log

Access a remote Session

The following assumes you have a VNC client installed on you local PC and that a VNCserver is running on desktop :1 (like above)

The client I use is Remmina on Ubuntu Linux. In Remmina, enter:

  • the vncserver address 192.168.0.20:1

Note the :1 on the end matching the desktop number.

  • and the username and password.

These instruction are typical for most VNC clients. On windows consider using TightVNC [1], other VNC clients are available!.

Ending a VNC session

Simply disconnecting you local client does not terminate the VNC session running on the server.

To kill the desktop xecute the following on the RPi CLI

vncserver -kill :1

Which should yield something like this:

Killing Xtightvnc process ID 2759