分类: 系统运维
2013-07-17 10:08:22
类似与xmanger和ssh都是连接linux服务器的工具,vnc工具最大的特点就是可以展现桌面窗口,并且在网络突然断掉的话,在服务器端保持当前的状态,即再次连接时认识刚断掉时的状态,这里只是弱弱的做一个简单的配置!
1、在linux服务器端的
(1)、所要安装的套件(RHEL5系统默认是安装好的)
[root@ethnicity ~]# rpm -qa |grep vnc
vnc-server-4.1.2-14.el5_3.1
(2)、服务器的初始化
[root@ethnicity ~]# vncserver(按照提示输入登入时所需的密码)
You will require a password to access your desktops.
Password:
Verify:
xauth: (stdin):1: bad display name "ethnicity.com:8" in "add" command
New 'ethnicity.com:8 (root)' desktop is ethnicity.com:8
Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/ethnicity.com:8.log
(3)、相关的设置
[root@ethnicity ~]#vi /etc/sysconfig/vncservers //通过修改这个可以改变窗口大小
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"
[root@ethnicity ~]# cd .vnc/
[root@ethnicity .vnc]# vi 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 &
#gname-session &
[root@ethnicity .vnc]# ls
ethnicity.com:8.log ethnicity.com:8.pid passwd xstartup
下边是进程的重启过程
[root@ethnicity .vnc]# vncserver -kill :8(杀掉进程)
Killing Xvnc process ID 10029
[root@ethnicity .vnc]# vncserver :8(开启进程)
xauth: (stdin):1: bad display name "ethnicity.com:8" in "add" command
New 'ethnicity.com:8 (root)' desktop is ethnicity.com:8
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/ethnicity.com:8.log
2、在客户端的设置
在下载VNC Viewer 安装
安装好之后双击在出来的窗口中输入ip:number(ip为服务器的ip,number为vncserver的编号,就好比上边的那个8)
这样之后就能顺利的登录图像界面了