1)vncserver shared desktop 

vision 1.0

1@@@@configure host

@@@

@@@<1>install and configure the vncserver 

@@@

[root@station65 .vnc]# yum list tigervnc*

Installed Packages

tigervnc.i686          

tigervnc-server.i686 

 

@@@

[root@station65 .vnc]# vino-preferences 

Sharing:

  <select>Allow other users to view your desktop

Security:

  <select>Configure netwok automatically to accept connections

 

@@@

@@@<2>configure vnc configfile

@@@

[root@station65 .vnc]# rpm -qc tigervnc-server

/etc/sysconfig/vncservers

@@@

[root@station65 .vnc]# cat /etc/sysconfig/vncservers | tail -n 2

 VNCSERVERS="9:root"

 VNCSERVERARGS[2]="-geometry 1280x1024"

@@@

[root@station65 .vnc]# vncpasswd 

Password:  <redhat>  @@@in this case, I use the redhat as password.

Verify:  <redhat>

[root@station65 .vnc]# ls /root/.vnc/passwd 

/root/.vnc/passwd     @@@password was generated here.

 

@@@

@@@restart vncserver

[root@station65 .vnc]# service vncserver restart

Shutting down VNC server: 9:root                           [  OK  ]

Starting VNC server: 9:root 

New 'station65.example.com:9 (root)' desktop is station65.example.com:9

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/station65.example.com:9.log

 

                                                           [  OK  ]

 

@@@

@@@<3>edit the xstartup

@@@

@@@people look into display 9, and display 9 look into display 0.

[root@station65 .vnc]# cat xstartup 

#!/bin/sh

X -audit 0  :9 & 

export DISPLAY=:9.0

vncviewer -passwd /root/.vnc/passwd  -ViewOnly -geometry 1280x1024 127.0.0.1:0

 

@@@

@@@<4>configure httpd for downloading password.

@@@

[root@station65 ~ ]# scp /root/.vnc/passwd  /var/www/html/passwd

[root@station65 ~ ]# service httpd restart

 

 

2@@@@configure client

@@@

@@@<1>configure client file.

@@@

@@@Note: wget would automatically download the passwd to assigned file.

[root@station65 Desktop]# cat desktop.sh~

#!/bin/sh

mkdir -p /etc/X11/vncpassword_here > /dev/null 2>&1

if [ ! -z /etc/X11/vncpassword_here/passwd ]

then

wget -P /etc/X11/vncpassword_here  http://192.168.0.65/passwd

fi

export DISPLAY=:0.0

nohup vncviewer -passwd /etc/X11/vncpassword_here/passwd 192.168.0.65:9 -FullScreen -ViewOnly -Shared &

 

@@@

@@@<2>change client file to binary file. 

@@@

[root@station65 Desktop]# rpm -qf /usr/bin/gzexe

gzip-1.3.12-18.el6.i686

[root@station65 Desktop]# gzexe desktop.sh

desktop.sh:  37.4%

 

@@@

@@@check the binary file.

[root@station65 Desktop]# cat desktop.sh

#!/bin/sh

skip=44

 

tab=' '

nl='

'

IFS=" $tab$nl"

 

umask=`umask`

umask 77

 

gztmpdir=

trap 'res=$?

  test -n "$gztmpdir" && rm -fr "$gztmpdir"

  (exit $res); exit $res

' 0 1 2 3 5 10 13 15

 

if type mktemp >/dev/null 2>&1; then

  gztmpdir=`mktemp -dt`

else

  gztmpdir=/tmp/gztmp$$; mkdir $gztmpdir

fi || { (exit 127); exit 127; }

 

gztmp=$gztmpdir/$0

case $0 in

-* | */*'

') mkdir -p "$gztmp" && rm -r "$gztmp";;

*/*) gztmp=$gztmpdir/`basename "$0"`;;

esac || { (exit 127); exit 127; }

 

case `echo X | tail -n +1 2>/dev/null` in

X) tail_n=-n;;

*) tail_n=;;

esac

if tail $tail_n +$skip <"$0" | gzip -cd > "$gztmp"; then

  umask $umask

  chmod 700 "$gztmp"

  (sleep 5; rm -fr "$gztmpdir") 2>/dev/null &

  "$gztmp" ${1+"$@"}; res=$?

else

  echo >&2 "Cannot decompress $0"

  (exit 127); res=127

fi; exit $res

锟斤拷NPdesktop.sh~锟絢锟紷锟斤拷锟絎锟?/+Tj@A锟斤拷 锟斤拷锟斤拷锟?锟斤拷e?m}S锟斤拷K锟絨`鏇檦锟絨m锟斤拷V锟斤拷锟?s~锟斤拷]]锟経(锟紽锟絗

.锟絘w.K

锟斤拷锟斤拷锟絯锟?锟斤拷+E#锟紻锟斤拷?-01锟斤拷Y??i2锟斤拷锟斤拷锟斤拷锟斤拷*D?锟斤拷r?锟斤拷$%W锟斤拷G锟絡锟斤拷锟絵锟疥抗锟絯I6锟絲锟斤拷m?锟斤拷;锟绞??锟斤拷%?

 

@@@

@@@<3>test the client file.

@@@

./desktop.sh    @@@run at the client side.