1

Remote Login with GDM and VNC on CentOS 7 / RHEL 7 | Configure VNC on XINETD with XDMCP CentOS 7 / RHEL 7

The following simple guide help you to setup the VNC server using xinetd on RHEL 7/CentOS 7 machines, VNC help to share the desktop with the other machines which has a client installed. VNC server and client are not installed by default, you need to setup the vnc server manually.

Before installing the VNC server, install Gnome desktop.

ADVERTISEMENT 

ARTICLE WILL CONTINUE AFTER THE AD

Install the tigervnc server, X11 fonts and xinetd.

[root@server ~]# yum install tigervnc-server xorg-x11-fonts-Type1 xinetd

Enable the XDMCP.

[root@server ~]# vi /etc/gdm/custom.conf

Add the following content.

[security] AllowRemoteRoot=true DisallowTCP=false   [xdmcp] Enable=true MaxSessions=30

Create Xinetd service.

[root@server ~]#  vi /etc/xinetd.d/vncserver

Place the following content on the above file.

service vncserver { disable = no socket_type = stream protocol = tcp group = tty wait = no user = nobody server = /usr/bin/Xvnc server_args = -inetd -query localhost -geometry 1024×768 -depth 16 -once -fp /usr/share/X11/fonts/misc -securitytypes=none }

Create VNC service.

[root@server ~]# vi /etc/services

Add the following line at the end of file.   Line: 8933

vncserver 5900/tcp # VNC and GDM

Restart xinetd service

[root@server ~]# systemctl restart xinetd.service

Add firewall rules to allow the VNC connection, the following rule is set as per the port-offset mentioned in the previous step.

[root@server ~]# firewall-cmd --permanent --zone=public --add-port=5900/tcp [root@server ~]# firewall-cmd --reload

Reboot the machine, if required.

[root@server ~]# reboot

Use VNC viewer to connect.

ipaddress:5900

CentOS 7 – VNC with Xinetd – VNC Viewer

You will be asked to enter username and password.

CentOS 7 – VNC with Xinetd – UserName and Password

Now you will get the vnc desktop.

CentOS 7 – VNC with Xinetd – Desktop

That’s all you have successfully configured VNC server with Xinetd on CentOS 7/RHEL 7.