zoukankan      html  css  js  c++  java
  • Windows 远程连接 CentOS 7 图形化桌面

    1.安装VNC

      yum install tigervnc-server

      

      解决方法:

        rm -f /var/run/yum.pid

        删除文件后再运行yum即可

    2.从VNC备份库中,复制service文件,到系统service服务管理目录下

      cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service

    3.修改vncserver@:1.service文件

      cd  /etc/systemd/system

      vi  vncserver@:1.service

      找到: 

        ExecStart=/usr/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
        PIDFile=/home/<USER>/.vnc/%H%i.pid

      

      改为:(改为root用户)

        ExecStart=/usr/sbin/runuser -l root -c "/usr/bin/vncserver %i"
        PIDFile=/root/.vnc/%H%i.pid

      

    4.重新加载 systemd

      由于在systemd中添了东西,得让系统重新加载。

      systemctl daemon-reload

    5.为vncserver@:1.service 设置密码

      vncpasswd

    6.关闭防火墙

      firewall-cmd --permanent --add-service vnc-server  #添加访问权限

      systemctl restart firewalld.service  #重启firewalld

      CentOS7 默认采用新防火墙firewall,不再用iptables(service iptables status 查看防火墙状态 ,chkconfig iptables off 关闭防火墙)。

        systemctl stop firewalld.service     #停止firewall
        systemctl disable firewalld.service   #禁止firewall开机启动
        firewall-cmd --state           #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)

        

    7.启动vnc服务

      systemctl enable vncserver@:1.service  #设置开机启动

      systemctl start vncserver@:1.service     #启动vnc会话服务

      systemctl status vncserver@:1.service  #查看vnc会话服务状态

      

      systemctl stop vncserver@:1.service  #关闭vnc会话服务

      

      

    8.在windows上下载VNC Viewer

      链接:http://pan.baidu.com/s/1skLBP61 密码:rkkt

    9.连接

      在ip后加上:1即可

      

      

      

    参见:http://www.linuxidc.com/Linux/2017-05/143346.htm

  • 相关阅读:
    LeetCode Path Sum II
    LeetCode Longest Palindromic Substring
    LeetCode Populating Next Right Pointers in Each Node II
    LeetCode Best Time to Buy and Sell Stock III
    LeetCode Binary Tree Maximum Path Sum
    LeetCode Find Peak Element
    LeetCode Maximum Product Subarray
    LeetCode Intersection of Two Linked Lists
    一天一个设计模式(1)——工厂模式
    PHP迭代器 Iterator
  • 原文地址:https://www.cnblogs.com/SZxiaochun/p/7388526.html
Copyright © 2011-2022 走看看