In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to install and configure VNC server in Linux. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
VNC is a free open source software based on UNIX and Linux operating system. Its remote control ability is powerful, efficient and practical, and its performance is comparable to that of any remote control software in Windows and MAC.
Some of the advantages of VNC servers:
Remote graphics management makes the work simple and convenient. The clipboard can be shared between the CentOS server host and the VNC client machine. Graphical tools can also be installed on CentOS servers to make management more powerful. As long as the VNC client is installed, the CentOS server can be managed through any operating system. More reliable than ssh graphics forwarding and RDP connections.
So, let's start the journey of installing the VNC server. We need to follow these steps to build an available VNC step by step.
First, we need an available desktop environment (X-Window), and if not, we need to install one first.
Note: the following commands must be run with root privileges. To switch to root, run "sudo-s" under the terminal, not including double quotes (""), of course.
1. Install X-Window
First we need to install X-Window, run the following command in the terminal, and the installation will take some time.
# yum check-update# yum groupinstall "X Window System" # yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts installation and configuration of VNC server rules for installation and configuration of VNC server # set default boot graphics interface # unlink / etc/systemd/system/default.target# ln-sf / lib/systemd/system/graphical.target / etc/systemd/system/default.target# reboot
After the server restarts, we have a working CentOS 7 desktop environment.
Now we are going to install the VNC server on the server.
two。 Install the VNC server
Now it's time to install the VNC server on our CentOS 7. We need to carry out the following orders.
# yum install tigervnc-server-Y3. Configure VNC
Then we need to create a configuration file in the / etc/systemd/system/ directory. We can copy a sample configuration file of / lib/systemd/sytem/vncserver@.service.
# cp / lib/systemd/system/vncserver@.service / etc/systemd/system/vncserver@:1.service
Then we open / etc/systemd/system/vncserver@:1.service with our favorite editor (the nano we use here), find the following lines, and replace them with our user name. For example, my user name is linoxide, so I replace it with linoxide:
ExecStart=/sbin/runuser-l-c "/ usr/bin/vncserver% I" PIDFile=/home//.vnc/%H%i.pid
Replace with
ExecStart=/sbin/runuser-l linoxide-c "/ usr/bin/vncserver% I" PIDFile=/home/linoxide/.vnc/%H%i.pid
If it is a root user,
ExecStart=/sbin/runuser-l root-c "/ usr/bin/vncserver% I" PIDFile=/root/.vnc/%H%i.pid
All right, let's restart systemd.
# systemctl daemon-reload
Finally, set the user's VNC password. To set a user's password, you must have permission to switch to the user through sudo. Here I use the permission of linoxide to execute "su linoxide".
# su linoxide$ sudo vncpasswd
Note: make sure that the password you enter is more than 6 characters
4. Start the service
Start the service (permanently) with the following command:
$sudo systemctl enable vncserver@:1.service
Start the service.
$sudo systemctl start vncserver@:1.service5. Firewall Settin
We need to configure a firewall for the VNC service to work properly.
$sudo firewall-cmd-permanent-add-service vnc-server$ sudo systemctl restart firewalld.service
You can now connect to the VNC server using IP and port number (for example, 192.168.1.1 LCTT 1, where the port is not the server's port, but sorted from 1 depending on the number of VNC connections).
6. Connect to the server with a VNC client
Well, the installation of the VNC server is now complete. To connect to the server using VNC, we also need a VNC client installed on the local computer for connecting to the remote computer only.
You can use clients like Tightvnc viewer and Realvnc viewer to connect to the server.
To connect with more users, you need to create a profile and port, go back to step 3 and add a new user and port. You need to create a vncserver@:2.service and replace the user name in the configuration file and the corresponding file name and port number in the subsequent steps. Please make sure that you log in to the VNC server with the same user name you used when you configured your VNC password.
The VNC service itself uses port 5900. Given that different users use VNC, everyone will get a different port for their connection. The number in the configuration file name tells the VNC server to run the service on subport 5900. In our example, the first VNC service will run on port 5901 (5900 + 1), and then increase in turn, running on port 5900 + x. Where x is the x in the user's profile name vncserver@:x.service.
Before establishing a connection, we need to know the IP address and port of the server. An IP address is a unique identification number of a computer in the network. The IP address of my server is 96.126.120.92jue VNC user port is 1.
Execute the following command to get the public IP address of the server (LCTT: if your server is placed on the intranet or uses a dynamic address, you can get its public IP address).
# curl-s checkip.dyndns.org | sed-e 's/.*Current IP Address: / /'-e's / other commands:
Shut down the VNC service.
# systemctl top vncserver@:1.service
Disable the VNC service from booting.
# systemctl disable vncserver@:1.service
Turn off the firewall.
# systemctl stop firewalld.service 's article on "how to install and configure VNC servers in Linux" ends here. I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.