zoukankan      html  css  js  c++  java
  • CentOS 6.8 安装vnc

    1. 先检查下是否有安装VNC

    [root@yanghg yanghg]# rpm -qa | grep tigervnc
    tigervnc-1.1.0-18.el6.x86_64
    tigervnc-server-1.1.0-18.el6.x86_64
    如果没有安装则执行:

    [root@yanghg yanghg]# yum install tigervnc-server -y
    已加载插件:fastestmirror, refresh-packagekit, security
    设置安装进程
    Repository base is listed more than once in the configuration
    Repository updates is listed more than once in the configuration
    Repository extras is listed more than once in the configuration
    Repository centosplus is listed more than once in the configuration
    Repository contrib is listed more than once in the configuration
    Loading mirror speeds from cached hostfile
     * base: mirrors.btte.net
     * epel: mirror.premi.st
     * extras: mirrors.btte.net
     * linuxtech-release: pkgrepo.linuxtech.net
     * nux-dextop: mirror.li.nux.ro
     * rpmfusion-free-updates: mirror.bjtu.edu.cn
     * rpmfusion-nonfree-updates: mirror.bjtu.edu.cn
     * updates: mirrors.aliyun.com
    包 tigervnc-server-1.1.0-18.el6.x86_64 已安装并且是最新版本
    无须任何处理
    [root@yanghg yanghg]#

    2. 执行[root@yanghg yanghg]# vncserver

    第一次执行会让你输入密码,至少6位,后续在vncviewer连接服务器端主机中需要用到。

    注意:后续可用vncpasswd命令修改密码

    3. 启动vncserver服务

    启动vncserver服务有两种方式。

    第一种:/etc/init.d/vncserver start,此种方式需要编辑配置文件。

    [root@node1 ~]# /etc/init.d/vncserver start
    Starting VNC server: no displays configured                [FAILED]

    报以上错误,需修改配置文件

    $ vim /etc/sysconfig/vncservers 

    4. /etc/sysconfig/vncservers 文件添加以下内容:

     VNCSERVERS="1:root 2:yanghg"
     VNCSERVERARGS[1]="-geometry 1920x1080 -depth 32 -nolisten tcp"
     VNCSERVERARGS[2]="-geometry 1920x1080 -depth 32 -nolisten tcp"

    5. # vim /root/.vnc/xstartup

    #twm & //注释该行

    末尾追加如下行:

    gnome-session & //如果为KDE桌面,则修改为:startkde &

    其他用户同理修改

    6. 最后启动vncserver 并设置为开机启动,执行以下

    # service vncserver start

    # chkconfig vncserver on

    补充:

    如果执行# service vncserver start有发现报以下错误

    2:yanghg 
    You will require a password to access your desktops.

    getpassword error: Inappropriate ioctl for device
    Password:3:yuy 
    You will require a password to access your desktops.

    getpassword error: Inappropriate ioctl for device
    Password: [FAILED]

    让用户设置密码(必须切换到配置文件中添加的用户名下,如yanghg)

    # vncpasswd

    7. 看看新生成的桌面对应的窗口

    [root@yanghg yanghg]# netstat -ntlup |grep vnc
    tcp        0      0 0.0.0.0:5901                0.0.0.0:*                   LISTEN      2911/Xvnc           
    tcp        0      0 0.0.0.0:5902                0.0.0.0:*                   LISTEN      3050/Xvnc           

    参考链接:http://www.cnblogs.com/ivictor/archive/2015/08/27/4760914.html

  • 相关阅读:
    PHP与CI学习笔记
    The Sum of the k-th Powers(Educational Codeforces Round 7F+拉格朗日插值法)
    Nastya Hasn't Written a Legend(Codeforces Round #546 (Div. 2)E+线段树)
    Please, another Queries on Array?(Codeforces Round #538 (Div. 2)F+线段树+欧拉函数+bitset)
    Gorgeous Sequence(HDU5360+线段树)
    Subsequence(HDU3530+单调队列)
    Qualification Rounds(Codeforces Round #438 by Sberbank and Barcelona Bootcamp (Div. 1 + Div. 2 combined)+状态压缩)
    Xenia and Weights(Codeforces Round #197 (Div. 2)+DP)
    字节跳动-文远知行杯”广东工业大学第十四届程序设计竞赛
    线段树优化建边
  • 原文地址:https://www.cnblogs.com/cutelinux/p/5754835.html
Copyright © 2011-2022 走看看