VNC应该是服务器上图形化的首选了,首先一般安装linux是自动会安装这个工具
[root@node4 ~]# rpm -q vnc
vnc-4.1.2-14.el5_3.1
[root@node4 ~]#
[root@node4 ~]# rpm -q vnc-server
vnc-server-4.1.2-14.el5_3.1
[root@node4 ~]#
其次因为vnc是在服务器上直接操作,所以操作过程不会受到网络的影响
再次有些环境xshell的图形界面不好把握,故建议VNC
如果没安装也没关系
找到vnc-server-4.1.2-14.el5.x86_64.rpm,安装命令如下
rpm -ivh /mnt/Server/vnc-server-4.1.2-14.el5.x86_64.rpm
没那简单......
[root@erpdb01 ~]# cd /mnt
[root@erpdb01 mnt]# ls
iso vnc-4.1.2-14.el5_3.1.x86_64.rpm
[root@erpdb01 mnt]# rpm -ivh /mnt/vnc-4.1.2-14.el5_3.1.x86_64.rpm
warning: /mnt/vnc-4.1.2-14.el5_3.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
gtk2 >= 2.6 is needed by vnc-4.1.2-14.el5_3.1.x86_64
[root@erpdb01 mnt]#
没关系 看大招:
[root@erpdb01 ~]# rpm -ivh --nodeps /mnt/vnc-4.1.2-14.el5_3.1.x86_64.rpm
warning: /mnt/vnc-4.1.2-14.el5_3.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:vnc ########################################### [100%]
[root@erpdb01 ~]#
大招被坑:
[root@erpdb01 ~]# vncserver :1
New 'erpdb01.szgas.com:1 (root)' desktop is erpdb01.com:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/erpdb01.com:1.log
[root@erpdb01 ~]#
启动VNC服务设置登录密码:
[root@node4 ~]# vncserver :1
You will require a password to access your desktops.
Password:
Password must be at least 6 characters - try again
Password:
Verify:
New 'node4:1 (root)' desktop is node4:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/node4:1.log
[root@node4 ~]#
我这里就用root密码代替了,注意密码不能少于6个字节
VNC SERVER端用地址192.168.56.4:1 然后输入刚才的密码就可以登录了
但是:
[root@node4 ~]# su - oracle
[oracle@node4 ~]$ netmgr
Xlib: connection to ":1.0" refused by server
Xlib: No protocol specified
Exiting
java.lang.NullPointerException
at oracle.ewt.lwAWT.BufferedApplet.<init>(Unknown Source)
at oracle.sysman.emSDK.client.appContainer.WebApplication.<init>(WebApplication.java:752)
at oracle.net.mgr.container.NetApplication.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at oracle.sysman.emSDK.client.appContainer.WebApplication.main(WebApplication.java:3316)
[oracle@node4 ~]$ dbca
Xlib: connection to ":1.0" refused by server
Xlib: No protocol specified
Exception in thread "main" [oracle@node4 ~]$
root下边 vncserver -kill :1
Killing Xvnc process ID 2683
[root@node4 ~]#
su - oracle
vncserver:1
设置密码 然后 vnc客户端重连
亓冰-上海(949714699) 9:35:39
要不然就是 root下边 xhost + export DISPLAY......
就那么几步
You will require a password to access your desktops.
Password:
Verify:
Passwords don't match - try again
Password:
Verify:
New 'node4:1 (oracle)' desktop is node4:1
Creating default startup script /home/oracle/.vnc/xstartup
Starting applications specified in /home/oracle/.vnc/xstartup
Log file is /home/oracle/.vnc/node4:1.log
[oracle@node4 ~]$
#xhost +
#xclock
su - oracle
$ export DISPLAY=localhost:1.0
$xclock