来源:http://www.weiruoyu.cn/?p=420


摘自赶星老师的视频

1、 安装软件包
[root@CentOS ~]#rpm -q vnc-server
[root@CentOS ~]#yum install vnc-server vnc

2、 设置用户密码
[root@CentOS ~]#vncpasswd
设置用户密码之后会在/root/目录下新建一个 .vnc的隐藏目录
3、 编辑服务配置文件
[root@CentOS ~]#vi /etc/sysconfig/vncservers
VNCSERVERS="7:root"
VNCSERVERARGS[7]="-geometry 1024x768 -alwaysshared"
4、 创建xstartup脚本
[root@CentOS ~]# service vncserver start
[root@CentOS ~]# service vncserver stop
[root@CentOS ~]# ls .vnc/
CentOS:7.pid xstartup CentOS:7.log passwd
5、 编辑xstartup文件(centos6下面可以不修改)
只需要把以下红色字部份的注解去掉即可

[root@CentOS ~]# vi .vnc/xstartup

#!/bin/sh

# Uncomment the following two lines for normal desktop:

unset SESSION_MANAGER exec

/etc/X11/xinit/xinitrc


6、 启动VNC服务,登陆测试
[root@CentOS ~]# service vncserver start

7.使用vnc软件连接(软件在附件)

 vnc 远程连接linux桌面_linux

详细请参考:http://www.weiruoyu.cn/?p=420