CentOS7 install VNC

Disclaimer: This article is a blogger original article, follow the CC 4.0 by-sa copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/hqy860822/article/details/83749962

1, turn off the firewall and selinux

  1.  
    systemctl stop firewalld .service
  2.  
    setenforce 0

2, install the graphics support

yum groups install "GNOME Desktop"或yum groups install "X Window System"

3, install vncserver

yum -y install tigervnc-server

4, modify the configuration file

  1.  
    cp /lib/systemd/ system/[email protected] /etc/systemd/ system/vncserver@: 1.service
  2.  
     
  3.  
    vim /etc/systemd/ system/vncserver@\: 1.service

To find two lines

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

I logged in as root, so as to modify

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

5, reload systemd

systemctl daemon-reload 

6, set vnc login password

vncpasswd 

7, start vncserver

  1.  
    systemctl enable vncserver@: 1.service
  2.  
    systemctl start vncserver@: 1.service

8, to see whether it is normal to start

ps -ef | grep vnc

So far vncserver set up is completed.

Guess you like

Origin www.cnblogs.com/JinweiChang/p/11422063.html