在linux系统下安装VNC Server,大多数linux发行版都带了VNC Server的发行包.只要选择安装就可以了.在Windows下安装VNC 客户端
[root@localhost ~]# cd /root
[root@localhost ~]# cd .vnc
-bash: cd: .vnc: No such file or directory
[@more@][root@localhost ~]# cd /media/
.hal-mtab .hal-mtab-lock RHEL_5.4 x86_64 DVD/
[root@localhost ~]# cd /media/RHEL_5.4 x86_64 DVD/
[root@localhost RHEL_5.4 x86_64 DVD]# cd Server/
[root@localhost Server]# ls -alh |grep vnc-
vnc-4.1.2-14.el5_3.1.x86_64.rpm vnc-server-4.1.2-14.el5_3.1.x86_64.rpm
[root@localhost Server]# rpm -ivh vnc-4.1.2-14.el5_3.1.x86_64.rpm
warning: vnc-4.1.2-14.el5_3.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
package vnc-4.1.2-14.el5_3.1.x86_64 is already installed
[root@localhost Server]# rpm -ivh vnc-server-4.1.2-14.el5_3.1.x86_64.rpm
warning: vnc-server-4.1.2-14.el5_3.1.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
package vnc-server-4.1.2-14.el5_3.1.x86_64 is already installed
[root@localhost Server]#
[root@node2 ~]# vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth: creating new authority file /root/.Xauthority
New 'node2:1 (root)' desktop is node2:1
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/node2:1.log
修改xstartup文件(只修改标红部分):
[root@node2 ~]# 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" &
#twm &
gnome-session &
~
按照文档红色部分更改。
保存后重启系统生效,也可以再次打开一个nvc终端生效
[root@node2 ~]# vncserver :3
New 'node2:3 (root)' desktop is node2:3
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/node2:3.log
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/18841027/viewspace-1057892/ ,如需转载,请注明出处,否则将追究法律责任。