Linux下VNC服务安装配置

来源:互联网 发布:java 默认访问权限 编辑:程序博客网 时间:2024/04/27 21:45

解压VNC安装包

[root@SPBIETL01 ~]# cd /u01/BIEE/

[root@SPBIETL01 BIEE]# chmod +x *

[root@SPBIETL01 BIEE]# tar zxvf  VNC-5.0.6-Linux-x64-RPM.tar.gz

[root@SPBIETL01 BIEE]# chmod +x  VNC-Server*

安装VNCServer

[root@SPBIETL01 BIEE]# rpm  -ivh VNC-Server-5.0.6-Linux-x64.rpm

package vncserver is not installed

检查VNC是否已安装

[root@SPBIETL01 /]# rpm -q vnc-server

vnc-server-4.1.2-14.el5_3.1

为ROOT用户开启一个VNC桌面服务

[root@SPBIETL01 /]# 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桌面环境

[root@SPBIETL01 /]# 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服务的方法:
[root@SPBIETL01 /]# vncserver -kill :1
[root@SPBIETL01 /]# vncserver :1

 

创建ORACLE用户

[root@SPBIETL01 /]# groupadd oinstall

[root@SPBIETL01 /]# groupadd dba

[root@SPBIETL01 /]# useradd -g oinstall -Gdba oracle

[root@SPBIETL01 /]# 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
……

[root@SPBIETL01 /]# su - oracle

[oracle@SPBIETL01 /]# 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访问的密码

[oracle@SPBIETL01 /]# vncpasswd

配置VNC图形桌面环境为GNOME桌面环境

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

将这个xstartup文件的最后一行” twm &”修改为“gnome-session &”,再重新启动vncserver服务后就可以登陆到GNOME桌面环境

配置多个桌面

[root@SPBIETL01 /]# vi/etc/sysconfig/vncservers
VNCSERVERS="1:root 2:oracle"
VNCSERVERARGS[1]="-geometry 1024x768"
VNCSERVERARGS[2]="-geometry 1024x768"

 

设置VNC服务随系统启动自动加载

1:使用“ntsysv”命令启动图形化服务配置程序,在vncserver服务前加上星号,点击确定,配置完成。

[root@SPBIETL01 /]# ntsysv

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

[root@SPBIETL01 /]# chkconfig vncserver on