How to configure VNCSERVER


How to configure VNCSERVER

 
Configuring VNC Server Access on a Redhat Linux5.8

I will show how to configure VNC server on Red Hat server and using VNC Viewer connect the server remotely from Windows XP.

1. Introduction

VNC allows you to open a remote GUI session to your
server and thus providing you with a full graphical
interface accessible from any remote location.

VNC allows you to open a remote GUI session to your
server and thus providing you with a full graphical interface accessible from any remote location.


2. Configure steps:-

Edit /etc/sysconfig/vncservers, and add the following to the end of the file.Hear my port=4
VNC User=root
save it.


[root]# vi /etc/sysconfig/vncservers


# VNCSERVERS="2:myusername"
# VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -nohttpd -localhost"


VNCSERVERS="4:root"
VNCSERVERARGS[4]="-geometry 1600x1200"

or

If you want multiple VNC session than you can use below lines add /etc/sysconfig/vncservers file.

VNCSERVERARGS[1]="-geometry 640x480" VNCSERVERARGS[2]="-geometry 640x480" VNCSERVERARGS[3]="-geometry 800x600"

3. Reset VNC User password.

Use below command-

[root]# vncpasswd
Password: XXXXX
Verify: XXXXX

This password you can use connection time.


4. firewall setting

If you have firewall enable on Red Hat, be sure that your firewall configuration won’t block connection from remote computer by open port TCP 5901 for remote access. Open Applications -> System Settings -> Security Level. Add ’5901:tcp’ on Other ports.
Note: VNC uses TCP protocol on port 5901.




5. start the vncserver.

[root]#
service vncserver start
[root]#
service vncserver stop

[root]#

service vncserver status


service vncserver restart

Now you can connect Red Hat server from remote computer. On my Windows XP computer, open VNC Viewer on Windows XP, type IP Address of Red Hat server with number as a username specify. In this example, I want to remote to Red Hat server as ‘root’ user which I assign as number 2 in step 2 and my Red Hat server is 10.110.141.220. So I type ’10.110.141.220:1′.
Note: You can download VNC Viewer for free at Download VNC® Viewer

Type your password for ‘root’ user which has been assign in step 3.
 


Now you have connect to Red Hat server remotely. But you’ll see that the interface looks different. You have to do a little thing more.




6. If You want to execs Server Desktop Than do next steps.

On Red Hat server, open terminal and type ‘vi /home/username/.vnc/xstartup’.

In this example,
I type ‘vi /home/admin/.vnc/xstartup’.


Note: If you going to enable remote access for user ‘root’, the file would be at ‘/root/.vnc/xstartup’.

[root@sujeet ~]# vi /root/.vnc/xstartup

UN-commit below 2 lines after that save it.

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

7. Restart VNCSERVER

[root@sujeet ~]# service vncserver restart

Shutting down VNC server: 4:root [ OK ]
Starting VNC server: 4:root
New 'sonu.oracle.com:4 (root)' desktop is sujeet.oracle.com:4

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/chintels.chintels.com:4.log [ OK ]

8. Now you can connect Red Hat server from remote computer. On my Windows XP computer, open VNC Viewer on Windows XP, type IP Address of Red Hat server with number as a username specify. In this example, I want to remote to Red Hat server as ‘root’ user which I assign as number 2 in step 2 and my Red Hat server is 10.110.141.220. So I type ’10.110.141.220:1′.

Note: You can download VNC Viewer for free at Download VNC® Viewer


Type your password for ‘root’ user which has been assign in step 3.




Find vnc processes id.
[root]# ps -ef | grep vnc | grep root

No comments:

Post a Comment