Configure vncserver in CentOS7

Source: Internet
Author: User

Configure vncserver in CentOS7

1. Run the following command as root to install TigerVNC server

Yuminstalltigervnc-server

You can also install the vnc client

Yuminstallvnc

2. Configure the VNC Server

2.1 create a new configuration file. Here I open window 3, as follows:

Cp/lib/systemd/system/vncserver @. service/lib/systemd/system/vncserver @: 3. service

2.2 edit/lib/systemd/system/vncserver @: 3. service and set zhongq parameters. The final content is as follows: (here, zhongq must be replaced with your account)

Unzip unitshortdescriptionappsremoteshorttopservice(vnc?after=syslog.targetnetwork.tar get [Service] Type = forking # Cleananyexistingfilesin/tmp /. x11-unixenvironmentExecStartPre =/bin/sh-c '/usr/bin/vncserver-kill % I>/dev/null2> & 1 |: 'execstart =/sbin/runuser-lzhongq-c "/usr/bin/vncserver % i-geometry1024x768" PIDFile =/home/zhongq /. vnc/% H % I. pidExecStop =/bin/sh-c '/usr/bin/vncserver-kill % I>/dev/null2> & 1 |: '{install}wantedby}multi user.tar get

2.3 update systemctl to make sure it takes effect

Systemctldaemon-reload

2.4 set the user's vnc Password

Vncpasswdzhongq

2.5 start the service to enable vnc's window 3

Systemctlstartvncserver @: 3. service or vncserver: 3

Close Window 3

Systemctlstopvncserver @: 3. service or vncserver-kill: 3

2.6 We can also set it to boot automatically

Systemctlenablevncserver @: 3. service

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.