HomePage :: TechnicalProjects :: VNCSetupTips
VNC Setup Tips
Configuring the server
NOTE: This section was originally researched and written by Scott Manzella
- Optimum Resolution
- The optimum resolutions for the VNC server depends on the remote users desktop settings.
- 1280×1024 = 1152×922
- 1024×768 = 922×691
- The best resolution can generally be calculated by multiplying the original resolution by .9 or using 90% of the original resolution.
- When starting the vncserver on the host server, one can specify the resolution and color depth. For Instance:
- vncserver -geometry 1152×922 -depth 24
- Also, a specific VNC session can be terminated by using the -kill switch. For instance:
- vncserver -kill :1 or vncserver -kill :2 etc.....
- The optimum resolutions for the VNC server depends on the remote users desktop settings.
- Static Session numbers ???
- see notes and code below – JoeyKelly
- Setting default desktop - Gnome or KDE or Other ???
- this is handled by other means, not by VNC – JoeyKelly
- Configuring client component
- Tunneling through SSH using PuTTY
- Printing across the WAN ???
- see CitrixReplacementUsingRemoteVNC for a solution – JoeyKelly
Static session numbers
From the realvnc unix vncserver docs
vncserver can be run with no options at all. In this case it will choose the first available display number (usually :1), start Xvnc as that display, and run a couple of basic applications to get you started. You can also specify the display number, in which case it will use that number if it is available and exit if not, eg: vncserver :13
What this means is that we can designate a port for $user's vnc client that will never change, if we script it right.
Shellcode:
#!/bin/bash # Copyright 2004 by Joey Kelly, http://joeykelly.net # This script is licensed under the GPL. # # This script is for the user to run to start a vnc session # Hopefully this will eliminate the problem of getting calls whenever # the process dies. # # here we set the port number we want to run on (vnc's real port = 5900 + $USERVNCPORT increment) USERVNCPORT=10 # arbitrary number, must be unique for each user # # NOTE: # if we want to kill the user's existing session, we would do: # vncserver -kill :$USERVNCPORT # # we need to kill off the old pidfiles # use rm -f so redhate doesn't complain with a prompt rm -f /tmp/.X11-unix/X$USERVNCPORT rm -f /tmp/.X$USERVNCPORT-lock # # now we start the vnc daemon vncserver :$USERVNCPORT & echoVNC server restarted. Please log in to VNC as normal.n# sometimes the terminal will hang… sleep 3 echoPlease press RETURN.