Centos 7 system configuration and installation VNC environment tutorial

Source: Internet
Author: User
Tags centos iptables

First, try installing VNC on the server.

[Root @ wic ~] # Rpm-q tigervnc-server

If it is not installed, it will appear directly

Package tigervnc is not installed
Package tigervnc-server is not installed

If the X-Windows desktop is not 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.tar get
[Root @ wic ~] # Ln-sf/lib/systemd/system/graphical.tar get/etc/systemd/system/default.tar get
[Root @ wic ~] # Reboot

Step 1: install VNC packages:

[Root @ wic ~] # Yum install tigervnc-server-y

Step 2: modify the configuration information and create a vncserver folder under/etc/systemd/system/@: 1. service extracts the example config file from/lib/systemd/system/vncserver @. copy service to it

[Root @ wic ~] # Cp/lib/systemd/system/vncserver @. service/etc/systemd/system/vncserver @: 1. service
Open the configuration file/etc/systemd/system/vncserver @: 1. Replace the default user name with the service.
Find this line

ExecStart =/sbin/runuser-l <USER>-c "/usr/bin/vncserver % I"
PIDFile =/home/<USER>/. vnc/% H % I. pid
Here I log on directly with the root user, so I replaced it
ExecStart =/sbin/runuser-l root-c "/usr/bin/vncserver % I"
PIDFile =/root/. vnc/% H % I. pid

For other users, replace john with the following:

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

Step 3: Reload systemd

[Root @ wic ~] # Systemctl daemon-reload
Step 4: set a password for VNC
[Root @ wic ~] # Vncpasswd

Step 5: because Centos 7 on my side uses iptable firewall

Vim/etc/sysconfig/iptables

Add

-A input-m state -- state NEW-m tcp-p tcp -- dport 5900: 5903-j ACCEPT

Restart iptable

Service iptables restart

If you use the Centos 7 default firewall, you may need

[Root @ wic ~] # Firewall-cmd -- permanent -- add-service vnc-server
[Root @ wic ~] # Systemctl restart firewalld. service

Step 6: Enable and enable VNC by default

[Root @ wic ~] # Systemctl enable vncserver @: 1. service
[Root @ wic ~] # Systemctl start vncserver @: 1. service

In this way, the Centos end is basically set up, and the Windows end will go to the next VNC Viewer software. Try connecting. It looks a little simple but it goes up.

 


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.