VNC的安裝配置使用

lusklusklusk發表於2017-03-22
VNC的優勢就是真實的操作介面是在服務端
Xmanager Enterprise 4的Xshell和Xstart雖然是客戶端連線服務端進行操作,但是真實的操作介面是在客戶端,一旦網路中斷或客戶端出現問題,則操作中斷

VNC也是客戶端連線服務端進行操作,但是真實的操作介面是在服務端,遇到網路、客戶端等問題導致連線中斷時,在伺服器端執行的東西不會中斷


CentOS release 6.5 環境下的安裝配置

安裝
yum -y install tigervnc-server

yum -y install vnc-server
包tigervnc-server-1.1.0-18.el6.x86_64安裝好了即可


配置VNC中root密碼
[root@fusndb db]# vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth:  creating new authority file /root/.Xauthority
New 'fusndb:1 (root)' desktop is fusndb:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/fusndb:1.log

配置VNC中oracle密碼
[root@fusndb db]# su - oracle
[oracle@fusndb ~]$ vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth:  creating new authority file /home/oracle/.Xauthority
New 'fusndb:2 (oracle)' desktop is fusndb:2
Creating default startup script /home/oracle/.vnc/xstartup
Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/fusndb:2.log


儲存配置資訊
vi /etc/sysconfig/vncservers新增一行VNCSERVERS="1:root 2:oracle"


重啟vncserver服務
[root@fusndb db]# service vncserver restart
Shutting down VNC server: 1:root 2:oracle                  [  OK  ]
Starting VNC server: 1:root
New 'fusndb:1 (root)' desktop is fusndb:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/fusndb:1.log

2:oracle
New 'fusndb:2 (oracle)' desktop is fusndb:2
Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/fusndb:2.log

                                               [  OK  ]




如下代表伺服器端開啟了4個VNC程式,分別是IP:1\IP:2\IP:3\IP:4,其中IP:4是在root使用者下開啟的,其他都是stadium

[root@SDBY ~]# ps -ef|grep vnc
stadmin  56068     1  0 13:54 ?        00:00:00 /usr/bin/Xvnc :2 -desktop SDBY:2 (stadmin) -auth /home/stadmin/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /home/stadmin/.vnc/passwd -rfbport 5902 -fp catalogue:/etc/X11/fontpath.d -pn
stadmin  56090 56089  0 13:54 ?        00:00:00 vncconfig -iconic
stadmin  56505     1  0 13:55 ?        00:00:00 /usr/bin/Xvnc :3 -desktop SDBY:3 (stadmin) -auth /home/stadmin/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /home/stadmin/.vnc/passwd -rfbport 5903 -fp catalogue:/etc/X11/fontpath.d -pn
stadmin  56528 56527  0 13:55 ?        00:00:00 vncconfig -iconic
root     56897     1  0 13:55 ?        00:00:00 /usr/bin/Xvnc :4 -desktop SDBY:4 (root) -auth /root/.Xauthority -geometry 1024x768 -r fbwait 30000 -rfbauth /root/.vnc/passwd -rfbport 5904 -fp catalogue:/etc/X11/fontpath.d -pn
root     56924 56923  0 13:56 ?        00:00:00 vncconfig -iconic
stadmin  58770     1  0 Jan25 ?        00:01:00 /usr/bin/Xvnc :1 -desktop SDBY:1 (stadmin) -auth /home/stadmin/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /home/stadmin/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn
stadmin  58793 58792  0 Jan25 ?        00:00:00 [vncconfig]
root     58856 58308  0 14:31 pts/1    00:00:00 grep vnc
[root@SDBY ~]# service vncserver status
Xvnc (pid 58770 56897 56505 56068) 正在執行...
[root@SDBY ~]# kill -9 56897
[root@SDBY ~]# kill -9 56505
[root@SDBY ~]# kill -9 56068
[root@SDBY ~]# service vncserver status
Xvnc (pid 58770) 正在執行...
[root@SDBY ~]# ps -ef|grep vnc
stadmin  58770     1  0 Jan25 ?        00:01:00 /usr/bin/Xvnc :1 -desktop SDBY:1 (stadmin) -auth /home/stadmin/.Xauthority -geometry 1024x768 -rfbwait 30000 -rfbauth /home/stadmin/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn
stadmin  58793 58792  0 Jan25 ?        00:00:00 [vncconfig]
root     58969 58308  0 14:32 pts/1    00:00:00 grep vnc



客戶端使用方法:
輸入如下
伺服器IP:VNC使用者編號(192.168.30.138:2)
輸入密碼即可(非使用者本身的OS登入密碼,而是vnc中配置的使用者密碼)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30126024/viewspace-2135862/,如需轉載,請註明出處,否則將追究法律責任。

相關文章