Linux下VNC安装设置


Oracle在Linux上的安装需要用到图形界面(静默安装除外),身体好的同志完全可以在机房里面顶着做,身体素质一般的还是老老实实的远程操作吧。方便起见我们就使用Linux自带的vnc-server。
 
首先查看是否安装了vnc-server服务:
 
[root@localhost ~]# rpm -qa vnc-server
 
vnc-server-4.0-8.1
 
如果没有安装则上传安装包安装即可,安装完成以后运行vncserver,如果用户是第一次运行需要设置vnc密码,否则不需要设置。
 
[root@localhost ~]$ vncserver
 
You will require a password to access your desktops.
 
Password:
 
Verify:
 
xauth:  creating new authority file /root/.Xauthority
 
New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1
 
Creating default startup script /root/.vnc/xstartup
 
Starting applications specified in /root/.vnc/xstartup
 
Log file is /root/.vnc/localhost.localdomain:1.log
 
上面的这段话表示启动了一个图形终端,编号为1。现在我们就可以通过vncviewer等工具远程连接服务器了,在连接的时候需要提供图形终端号。连接上以后会发现图形界面相当的丑陋,因为默认的图像终端使用的是xterm+twm,我们可以通过修改启动脚本将gnome或kde作为默认的图像终端。编辑用户home目录下的/.vnc/xstartup,将twm替换为gnome-session并重启vncserver即可。
 
[root@localhost ~]# vi /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" &
 
gnome-session &
 
 
 
[root@localhost ~]# vncserver -kill :1
 
Killing Xvnc process ID 4117
 
 
 
[root@localhost ~]# vncserver
 
New 'localhost.localdomain:1 (root)' desktop is localhost.localdomain:1
 
Starting applications specified in /root/.vnc/xstartup
 
Log file is /root/.vnc/localhost.localdomain:1.log
  • 1
  • 2
  • 下一页

相关内容