VNC_Set_up - david-macmahon/wiki_convert_test GitHub Wiki

This page briefly describes how to use VNC for remote X11 access in Linux.

Overview

From the Debian vnc4server package description:

VNC stands for Virtual Network Computing. It is, in essence, a remote display system which allows you to view a computing 'desktop' environment not only on the machine where it is running, but from anywhere on the Internet and from a wide variety of machine architectures.

For additional information, check out this VNC Tutorial (originally written for UC Berkeley's Undegraduate Astronomy Laboratory).

Set up

On the server:

$ sudo apt-get install vnc4server

On the client:

$ sudo apt-get install xvnc4viewer

Usage

On the server:

$ vncserver -geometry 1920x1200

You will require a password to access your desktops.

Password:
Verify:
xauth:  creating new authority file /home/USERNAME/.Xauthority

New 'HOSTNAME:1 (USERNAME)' desktop is HOSTNAME:SESSION

Creating default startup script /home/USERNAME/.vnc/xstartup
Starting applications specified in /home/USERNAME/.vnc/xstartup
Log file is /home/USERNAME/.vnc/HOSTNAME:SESSION.log

On the client:

$ vncviewer HOSTNAME:SESSION

VNC Viewer Free Edition 4.1.1 for X - built Sep  9 2009 19:24:20
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Thu Oct 15 21:41:40 2009
 CConn:       connected to host HOSTNAME port 5901
 CConnection: Server supports RFB protocol version 3.8
 CConnection: Using RFB protocol version 3.8
Password:
Thu Oct 15 21:41:42 2009
 TXImage:     Using default colormap and visual, TrueColor, depth 24.
 CConn:       Using pixel format depth 6 (8bpp) rgb222
 CConn:       Using ZRLE encoding

When you close your VNC viewer, your session will persist on the server, and you can connect back to it later.

SSH Tunneling

Basic and advanced uses of SSH tunneling in conjunction with VNC are described here.