Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Centos7 detailed steps for installing VNC

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the detailed steps of installing VNC in Centos7". In the daily operation, I believe many people have doubts about the detailed steps of installing VNC in Centos7. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "detailed steps for Centos7 to install VNC". Next, please follow the editor to study!

Let's talk about what VNC is (Virtual Network Computing) VNC allows Linux systems to access Linux desktops similar to remote desktop access in Windows. The configuration machine in this paper is running under the environment of a Centos 7 HP server in Xingning Network Information Center.

First of all, try to see if the server has VNC installed.

[root@wic] # rpm-Q tigervnc tigervnc-server

If it is not installed, it will appear directly.

Package tigervnc is not installedpackage tigervnc-server is not installed

If you do not have X-Windows Desktop installed, install Xwindows first.

[root@wic ~] # yum check-update [root@wic ~] # yum groupinstall "X Window System" [root@wic ~] # yum install gnome-classic-session gnome-terminal nautilus-open-terminal control-center liberation-mono-fonts [root@wic ~] # unlink / etc/systemd/system/default.target [root@wic ~] # ln-sf / lib/systemd/system/graphical.target / etc/systemd/system/default.target [root@wic ~] # reboot

Step 1: install VNC packages:

[root@wic ~] # yum install tigervnc-server-y

The second step is to modify the configuration information, create a folder under / etc/systemd/system/ and copy the example config file from / lib/systemd/system/vncserver@.service to vncserver@:1.service

[root@wic ~] # cp / lib/systemd/system/vncserver@.service / etc/systemd/system/vncserver@:1.service

Then open the configuration file / etc/systemd/system/vncserver@:1.service to replace the default user name

Find this business.

ExecStart=/sbin/runuser-l-c "/ usr/bin/vncserver% I" PIDFile=/home//.vnc/%H%i.pid

Here I log in directly as the root user, so I replace it with

ExecStart=/sbin/runuser-l root-c "/ usr/bin/vncserver% I" PIDFile=/root/.vnc/%H%i.pid

If it is another user, such as linoxide, replace it as follows

ExecStart=/sbin/runuser-l linoxide-c "/ usr/bin/vncserver% I" PIDFile=/home/linoxide/.vnc/%H%i.pid

Step 3, reload systemd

[root@wic ~] # systemctl daemon-reload

Step 4, set the password for VNC

[root@wic ~] # vncpasswd

Step 5, because Centos 7 on my side uses iptable firewall, so

Vim / etc/sysconfig/iptables

Add in the appropriate position

-An INPUT-m state-- state NEW-m tcp-p tcp-- dport 5900 tcp 5903-j ACCEPT

Restart iptable

Service iptables restart

If you are using Centos 7 default firewall, you may need to

[root@wic] # firewall-cmd-- permanent-- add-service vnc-server [root@wic ~] # systemctl restart firewalld.service

If you still have problems, you can try to turn off the firewall.

Stop and disable the firewall; systemctl stop firewalld.servicesystemctl disable firewalld.service

If you report:

Centos7 VNC reported to vncserver@:1.service:control process exited,code-exited status=98

Change type to type=simple

Step 6: start and enable VNC by default

[root@wic ~] # systemctl enable vncserver@:1.service [root@wic ~] # systemctl start vncserver@:1.service

So basically the Centos side is set up, and the Windows side is going to the next VNC Viewer software. Connect it and try it. It looks a little shabby, but it goes up.

At this point, the study on "detailed steps for Centos7 to install VNC" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report