linux6.5+5.4  vncserver配置

  1. 挂着光盘

    命令:mount /dev/cdrom /mnt

  2. 配置yum

    命令:cd /etc/yum.repos.d/

    mv rhel-source.repo rhel-source.repo.bak

    yum-config-manager --add file:///mnt

    vim /etc/yum.conf 

    gpgcheck=0

    yum clean all

    yum repolist

  3. 安装软件包

    rpm -qa | grep vnc

    yum -y install tigervnc*

    [root@Linux /]# rpm -qa | grep vnc

    tigervnc-server-1.1.0-5.el6_4.1.x86_64

    libvncserver-0.9.7-4.el6.x86_64

    tigervnc-1.1.0-5.el6_4.1.x86_64

  4. 配置主配置文件

    [root@Linux /]# vim /etc/sysconfig/vncservers

    VNCSERVERS="1:root"           /用户及访问窗口

    SERVERARGS[1]="-geometry 800x600"

    VNCSERVERS="10:vnc"

    SERVERARGS[10]="-geometry 800x600"

    [root@Linux /]# vncpasswd

    Password:

    Verify:

    [root@Linux /]# su - vnc

    [vnc@Linux ~]$ vncpasswd 

    Password:

    Verify:

  5. 启动服务

    [root@Linux ~]# service vncserver restart

    [root@Linux ~]# service vncserver status

    Xvnc (pid 9843 6858) 正在运行...

  6. 查看端口

    [root@Linux ~]# netstat -anput | grep vnc

    tcp        0      0 0.0.0.0:5901                0.0.0.0:*                   LISTEN      6858/Xvnc           

    tcp        0      0 0.0.0.0:6001                0.0.0.0:*                   LISTEN      6858/Xvnc           

    tcp        0      0 0.0.0.0:5910                0.0.0.0:*                   LISTEN      9843/Xvnc           

    tcp        0      0 0.0.0.0:6010                0.0.0.0:*                   LISTEN     9843/Xvnc           

    tcp        0      0 :::6001                     :::*                        LISTEN      6858/Xvnc           

    tcp        0      0 :::6010                     :::*                        LISTEN      9843/Xvnc           

  7. 测试登陆

    [root@Linux-B yum.repos.d]# vncviewer 192.168.1.3:1

    [root@Linux-B yum.repos.d]# vncviewer 192.168.1.3:10