VNC(Virtual Network Computing) is an open source utility to access any remote host through GUI. In this post we will see how to login to Linux server from a windows machine.

Step1 : Install VNCserver on Linux machine
#rpm –ivh vnc-server-4.1.2-9.el5.i386.rpm

Step2 : Start VNC server now
#service vncserver restart

Note and this is very important :
Now it will ask for a password to access the Linux server through VNC viewer and this password is for root user to login from any machine through VNC.
2. If you want to access GUI for a particular user, first login to that user account and execute vncserver command. When you execute this command in the user login it will ask for a password, and this password is for the user to login from remote host through VNC to the Linux server.
3. For security reasons please give different password for accessing Linux through VNC other than your password to login to the Linux machine. If you remember and understand these points your goal is almost completed.

Step3 : Make sure that your Linux server is running in run level 5/GUI. Any of the below command will start your GUI service in Linux.
#init 5

Step4 : By default Linux will not allow login to GUI. We have to configure VNC server to allow user to login through GUI. For configuration VNC server edit ~/.vnc/xstartup file
#vi ~/.vnc/xstartup
Uncomment these below two lines in the file, then save and exit the file.
exec /etc/X11/xinit/xinitrc

Step5 : Now once again start the vncserver( just execute vncserver command) in user account, so that it will continuously on. When you execute the command it will provide valuable information how to access the server. The clipped output is as follows, here if you see it’s saying to access the GUI you have to give hostname as
[kumar@rp2 ~]$ vncserver
New ‘ (kumar)’ desktop is
Starting applications specified in /home/kumar/.vnc/xstartup
Log file is /home/kumar/.vnc/

Step6 : Now login to Windows machine where VNC viewer is installed and try to access the Linux server.

Some FAQ :
1.What is the port no for VNC server?
Ans :

2.Which are the other tools which will work same as VNC?
Ans :
VNC, TS, Citrix, Reflection etc.

3.What is the significance of rdesktop?
Ans : Rdesktop is an utility to access windows machines from Linux.

Please comment regarding this post:-)