Thursday, September 10, 2009

About VNC

vncserver -- Starting vnc server.
vncserver : 1 -- Starting vnc server with specific session.
vncserver -kill :1 -- Killing the vncsession.
vncconfig & -- to make copy paste work b/w remote to local vice versa.

On linux to have VNC connection to current session:
For this you need to install x11vnc:
x11vnc -display :0 -auth ~/.Xauthority



We can start the vnc during bootup aswell. Please google it for this.


Following is the config file which I use in ~user/.vnc/xstartup file:
**************************
#!/bin/sh
if [ `/bin/uname` = "SunOS" ] ; then
xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic -nowin&
xterm -geometry 80x24+10+10 -sb -ls -sl 8000 -title "$VNCDESKTOP Desktop" &
blackbox &
else # Linux
vncconfig -nowin -set AlwaysShared=on &
PATH=$PATH:/usr/X11R6/bin:/usr/bin:/usr/cisco/bin:/usr/X11R6/bin
export PATH
WM=/usr/bin/startxfce4
#WM=/usr/X11R6/bin/twm
#WM=/usr/bin/gnome-session
#WM=/usr/bin/startkde
fi
if [ ! -x $WM ] ; then
# failsafe window manager choice
WM=twm
fi
if [ -r $HOME/.Xdefaults ] ; then
xrdb -merge $HOME/.Xdefaults
fi
## following config is for copy/paste from vnc viewer.
if [ -x /usr/bin/vncconfig ]; then
/usr/bin/vncconfig -nowin &
elif [ -x /usr/cisco/bin/autocutsel ] ; then
/usr/cisco/bin/autocutsel &
fi
exec $WM
*******************************

References:
http://www.karlrunge.com/x11vnc/
http://ubuntuforums.org/showthread.php?t=944187

No comments:

Post a Comment