天天看點

Linux下VNC服務安裝配置

解壓VNC安裝包

[[email protected] ~]# cd /u01/BIEE/

[[email protected] BIEE]# chmod +x *

[[email protected] BIEE]# tar zxvf  VNC-5.0.6-Linux-x64-RPM.tar.gz

[[email protected] BIEE]# chmod +x  VNC-Server*

安裝VNCServer

[[email protected] BIEE]# rpm  -ivh VNC-Server-5.0.6-Linux-x64.rpm

package vncserver is not installed

檢查VNC是否已安裝

[[email protected] /]# rpm -q vnc-server

vnc-server-4.1.2-14.el5_3.1

為ROOT使用者開啟一個VNC桌面服務

[[email protected] /]# vncserver :1

You will require a password to access yourdesktops.

Password:

Verify:

xauth: creating new authority file /root/.Xauthority

New 'SPBIETL01:1 (root)' desktop isSPBIETL01:1

Creating default startup script/root/.vnc/xstartup

Starting applications specified in/root/.vnc/xstartup

Log file is /root/.vnc/SPBIETL01:1.log

配置VNC圖形桌面環境為KDE或GNOME桌面環境

[[email protected] /]# cat /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 &

将這個xstartup檔案的最後一行” twm &”修改為“startkde &”,再重新啟動vncserver服務後就可以登陸到KDE桌面環境

将這個xstartup檔案的最後一行” twm &”修改為“gnome-session &”,再重新啟動vncserver服務後就可以登陸到GNOME桌面環境

重新啟動vncserver服務的方法:

[[email protected] /]# vncserver -kill :1

[[email protected] /]# vncserver :1

建立ORACLE使用者

[[email protected] /]# groupadd oinstall

[[email protected] /]# groupadd dba

[[email protected] /]# useradd -g oinstall -Gdba oracle

[[email protected] /]# passwd oracle

Changing password for user oracle.

New UNIX password:

BAD PASSWORD: it is based on a dictionaryword

Retype new UNIX password:

passwd: all authentication tokens updatedsuccessfully.

為ORACLE使用者開啟VNC桌面服務

可以使用如下的方法啟動多個桌面的VNC

vncserver :1

vncserver :2

vncserver :3

……

[[email protected] /]# su - oracle

[[email protected] /]# vncserver :2

New 'SPBIETL01:2 (oracle)' desktop isSPBIETL01:2

Starting applications specified in/home/oracle/.vnc/xstartup

Log file is/home/oracle/.vnc/SPBIETL01:2.log

修改VNC通路的密碼

[[email protected] /]# vncpasswd

配置VNC圖形桌面環境為GNOME桌面環境

[oracle @SPBIETL01 /]# cat /home/oracle/.vnc/xstartup

将這個xstartup檔案的最後一行” twm &”修改為“gnome-session &”,再重新啟動vncserver服務後就可以登陸到GNOME桌面環境

配置多個桌面

[[email protected] /]# vi/etc/sysconfig/vncservers

VNCSERVERS="1:root 2:oracle"

VNCSERVERARGS[1]="-geometry 1024x768"

VNCSERVERARGS[2]="-geometry 1024x768"

設定VNC服務随系統啟動自動加載

1:使用“ntsysv”指令啟動圖形化服務配置程式,在vncserver服務前加上星号,點選确定,配置完成。

[[email protected] /]# ntsysv

2:使用“chkconfig”在指令行模式下進行操作,指令使用如下

[[email protected] /]# chkconfig vncserver on

繼續閱讀