Vnc

From COSSAN Wiki
Jump to: navigation, search

VNC stands for Virtual Network Computing. It was originally developed by AT&T as a way to administer machines without using the console.

Start vncserver remotely

Connect to the machine wher you want start a remove session (e.g. via ssh)

ssh c810-clxx 

start a new session

vncserver :1 -name test -geometry 800x600

the column and the number indicate the display number and the geometry the screen size.

Set up the password

Next we set a password to access the VNC desktop. When you set the password, you will not see any characters on the screen, and you must enter the password twice. You will only need to do this the very first time you run vncserver. The password will be saved in the Linux filesystem, and you can change it at any time by invoking the vncpasswd command again.

vncpassword

Connect to the vncserver

To connect to the vncserver use vnc client

vncviewer c810-clxx:1

Starting vncserver with Gnome/KDE

If you are not used to the console, running VNC server with a terminal isn't going to do you much good. You might want to have a menu-driven GUI like Windows/MAC. No problem. Follow these steps:

First, we are going to assume that VNCserver is running under your user, as shown with the example above. For this example, I will be editing my VNCserver to enter Gnome. You can specify a KDE desktop if you have KDE installed on your server. Make sure you are in your home directory.

cd .vnc
vi xstartup

Using vi (vim) to edit the xstartup file, make sure your file matches this one:

#!/bin/sh
# Uncomment the following two lines for normal desktop:
 unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc
 xsetroot -solid grey
 vncconfig -iconic &
 xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
 startx &

Notice that the last line is "startx &" as this command will launch Gnome upon login via VNCserver. If you are using a KDE desktop, the line "startkde &" should replace the last line.



--Ep 19:53, 15 December 2008 (CET)

See Also