Vnc or Virtual Network Computing is a two-way communication between server and client that allows users to graphically manage server resources, in this tutorial on how to install vnc on centos Linux .
Steps to Install vnc on Linux
Tigervnc-server is a program that allows Xvnc to simultaneously control sessions in parallel with Gnome or any desktop user interface on Linux, and also enables the ability to simultaneously connect multiple users to a single server with the same username. .
To install tigervnc-server on centos 7 Linux just log in with root access to your server first, if you are not familiar with how to connect to ssh you can use the tutorial we have published on this site.
After login, just enter the following command into your ssh server environment.
After installing vnc on Linux you need to log in to the user you want to enable vnc on the following command.
su - your_user
Enter your username instead of your_user, now you must select a password for your username, just note that this password must be at least 6 characters long.
You should now configure the vnc service config file for the user you want by following the command with root access to the config files path in the systemd directory.
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
At this point you should open the file you copied to / etc / systemd / system / with an editor and add the following lines to it.
[Unit] Description = Remote desktop service (VNC) After = syslog.target network.target [Service] Type = forking ExecStartPre = / bin / sh -c '/ usr / bin / vncserver -kill% i> / dev / null 2> & 1 || : ' ExecStart = / sbin / runuser -l my_user -c "/ usr / bin / vncserver% i -geometry 1280x1024" PIDFile = / home / my_user / .vnc /% H% i.pid ExecStop = / bin / sh -c '/ usr / bin / vncserver -kill% i> / dev / null 2> & 1 || : ' [Install] WantedBy = multi-user.target
Replace your_user with your username in the code above.
After making the changes to the following commands, we will activate the TigerVNC service and check the status of the VNC service with the following commands.
systemctl daemon-reload systemctl start vncserver @: 1 systemctl status vncserver @: 1 systemctl enable vncserver @: 1
Now to make sure the vnc service is enabled by the ss command, we will check the open server ports and port 5901 / TCP must be enabled on the server.
ss -tulpn | grep vnc
In the last step of installing vnc on Linux you need to make sure port 5901 is not fired
on the server by the firewall. do.
firewall-cmd --add-port = 5901 / tcp firewall-cmd --add-port = 5901 / tcp - permanent
Connection to vnc server by vnc client
Virtually all operating systems can be connected to a vnc server,
Windows operating system can be graphically connected to the server by RealVNC Viewer software.
To connect to the vnc server,
just run RealVNC Viewer and install the ip and port port
of the server as the socket address as you see in the picture and hit Enter.
After connecting to the vnc server,
a message with the name “connection is not encrypted” will appear as in the picture below,
click the Continue button to reject the message. Now you need to enter the password and click Ok.
After this step you will be connected to vnc,
if a message that you do not have root access appears click Cancel to delete this message.
On Linux operating system you can also install vnc client with vinagre software and act as Windows connection.
You can use the following command to install vnc client on centos Linux.
yum install vinagre
You have completed the tutorial on installing vnc on linux centos and how to connect it,
if you have any questions about this article you can send it to us at the bottom of this page
to send it in less than 24 hours.