Configure VNC Server on CentOS 7/rhel 7

Source: Internet
Author: User
Tags syslog

The following simple guide, "the VNC server on RHEL 7/centos 7 machines, VNC help to share the desktop wit H The other machines which have a client installed. VNC server and client is not a installed by default, you need to setup the VNC server manually.

Before installing the VNC server, let us install Gnome desktop.

[[email protected] ~]# yum groupinstall  "Gnome desktop" 

install the TIGERVNC server and X11 fonts.

[[email protected] ~]# yum install tigervnc-server xorg-x11-fonts-type1 

copy the VNC server configuration file to/etc/systemd/system/for Configuring the system service. While copying, you can mention which port it should listen. By default VNC server listens on 5900, but if you are setup port-offset for VNC; We can run a service on a sub-port of the default port 5900. For example, if we mention Port 5, it is accessible on 5905.  you can connect the VNC server by specifying Ipadd Ress:sub-port (192.168.2.109:5 or 192.168.2.109:5905)

[[email protected] ~]# cp /lib/systemd/system/[email protected] /etc/systemd/ System/[email protected]:5.service 

edit the copied file.

[[email protected] ~]# vi /etc/systemd/system/[email protected]:5.service 

at the end of file, you'll find the lines like below.

[unit]
description=remote Desktop Service (VNC)
after=syslog.target network.target[service]
type=forking
# clean any existing files in/tmp/. X11-unix environment
execstart=/sbin/runuser-l <USER>-C"/usr/bin/vncserver%i "
PIDFILE=/HOME/<USER>/.VNC/%H%I.PID
execstop=/bin/sh-c '/usr/bin/vncserver- Kill%i >/dev/null 2>&1 | | : ' [install]
wantedby=multi-user.target

replace <USER> with your real USER, in my case I replaced with USER called "Raj" with the screen size.

[unit]
description=remote Desktop Service (VNC)
after=syslog.target network.target[service]
type=forking
# clean any existing files in/tmp/. X11-unix environment
execstart=/sbin/runuser-l raj-c"/usr/bin/vncserver%i-geometry 1280x1024″
PIDFILE=/HOME/RAJ/.VNC/%H%I.PID
execstop=/bin/sh-c '/usr/bin/vncserver-kill%i >/ Dev/null 2>&1 | | : ' [install]
wantedby=multi-user.target

add firewall rules to allow the VNC connection, the following rule was set as per the Port-offset mentioned in the Previou S step.

[[email protected] ~]# firewall-cmd --permanent --zone=public --add-port=5905/ Tcp[[email protected] ~]# firewall-cmd --reload 

start VNC server after switching to Raj.

[[email protected] ~]$ vncserver 

Set the password.

You'll require a password to access your desktops.

Password:
Verify:
xauth:file/home/raj/. Xauthority does not exist

New ' Localhost.localdomain:1 (Raj) ' Desktop is server.itzgeek.com:1

Creating default startup Script/home/raj/.vnc/xstartup
Starting applications specified In/home/raj/.vnc/xstartup
Log file Is/home/raj/.vnc/server.itzgeek.com:1.log

Reload the Systemctl daemon as root

systemctl daemon-reload 

start the VNC service as root.

systemctl start [email protected]:5.service 

enable it on system startup as root.

systemctl enable [email protected]:5.service 

take Remote Desktop.

ipaddress:5905 or ipaddress:5

650) this.width=650; "src=" Http://www.itzgeek.com/wp-content/uploads/2014/07/CentOS-7-VNC-connection.jpg "alt=" CentOS 7-vnc Connection "width=" 421 "height=" 212 "style=" margin:0px 0px 5px;padding:0px;border:0px;vertical-align: baseline;height:auto;background-position:0px 50%; "/>

CentOS 7–vnc Connection

You'll be asked to enter the password, enter the password and that's created earlier.

650) this.width=650; "class=" Size-full wp-image-7209 "src=" http://www.itzgeek.com/wp-content/uploads/2014/07/ Centos-7-vnc-authendication.jpg "alt=" CentOS 7-vnc authendication "width=" 418 "height=" 215 "style=" margin:0px 0px 5px; padding:0px;border:0px;vertical-align:baseline;height:auto;background-position:0px 50%; "/>CentOS 7–vnc Authendication

Now you'll get the VNC desktop session.

650) this.width=650; "class=" wp-image-7214 "src=" http://www.itzgeek.com/wp-content/uploads/2014/07/ Centos-7-vnc-desktop.jpg "alt=" CentOS 7-vnc Desktop "width=" 640 "height=" "style=" margin:0px 0px 5px;padding:0px; border:0px;vertical-align:baseline;height:auto;background-position:0px 50%; "/>centos 7–vnc Desktop


This article is from the "Permanent" blog, make sure to keep this source http://ericklee.blog.51cto.com/6941516/1625798

Configure VNC Server on CentOS 7/rhel 7

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.