64
D.2.5. Enabling VNC for RHEL, CentOS, or OEL 6.x VMs
If you are using Red Hat Linux version 6, the GDM configuration file is /etc/gdm/custom.conf. This is a split
configuration file that contains only user-specified values that override the default configuration. This type of file
is used by default in newer versions of GDM, as included in these versions of Red Hat Linux.
Before making configuration changes, verify that you have a VNC server installed. Login as root on the text CLI in
the VM, and run the command rpm -q tigervnc-server gdm. The package names tigervnc-server and gdm
should appear, with their version numbers specified.
If you see a message saying that one of the packages is not installed, then you may not have selected the graphical
desktop options during installation. You will need to install these packages before you can continue. See the
appropriate Red Hat Linux x86 Installation Guide for details regarding installing additional software on your VM.
Follow the instructions below to enable graphical console on your RHEL 6.x VMs:
1. Enter the following command to install the inetd service:
# yum install -y xinetd
2. Open the GDM configuration file with your preferred text editor and add the following lines to the
appropriate sections:
[security]
DisallowTCP=false
[xdmcp]
Enable=true
3. Create the xinetd.d file, /etc/xinetd.d/vnc-server-stream:
service vnc-server
{
id = vnc-server
disable = no
type = UNLISTED
port = 5900
socket_type = stream
wait = no
user = nobody
group = tty
server = /usr/bin/Xvnc
server_args = -inetd -once -query localhost -SecurityTypes None \
-geometry 800x600 -depth 16
}
4. Enter the following command to start the inetd service:
# service xinetd start
5. Open the file, /etc/sysconfig/iptables and add the following line. Note that the line should be
added above the line reading, -A INPUT -j REJECT --reject-with icmp-host-prohibited:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5900 -j ACCEPT
6. Enter the following command to restart iptables:
# service iptables restart
7. Enter the following command to restart gdm:
# telinit 3
# telinit 5