Configure VNC on RHEL 6 /CentOS 6

ADVERTISEMENT

The following simple guide help you to setup the VNC server on RHEL/CentOS 6  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, configure yum repository using iso image or dvd rom. Install the VNC using the yum command. Server must have installed with wither GNOME or KDE desktop

ADVERTISEMENT
Article will continue after the ad
yum install tigervnc-server

Start VNC server.

vncserver

You need to setup the password to access the desktop,  So enter the password that you wish.

You will require a password to access your desktops.

Password:
Verify:

Once entered the password, you will get a information about the desktop session. Desktop session is 1 as per below information, if you need another session issue the vncserver command on terminal; you will get a session 2 and increments every time when issuing the same command again.

New ‘LINUX.ITZGEEK.COM:1 (root)’ desktop is LINUX.ITZGEEK.COM:1

Creating default startup script /root/.vnc/xstartup
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/LINUX.ITZGEEK.COM:1.log

Add iptables entry to allow incoming connection. Assuming that you have created only one desktop session. Default listening port is 5900, If you have created first session it will be 5901 and so on.

iptables -A INPUT -p tcp –dport 5901 -j ACCEPT

Take remote desktop.

ipaddress:5901  or ipaddress:1
You will be asked to enter the password, enter the password that you have created earlier.
Now you will get the vnc desktop session.
That’s all you have successfully configured VNC server on CentOS/RHEL 6.
ADVERTISEMENT

POSTS YOU MAY LIKE -:)

Share This Post

  • Ernesto A

    Thanks for this post, it is very useful and exact.

  • Mario

    Running CentOS 6.6 here.

    I get a “Bad argument ‘5901’” message at iptables. Ideas?

    • Hi maria,

      Command should be

      iptables -A input -p tcp –dport 5901 -j ACCEPT

      There should be double hypen before sport

      Will update article

Shares