How to install tigervnc on CentOS 7

Now start installing VNC packages.
Step 1  Issue the below command to install VNC package.
[root@krizna ~]# yum install tigervnc-server -y
Step 2  Create a file vncserver@:1.service in /etc/systemd/system/ directory by copying example config file /lib/systemd/system/[email protected]
[root@krizna ~]# cp /lib/systemd/system/[email protected] /etc/systemd/system/vncserver@:1.service
Step 3  Now open /etc/systemd/system/vncserver@:1.service file and replacewith your username .
Find these lines ..
ExecStart=/sbin/runuser -l <USER> -c "/usr/bin/vncserver %i"
PIDFile=/home/<USER>/.vnc/%H%i.pid

Replace ( Considering username as john )
ExecStart=/sbin/runuser -l john -c "/usr/bin/vncserver %i"
PIDFile=/home/john/.vnc/%H%i.pid

If you are creating for root user .
ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver %i"
PIDFile=/root/.vnc/%H%i.pid

Step 4  Reload systemd for changes.
[root@krizna ~]# systemctl daemon-reload
Step 5  Create VNC password for the user .
[root@krizna ~]# vncpasswd
Step 6  Enable and start the service using the below commands.
Enable service at startup ( Permanent ).
[root@krizna ~]# systemctl enable vncserver@:1.service
Start the service .
[root@krizna ~]# systemctl start vncserver@:1.service
Step 7  Allow VNC service in firewall.
[root@krizna ~]# firewall-cmd --permanent --add-service vnc-server
[root@krizna ~]# systemctl restart firewalld.service

你可能感兴趣的:(start)