0.转载说明

1.安装与配置:

  1. 关闭防火墙:
    systemctl stop firewalld.service
  2. 安装tigervncserver:yum install tigervnc-server tigervnc-server-module
  3. 拷贝配置文件:
    cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
  4. 配置文件目录:
    cd /etc/systemd/system
  5. 配置文件:
    vim vncserver@:1.service
    配置内容:

    [Unit]
    Description=Remote desktop service (VNC)
    After=syslog.target network.target
    [Service]
    Type=forking
    User=root
    ExecStart=/usr/bin/vncserver :1 -geometry 1280x1024 -depth 16 -securitytypes=none -fp /usr/share/X11/fonts/misc
    ExecStop=/usr/bin/vncserver -kill :1
    [Install]
    WantedBy=multi-user.target

  6. 启用配置文件:
    systemctl enable vncserver@:1.service

  7. 设置登陆密码:
    vncpasswd

2启动VNC、状态查询、调试

  1. 启动vncserver:
    systemctl start vncserver@:1.service
  2. 启动状态查看:
    systemctl status vncserver@:1.service
  3. 查看端口状态:
    netstat -lnt | grep 590*
  4. 查看报错信息:
    grep vnc /var/log/messages

MrZONT
741 声望92 粉丝