原文网址:http://www.server-world.info/en/note?os=CentOS_6&p=x&f=2
安装VNC 服务器,从远程客户端通过图形用户界面(GUI)连接服务器:
1、首先,切换到一个你想配置VNC的用户
[root@dlp ~]#
yum -y install tigervnc-server #安装VNC服务器
[root@dlp ~]#
su - cent # 切换到一个你想配置VNC的用户
[cent@dlp ~]$vncpasswd # 设置VNC密码命令
Password: # 在这里设置密码
Verify: # 再次输入密码
[cent@dlp ~]$vncserver :1 # 启动vnc服务器
xauth: creating new authority file /home/cent/.Xauthority
创建了一个新的认证文件 /home/cent/.Xauthority
创建了一个新的认证文件 /home/cent/.Xauthority
New 'dlp.server.world:1 (cent)' desktop is dlp.server.world:1
创建的'dlp.server.world:1(cent)'桌面是:dlpserver.world:
创建的'dlp.server.world:1(cent)'桌面是:dlpserver.world:
Creating default startup script /home/cent/.vnc/xstartup
Starting applications specified in /home/cent/.vnc/xstartup
Log file is /home/cent/.vnc/dlp.server.world:1.log
创建一个默认的启动脚本 /home/cent/.vnc/xstartup
运行在/home/cent/.vnc/xstartup中指定的应用。
日志文件存放在/home/cent/.vnc/dlp.server.world:1.log
[cent@dlp ~]$vncserver -kill :1 # 停止vnc服务器
Starting applications specified in /home/cent/.vnc/xstartup
Log file is /home/cent/.vnc/dlp.server.world:1.log
创建一个默认的启动脚本 /home/cent/.vnc/xstartup
运行在/home/cent/.vnc/xstartup中指定的应用。
日志文件存放在/home/cent/.vnc/dlp.server.world:1.log
Killing Xvnc process ID 2187
[cent@dlp ~]$
vi /home/cent/.vnc/xstartup #查看启动脚本中的应用
#twm &# at the end: comment out
#twm &# at the end: comment out
exec gnome-session & #使用gnome会话。
# 运行编号为1的vnc服务器,指定屏幕分辨率为800X600,颜色深度为24位。
[cent@dlp ~]$vncserver :1 -geometry 800x600 -depth 24
2、在客户端安装VNC viewer :
从如下链接下载安装UltraVNC:
http://www.uvnc.com/downloads/ultravnc.html
安装玩UltraVNC后,点击“UltraVNC Viewer”图标运行它。将会显示如下界面。在该界面中指定:
服务器主机名或IP地址:VNC服务器编号
之后点击"Connect" 按钮
3、在弹出命令窗输入VNC密码
4、成功连接后如下图示: