Tightvnc

From ArchWiki

Jump to: navigation, search

This document describes how to setup TightVNC on ArchLinux.

Contents

[edit] What is it?


TightVNC is a VNC (Virtual Network Computing) Unix server and viewer. It is a remote display program that allows you to view the desktop of a remote computer from anywhere on a LAN or over the Internet. To improve security of sessions VNC can be piped through SSH (Secure SHell).


[edit] How to Install on Arch


To install TightVNC type the following:

pacman -S tightvnc

Now you need to set it up to work as either a server or client/viewer.


[edit] VNC Server on Linux (Arch)


First open up a terminal and type in:

vncserver

You will now be prompted for a password:

You will require a password to access your desktops.

Password: 
Verify:   

Then you will be asked if you would like to enter a view only password. This allows two different ways of accessing a desktop on your system. - Allow a user to log into your VNC server and be able to fully use the desktop. - Allow a user to log into your VNC server and be only allow to view the desktop. I chose 'n' no for this example.

Would you like to enter a view-only password (y/n)? n

Now the vnc server desktop is created:

New 'X' desktop is hostname:1

Creating default startup script /home/user/.vnc/xstartup
Starting applications specified in /home/user/.vnc/xstartup
Log file is /home/user/.vnc/hostname:1.log

The problem now is that the VNC server is running but it is not running any desktop. If you were to log in now from a different computer you would only see the console.


[edit] Adding a Desktop to a VNC server


Since we want to use desktop with the VNC server kill the existing server that is running:

$ vncserver -kill :1

Since it was the first VNC server we created it had the number :1. On Linux systems you can have as many VNC servers running as you want. To kill a specific server you will need to specify its number.

The first time we ran the vncserver, the .vnc directory was created with some files inside of it. We will now go into this directory and edit these files as to add a desktop to the VNC server.

$ cd /home/user/.vnc
$ nano xstartup

#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

Change the file to the following to enable a GNOME desktop:

#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
exec gnome-session &

#exec kde &     #for a kde desktop
#exec icewm & #for an icewm desktop, etc

[edit] Connecting to the root (:0) desktop


When you connect to vncserver with your client, by default you are given a new X session with your own desktop. This means that a person who is physically sitting in front of the server will not see your remote session, and vice-versa you cannot see or interact with the root (:0) or physical desktop.

If you would like to remote into a machine with vnc and actually see and interact with the root desktop you can use x11vnc, which provides access to the root (:0) desktop by default. A person sitting in front of the server will see your actions, such as the mouse moving etc.

x11vnc is very similar to setup, and you can use the same clients as vncserver.

Personal tools