Centos7 installation VNC (self tested)


Step 1: install VNC packages:

[[email protected] ~]# yum install tigervnc-server -y

Step 2: modify the configuration information
Create the file vncserver @ under / etc / SYSTEMd / system /: 1 Service, such as file from / lib / SYSTEMd / system/ [email protected] Copy into it

[[email protected] ~]# cp /lib/systemd/system/[email protected] /etc/systemd/system/[email protected]:1.service

Then open the configuration file / etc / SYSTEMd / system / vncserver @: 1 Service replaces the default user name

Find this line

ExecStart=/sbin/runuser -l -c “/usr/bin/vncserver %i”

Here I log in directly as root, so I replace it with

ExecStart=/sbin/runuser -l root -c “/usr/bin/vncserver %i”

Step 3: set the password for VNC

[[email protected] ~]# vncpasswd

Step 4: start VNC service

[[email protected] ~]# vncserver