Friday, August 21, 2009

Enable remote desktop on LINUX system using VNC

set up required for enabling the remote desktop on LINUX machine using VNC

NOTE1: Enter all commands without the double quotes (")
NOTE2: if you encounter an error saying "command not found", just enter the full path of the executable and you should be fine.
NOTE3: Use your roor login for the entire set up

1. Open terminal and type "vncpasswd". It prompts for your password and also prompts for the password verification again. This ensures the password set up for the remote access for the current use.

2. Login as root using "su root"

3. Open the file /etc/sysconfig/vncservers. File can be opened in two ways:
a. "vi /etc/sysconfig/vncservers" OR
b. "gedit /etc/sysconfig/vncservers"

4. Look for the line that starts with # VNCSERVERS="1:myusername"
5. Uncomment the line (remove the #). This ensures the enabling of remote access to the user "myusername". If you want to enable more users for remote access, you can just have it something like "1:user1 2:user2 3:user3..."
6. save the file.
7. Now, you have to enable the VNC server on your machine using the command: "chkconfig vncserver on"
8. Start the VNC server using the command: "service vncserver start"
note: if the server is already running, you can restart using the command "server vncserver restart"
9. Now the set up is finished for the remote access. Make sure your firewall settings are in compliance to remote access.
Open Application => System Setting => Security level. and add "5901:tcp" to the other ports.
OR
Open system => administration => security and firewall and add "5901:tcp" to the other ports.

With this, installtion on LINUX machine is complted for enabling the remote access.

Set up to do in Windows machine:
1. Download VNC viewer at www.realvnc.com and install the same
2. Open vnc viewer, and it prompts for the server address:
enter ur server address the Server text box as "ipaddress:1" (xxx.xxx.xxx.xxx:1) here 1 is the number before username as shown in step4. You need to use the number that exists in that line of the vncservers file and click ok.
3. enter the password that you choose in step1.

With all this set up, You Are Ready to Access Your Redhat Linux machine from Windows machine.

After connecting to the redhat server, if the interface looks different, you just have to something more to get the real interface accessible through remote connection.
1. In your linux machine, open terminal and type "gedit /home/username/.vnc/xstartup"
2. uncomment (remove #) the two lines that starts with "unset" and "exec"
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
and save the file.
3. restart vncserver using the command "service vncserver restart" to apply changes
4. Now, reconnect using VNC viewer from windows machine and everything is ready to use on the Linux machine.

No comments:

Post a Comment

È