配置VNC 新整理

Last login: Mon Nov 10 12:49:26 2008 from 192.168.89.155                  
[root@web ~]# ll                                                              
total 69416
-rw-r--r--   1 root root      1564 Nov 7 23:43 anaconda-ks.cfg
drwxr-xr-x   2 root root      4096 Nov 8 08:06 Desktop
drwxr-xr-x 12 lwf games     4096 Nov 8 15:48 httpd-2.2.6
-rw-r--r--   1 root root     50404 Nov 7 23:43 install.log
-rw-r--r--   1 root root     69238 Nov 7 23:43 install.log.syslog
-rw-r--r--   1 root root 35570248 Sep 17 2007 j2sdk-1_4_2_16-linux-i586.rpm
-rwxr-xr-x   1 root root 35241384 Aug 27 09:59 j2sdk-1_4_2_16-linux-i586-rpm.bin
-rw-r--r--   1 root root      5186 Nov 8 08:59 vpd.properties
[root@web ~]# free
             total       used       free     shared    buffers     cached
Mem:        514440     489668      24772          0      46036     146716
-/+ buffers/cache:     296916     217524
Swap:      1020088      97480     922608
[root@web ~]# cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 17
model           : 3
model name      : AMD Athlon(tm) X2 Dual-Core QL-60
stepping        : 1
cpu MHz         : 1899.949
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext 3dnowext 3dnow pni
bogomips        : 3810.85

[root@web ~]# cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 17
model           : 3
model name      : AMD Athlon(tm) X2 Dual-Core QL-60
stepping        : 1
cpu MHz         : 1899.949
cache size      : 512 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext 3dnowext 3dnow pni
bogomips        : 3810.85

[root@web ~]# vi /root/.vnc/xstartup
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
~
~
~
~
~
[root@web ~]# vi /root/.vnc/xstartup
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#gnome-session & #set starting GNOME desktop
startkde &                  #kde desktop
#twm &                      #Text interface

~
~
~
[root@web ~]# service vncserver start
Starting VNC server: 1:root                                [ OK ]
[root@web ~]# vncpassw
-bash: vncpassw: command not found
[root@web ~]# service vncserver start
Starting VNC server: 1:root A VNC server is already running as :1
                                                           [FAILED]
[root@web ~]# :vncserver -kill :1
-bash: :vncserver: command not found
[root@web ~]# vncserver -kill :1
Killing Xvnc process ID 8543
[root@web ~]# service vncserver start
Starting VNC server: 1:root                                [ OK ]
[root@web ~]# vncpasswd
Password:
Verify:
[root@web ~]# gnome-session & #set starting GNOME desktop
[1] 9089
[root@web ~]#
(gnome-session:9089): Gtk-WARNING **: cannot open display:

[1]+ Exit 1                  gnome-session
[root@web ~]#
[root@web ~]# gnome-session & #set starting GNOME desktop
[1] 9090
[root@web ~]#
(gnome-session:9090): Gtk-WARNING **: cannot open display:

[1]+ Exit 1                  gnome-session
[root@web ~]# exec /etc/vnc/xstartup
-bash: /etc/vnc/xstartup: No such file or directory
-bash: exec: /etc/vnc/xstartup: cannot execute: No such file or directory
[root@web ~]# kde desktop
-bash: kde: command not found
[root@web ~]# kde desktop
-bash: kde: command not found
[root@web ~]# twm
twm: unable to open display ""
[root@web ~]# vi /root/.vnc/xstartup
#!/bin/sh

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

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session& or kde&

~
~
~
".vnc/xstartup" 13L, 361C written                            
[root@web ~]# vi /root/.vnc/xstartup

-------------------------输入以上信息后 把下面命令COPY到空白处
#!/bin/sh

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

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
gnome-session& or kde&

--------------------------------到此处结束------------

~
~

按ESC     :wq

保存退出
".vnc/xstartup" 13L, 361C written
[root@web ~]# service vncserver restart
Shutting down VNC server: 1:root                           [ OK ]
Starting VNC server: 1:root                                [ OK ]
[root@web ~]# service vncserver start
Starting VNC server: 1:root A VNC server is already running as :1
                                                           [FAILED]
[root@web ~]# service vncserver stop
Shutting down VNC server: 1:root                           [ OK ]
[root@web ~]# service vncserver start
Starting VNC server: 1:root                                [ OK ]
[root@web ~]# vncpasswd
Password:
Verify:
[root@web ~]# vi /etc/sysconfig/vncservers
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# as my 'myusername' (adjust this to your own). You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/vnc/sshvnc.html>.

# VNCSERVERS="1:myusername"
VNCSERVERS="1:root"
# VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[1]="-geometry 1024x768 -alwaysshared -depth 24"
~
~
~
~

"/etc/sysconfig/vncservers" 15L, 578C written                
[root@web ~]# service vncserver stop
Shutting down VNC server: 1:root                           [ OK ]
[root@web ~]# service vncserver start
Starting VNC server: 1:root                                [ OK ]
[root@web ~]#

------------------配置完成后的桌面--------------

2008-12-06 AM 9:38