1、配置并開啟vnc服務
[oracle@localhost ~]$ vncserver
you will require a password to access your desktops.
password: ---這裡要求輸入vnc用戶端登入的密碼并重複
verify:
new 'localhost.localdomain:2 (oracle)' desktop is localhost.localdomain:2
creating default startup script. /home/oracle/.vnc/xstartup
starting applications specified in /home/oracle/.vnc/xstartup
log file is /home/oracle/.vnc/localhost.localdomain:2.log
----如上告訴你vnc終端已經建立好,用的是第二個終端
2、在建立vnc服務的使用者目錄下會生成一個.vnc的隐藏目錄
[oracle@localhost ~]$ ls -a
. .bash_profile disk1 .gconfd .gstreamer-0.10 .metacity readme.htm .viminfo
.. .bashrc .eggcups .gnome .gtkrc-1.2-gnome2 .mozilla .redhat .vnc
.bash_history .chewing .emacs .gnome2 .iceauthority .nautilus .scim .xauthority
.bash_logout desktop .gconf .gnome2_private .kde p8202632_10205_linux-x86-64.zip .trash .zshrc
3、進入.vnc目錄,找到xstartup可執行檔案,用vi 編輯器打開
[oracle@localhost ~]$ cd .vnc/
[oracle@localhost .vnc]$ ls
localhost.localdomain:2.log localhost.localdomain:2.pid passwd xstartup
[oracle@localhost .vnc]$ vi 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" &
twm &
~
"xstartup" 12l, 333c 已寫入
[oracle@localhost .vnc]$ vncserver
new 'localhost.localdomain:3 (oracle)' desktop is localhost.localdomain:3
log file is /home/oracle/.vnc/localhost.localdomain:3.log
4、清除剛才建立的vnc虛拟終端
[oracle@localhost .vnc]$ vncserver -kill :1
can't find file /home/oracle/.vnc/localhost.localdomain:1.pid
you'll have to kill the xvnc process manually
[oracle@localhost .vnc]$ vncserver -kill :2
killing xvnc process id 11889
[oracle@localhost .vnc]$ vncserver -kill :3
killing xvnc process id 11945
[oracle@localhost .vnc]$ vncserver -kill :4
can't find file /home/oracle/.vnc/localhost.localdomain:4.pid
5、重建立立新的vnc虛拟終端
log file is /home/oracle/.vnc/localhost.localdomain:2.log --該終端号為 :2
6、在windows用戶端用realvnc軟體中的run vnc viewer用戶端連接配接。
7、在run vnc viewer 隻需輸入linux伺服器的位址和剛才生成的終端号:2
格式:192.168.1.56:2
8、輸入剛才配置vnc服務的時候配的即可登入linux伺服器圖形界面。
[@more@]