The Linux system provides the developer with the convenience of performance, but it loses the convenience of the interface management of window System. Here's how to implement an interface on a Linux system. (CentOS as an example)
This article explains in detail the installation of the VNC service under CentOS and the VNC Viewer connection. VNC SERVER Installation:
1. Run the following command as the root user
Yum Install Tigervnc-server
2. Deactivate the firewall
Systemctl Stop Firewalld.servicesystemctl Disable Firewalld.service
VNC SERVER Configuration:
1. Create a new profile, take the first connection as an example (you can also open multiple connections at the same time, modify the numbers.) A multi-user connection like Windows), as follows:
CP /lib/systemd/system/[email protected]/lib/systemd/system/[email protected]:1. Service
CP /lib/systemd/system/[email protected]/lib/systemd/system/[email protected]:2. Service
2. View the configuration created above:
ls /lib/systemd/system
3. Edit the configuration file/lib/systemd/system/[email protected]: 1.service. Replace <user> with the username you need to connect to, and it is generally recommended that the first connection be to the root user.
VI /lib/systemd/system/[email protected]:1. Service
[Unit]description=Remote Desktop Service (VNC) after=Syslog.target Network.target[service]type=forking# Clean any existing filesinch/tmp/. x11-Unix Environmentexecstartpre=/bin/SH-C'/usr/bin/vncserver-kill%i >/dev/null 2>&1 | |:'Execstart=/sbin/runuser-l root-c"/usr/bin/vncserver%i"Pidfile=/root/.vnc/%h%I.pidexecstop=/bin/SH-C'/usr/bin/vncserver-kill%i >/dev/null 2>&1 | |:'
Save Update VNC configuration:
1. Save
2. Set Vncserver password
VNCPASSWD Root
3. Starting and shutting down the VNC server
Systemctl start [email protected]:1. servicesystemctl stop [email protected]:1. Service
4. Start-up automatically
SYSTEMCTL enable [email protected]:1. Service
Frequently encountered problems with VNC server open:
for [Email protected]:1"systemctl Status [email protected]:1.service"" Journalctl-xe " for VI /lib/systemd/system/[email protected]:2. Service
Modify [email Protected]:1.service Type to Simple
Re-execute
VNC Viewer Connection
1. Download and install the VNC viewer:
https://www.realvnc.com/en/connect/download/viewer/
2. Configuration
Note: Port number 5901, is the first connection. The default is the 590+ connection number. You can manually modify the port.
CentOS Installation VNC Server