共計 3811 個字符,預計需要花費 10 分鐘才能閱讀完成。
這篇文章主要介紹如何在 azure 云上準備 oracle11g 的 vnc 安裝環境,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
1,先檢查一下服務器是否已經安裝了 VNC 服務,沒有安裝,檢查服務器的是否安裝 VNC 的命令如下
yum 或者 rpm 包 2 種安裝方式都 check 下:
[root@hch_test_pd_121_129 ~]# ps -eaf|grep vnc
root 15895 15846 0 15:04 pts/1 00:00:00 grep vnc
[root@hch_test_pd_121_129 ~]#
[root@hch_test_pd_121_129 ~]# rpm -qa | grep vnc
[root@hch_test_pd_121_129 ~]#
2,安裝 vnc 軟件
yum 安裝命令:
yum install tigervnc tigervnc-server –y
yum install -y libvncserver*
順利安裝完,check 下:
[root@hch_test_pd_121_129 ~]# rpm -qa | grep vnc
tigervnc-1.1.0-16.el6.centos.x86_64
libvncserver-devel-0.9.7-7.el6_6.1.x86_64
tigervnc-server-1.1.0-16.el6.centos.x86_64
libvncserver-0.9.7-7.el6_6.1.x86_64
[root@hch_test_pd_121_129 ~]#
3,安裝 gnome 軟件
這個是生成圖形界面鎖需要的組件:
yum install -y gnome*
yum install libXfont -y
yum install xorg-x11-xfs
yum install xorg-x11-xfs-utils
yum install xorg-x11-xinit
yum install xorg-x11-xdm
yum install xorg-x11-fonts*
4,配置 vncservers
配置 vncservers,這里顯示 vnc 遠程連接到服務器的桌面窗口初始化大小,默認是 800×600 你也可以設置成你習慣的模式比如 1280×960:
[root@hch_test_pd_121_129 ~]# vim /etc/sysconfig/vncservers
VNCSERVERS= 1:root
VNCSERVERARGS[1]= -geometry 800x600
5,設置 vncserver 密碼
設置成 yueworld,啟動 vnc 之前必須設置密碼:
[root@hch_test_pd_121_129 ~]# vncpasswd
Password:
Verify:
[root@hch_test_pd_121_129 ~]#
6,啟動停止 vncserver
啟動命令 servicevncserver start:
[root@hch_test_pd_121_129 ~]# service vncserver start
正在啟動 VNC 服務器:1:root xauth: creating new authority file /root/.Xauthority
New hch_test_pd_121_129:1 (root) desktop is hch_test_pd_121_129:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/hch_test_pd_121_129:1.log
[確定]
[root@hch_test_pd_121_129 ~]#
停止命令 servicevncserver stop:
[root@hch_test_pd_121_129 ~]# service vncserver stop
關閉 VNC 服務器:1:root [確定]
[root@hch_test_pd_121_129 ~]#
重啟命令 servicevncserver restart:
[root@hch_test_pd_121_129 ~]# service vncserver restart
關閉 VNC 服務器:1:root [確定]
正在啟動 VNC 服務器:1:root
New hch_test_pd_121_129:1 (root) desktop is hch_test_pd_121_129:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/hch_test_pd_121_129:1.log
[確定]
[root@hch_test_pd_121_129 ~]#
7,配置 xstartup 啟動命令
將 /root/.vnc/xstartup 命令配置成如下:
[root@hch_test_pd_121_129 ~]# more /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
#twm
gnome-session
[root@hch_test_pd_121_129 ~]#
PS1:
使用的是 gnome 圖像界面,則需要注釋掉以下兩行,
xterm -geometry80x24+10+10 -ls -title “$VNCDESKTOP Desktop”
twm
并添加以下這行:
gnome-session
PS2:
如果黑屏了,后臺日志報如下錯誤:
Sat May 7 15:05:35 2016
vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5901
vncext: created VNC server for screen 0
/root/.vnc/xstartup: line 4: /etc/X11/xinit/xinitrc: No such file or directory
/root/.vnc/xstartup: line 4: exec: /etc/X11/xinit/xinitrc: cannot execute: No such file or directory
然后去服務器檢索 xinitrc 檢索不到的話,如下所示:
[root@xxx rpms]# ll /etc/X11/xinit/xinitrc
ls: cannot access /etc/X11/xinit/xinitrc: No such file or directory
[root@xxx rpms]# find / -name xinitrc
[root@xxx rpms]#
采用的方案就是,注釋掉 /root/.vnc/xstartup 里面的 exec /etc/X11/xinit/xinitrc,讓 vncserver 去選擇默認的,讓 vnc 加載默認圖形界面程序 就 ok 了
8,改變 xstartup 的權限
這是很多人容易忽視的問題,也是造成連接成功后黑屏的原因之一。
在 CentOS 中,xstartup 的文件路徑為:/root/.vnc/(可以通過 locatexstartup 來查看 xstartup 的文件路徑)
所以需要執行:chmod 777/root/.vnc/xstartup 來賦予權限。之后再重啟下 vncserver。
9,本地 windows 安裝 vnc viewer,遠程訪問
在 windows 下安裝 vnc 客戶端,下載地址:http://pan.baidu.com/s/1skADLrZ;軟件包名稱,RealVNC_cngr.rar,在本機 windows 下安裝好,之后進行打開開始連接,連接地址顯示如下,D:\study\csdn\0801.png:
輸入密碼后,然后進去后,進“應用程序”—“系統工具”—“終端”,把終端拖到桌面上,雙擊桌面的終端,就可以開始安裝 Oracle 了,如下 D:\study\csdn\0802.png 所示:
以上是“如何在 azure 云上準備 oracle11g 的 vnc 安裝環境”這篇文章的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注丸趣 TV 行業資訊頻道!