Install VNC on CentOS 7

Source: Internet
Author: User
Tags remote desktop access hp server
First ?? Chaos? What is NC (VirtualNetworkComputing) VNC allows the Linux system to access the Linux desktop like remote desktop access in Windows. The machine configured in this article is running in a Centos7HP server environment of Xingning Network Information Center. First, try to install VNC on the server without [root @ wic ~]. # Rpm-qtigervnctigervnc-server

First ?? Chaos? What is NC (Virtual Network Computing) VNC allows a Linux system to access a Linux desktop like a remote desktop access in Windows. This configuration machine runs in a Centos 7 HP server in Xingning Network Information Center.

First, try installing VNC on the server.

[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 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.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

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 
 
   -c "/usr/bin/vncserver %i"PIDFile=/home/
  
   /.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 
 
   -c "/usr/bin/vncserver %i"PIDFile=/home/
  
   /.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.