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.

Install the tigervnc server, X11 fonts and xinetd.

yum install tigervnc-server xorg-x11-fonts-Type1 xinetd

Enable the XDMCP.

vi /etc/gdm/custom.conf

Add the following content.

[security]
AllowRemoteRoot=true
DisallowTCP=false

[xdmcp]
Enable=true
MaxSessions=30

Create Xinetd service.

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.

vi /etc/services

Add the following line at the end of file.
vncserver 5900/tcp # VNC and GDM

Restart xinetd service

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.

firewall-cmd --permanent --zone=public --add-port=5900/tcp
firewall-cmd --reload

Reboot the machine, if required.

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.
centso 7remoteremote desktoprhel 7vncxinetd
Comments (5)
Add Comment
  • Brent

    I have used this configuration extensively with CentOS 6.5 and prior. I’m not getting this configuration to work and some things don’t add up. First the -fp /usr/share/X11/fonts/misc is not required, it doesn’t exist given the commands you have provide. Second, a “greeter” specification is needed /etc/gdm/custom.conf. The greeter (RemoteGreeter=/usr/libexec/gdm-simple-greeter) that used to ship in CentOS 6.5, and prior, doesn’t exist in CentOS 7.

    You are installing the tigervnc server, but xinetd calls the system Xvnc which is part of the OS Gnome Desktop.

    I believe the key element missing in CentOS 7 is the greeter application. As near as I can tell tigervnc-server doesn’t fill any void in that respect.

    Perhaps your intent is to have xinetd serve only as a bridge to tigervnc-server configured in a classic user-by-user config?

  • Brent

    Ok Raj I see your prior (7/25/14) post on the tiger vncserver setup and it seems the xinetd configuration that you are showing here inserts xinetd into that “single user” or “user-by-user” tiger vncserver configuration.

    The configuration that I described in my prior post allows for a general user login, just like you would get on the console, without user-by-user vnc configuration. This is a hugely valuable remote access config that I haven’t yet figured out how to get working on CentOS 7.

  • bret

    Brent,

    I am trying to do the same thing with RHEL 7. I too, have been able to set up GDM/VNC for RHEL 4, RHEL 5, and RHEL 6 where the GDM Greeter screen is presented as the first VNC screen. When I attempt access to RHEL7 with a VNC client, I just get a black screen with an X. I’ve set up /etc/gdm/custom.conf as described, the F/W is off, and I have xinetd installed (just like I have done for RHEL 4, 5, & 6). Any ideas how to get the GDM Greeter to work for RHEL 7 (or CentOS 7)?

    Regards,

    Bret

  • André Luís Mendes

    Hi guys,

    As far as I could discover there is a difference in the package gdm for i686 and x86_64. Could some confirm if those instructions is for the 32bits or for the 64bits ?
    At least for Fedora 23, I saw that the 64 bits pack does not have the greeter application.

    • Rajasekar Sundaram

      This is for 64 bit