Virtual Network Computing (VNC) is a graphical desktop sharing system which enables you to remotely control another computer. This article will show you how to setup VNC server to remotely manage your Linux machine.

VNC server should already be included in a Server GUI installation, but if you chose a custom installation, you can install it using the Package Manager tool.

VNC Server

The VNC server should be configured from a remote SSH terminal.

Terminal window1. Launch the VNC server by typing in vncserver in an SSH window. If this your first time to run vncserver, you will be asked for a password. VNC server will show your hostname followed by a colon and a number. Note down this number.
NoteTo change your VNC password, type in vncpasswd in a terminal window.
Edit xstartup
2. Type in vi ~/.vnc/xstartup to edit the xstartup file. Note that .vnc is a hidden directory. Uncomment the lines below
exec /etc/X11/xinit/xinitrc
and replace
twm &
with either “startx &” for a GNOME desktop or “startkde &” for a KDE desktop.
NoteCheck out the vi Editor Tutorial if you need help in using vi.
Terminal window3. Terminate your VNC session by typing in vncserver kill :1 Replace 1 with the number from step 1. Then launch it again using the command from step 1. You need to discard the session before xstartup was modified, otherwise you will be working on a remote desktop session built from the stone age.

VNC Client

To connect to the remote VNC server, we will be using TightVNC, a free remote control software package derived from the popular VNC software.

TightVNC Connection1. Launch TightVNC. The New TightVNC Connection window will be shown. Fill in the VNC server field and click Connect. The VNC server field has the format hostname:number. Number is the session number noted down from step 1 of VNC Server.
TightVNC Authentication2. In the Standard VNC Authentication window, type in your VNC password.
TightVNC Session3. That’s it, you now have a remote desktop session using VNC.

Visit the forum to ask for help or to give a comment.

Posted on 4/26/2008 and last updated on 11/6/2009
Filed under System Administration