Article From:https://www.cnblogs.com/yutian1322/p/9971864.html

 

How to Install and Configure VNC Server on CentOS 7.0

 https://www.linuxidc.com/Linux/2015-04/116725.htm

–After installing the GUI and graphics management tools, the following can be ignored

yum install gnomeclassicsession gnometerminal nautilusopenterminal controlcenter liberationmonofonts

  1. ### Setting default boot graphical interface
  2. # unlink /etc/systemd/system/default.target
  3. # ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

yum install tigervncserver

 

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

 

vim /etc/systemd/system/vncserver@:1.service

 

 

If it is root user

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

[Service]
#Type=forking
Type=simple

 

systemctl daemon-reload

— Set up the password first, then start the service, otherwise the error will be reported.

vncpasswd

vncxx#ZL

systemctl enable vncserver@:1.service

systemctl status vncserver@:1.service

systemctl start vncserver@:1.service

 

vncserver -list

[root@localhost ~]# lsof -i:5901
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
Xvnc 3690 root 9u IPv4 113235 0t0 TCP *:5901 (LISTEN)
Xvnc 3690 root 10u IPv6 113236 0t0 TCP *:5901 (LISTEN)

–Modify the default port of vncserver

Turn:

linux vncDefault port modification

https://blog.csdn.net/wangxxhb/article/details/71637149

 

Link of this Article: Turn to install vncserver

Leave a Reply

Your email address will not be published. Required fields are marked *