Difference between revisions of "Vnc"

 
 
Line 29: Line 29:
  
 
  vncserver -kill :2
 
  vncserver -kill :2
 +
 +
You can specify your desktop resolution with:
 +
 +
vncserver -geometry 1700x1200
  
 
To start a session manager at each login, you modify your .vnc/xstartup
 
To start a session manager at each login, you modify your .vnc/xstartup

Latest revision as of 13:01, 28 August 2009

Deploying a VNC server & client

VNC provides remote control software which lets you see and interact with desktop applications across any network. It can be downloaded from here.

Installation is easy, just extract the Linux server tarball. You will need to ensure you can communicate to the vncserver from the outside world. (configure your iptables)


To X applications, a VNC server appears just like the standard X display you sit in front of, but without a physical screen attached. The applications don't know this, they just carry on running whether or not a viewer is connected. You can start a new VNC server on a Unix machine by typing:

vncserver

If you haven't run a VNC server before you will be prompted for a password, which you will need to use when connecting to this server. All your servers on the same Unix machine will use the same password, and you can change it at a later date using

 vncpasswd

With a normal X system, the main X display of a workstation called ’snoopy’ is usually snoopy:0. You can also run as many VNC servers on a Unix machine as you like, and they will appear as snoopy:1, snoopy:2 etc, as if they were just additional displays. Normally vncserver will choose the first available display number and tell you what it is, but you can specify a display number if you always wish to use the same one:

vncserver :2

You can cause applications to use a VNC server rather than the normal X display them by setting the DISPLAY environment variable to the VNC server you want, or by starting the application with the -display option. For example:

xterm -display snoopy:2 &

You can kill a Unix VNC server using, for example:

vncserver -kill :2

You can specify your desktop resolution with:

vncserver -geometry 1700x1200

To start a session manager at each login, you modify your .vnc/xstartup like :

me@somwhere: more .vnc/xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

xset fp= catalogue:/etc/X11/fontpath.d,built-ins,/home/me/.fonts
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid black
vncconfig -iconic &
exec startkde