VNC server configuration


VNC Server configuration
Setting up VNC server in RHEL or Fedora.
1.      up2date vnc-server (RHEL) or yum install vnc-server (Fedora) if you don't have it installed.
2.      Edit /etc/sysconfig/vncservers as root.
Uncomment the line:
VNCSERVERS="1:put_the_user_you_will_log_in_as_here"
The server will default to the resolution of the machine, so if you are going to connect to a desktop with a high resolution monitor from a laptop you will want to uncomment and set the following line also:
VNCSERVERARGS[1]="-geometry 1024x768"
3.      chkconfig vncserver on
4.      su to the user that you will be logging in as.
5.      Run vncpasswd and set the password.
6.      Now run vncserver. This will create the needed initialization files.
7.      Edit /home/user/.vnc/xstartup and uncomment the two lines there to get a normal desktop when you log in.
8.      Now kill the Xvnc task and delete the lock files in the .vnc directory
9.      service vncserver start (there might be some other lock files you need to delete; I can't remember now - check any error messages here)
10.      Unfirewall 5901 tcp to allow remote connections
11.      Connect from the remote machine using servername:1
To attach to the session that is running on the monitor of the machine - the session of currently logged in local user, use krfb (on the server) and krdc (on the client) for KDE, and vino for Gnome.
---------------------------------------------------------------------------
I am unable to execute step 7:  Edit /home/user/.vnc/xstartup and uncomment the two lines there to get a normal desktop when you log in.
If I go under /home directory - I do not see any thing their. It is blank.
How will I be able to implement step7. I am totally a windows person and newbie to Linux

=============================

For the newbie (as myself), here is my another 3-minute Linux guide about How to setup VNC server in Red Hat Enterprise Linux?
Though this Linux-VNC guide is tested on Redhat Enterprise Linux 4, it served the general guide of installing VNC in Linux distributions.
Locate the vnc-server-4.0-8.1.rpm package from the Red Hat Linux installation CD or download the latest free version of VNC server from Real VNC.
  
Install the rpm package of VNC server: 
rpm -Uvh vnc-server-4.0-8.1.rpm
  
VNC server is using different set of login authentication than the Linux /etc/passwd. Meaning that, you have to create VNC login password for individual Linux login accounts who are granted remote access with VNC client. 
To create VNC login password, just execute vncpasswd command and enter a valid password twice as usual.
  
Unlike VNC server for Windows, each user account can run more than one VNC servers in Linux. 
To start an instance of VNC server, just execute vncserver command, which will create the $HOME/.vnc directory with VNC default startup scripts inside (if $HOME/.vnc is not currently exists).
  
The vncserver command will startup a VNC server that open 3 next available TCP/IP port, starting from 5801, 5901, and 6001 respectively. 
Port 5801 is for VNC client connection over HTTP protocol, port 5901 is for VNC client connection over RFB protocol, and port 6001 is to allows X applications to connect to the VNC server. The lsof or netstat command will able to show the network port opened by Xvnc server.
By executing vncserver for the second time or execute the vncserver :2 command, this will startup VNC server that bind and listen to port 5802, 5902, and 6002 respectively.
To connect to Linux VNC server over HTTP protocol, just type walkernews.net:5801 (replacewalkernews.net with your VNC server IP/hostname) at any javascripts-enabled web browser, such as Mozilla Firefox, Opera, or Internet Explorer.
To connect to Linux VNC server over RFB protocol, just type walkernews.net:5901 at the VNC client.
  
To kill the VNC server in Linux, just execute vncserver -kill :1 will kill the first VNC server that bind and listen to port 5801, 5901, and 6001. The vncserver -kill :2 will kill the second VNC server, and so on. 
How to get KDE or Gnome Desktop Manager running in Linux VNC server?
Don’t worry, it’s just a 3-seconds Linux trick! Edit the default VNC server startup scripts $HOME/.vnc/xstartup and un-remark the two “critical” lines, as per the scripts suggestion:
#!/bin/sh# Uncomment the following two lines for normal desktop:unset SESSION_MANAGERexec /etc/X11/xinit/xinitrc[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresourcesxsetroot -solid greyvncconfig -iconic &xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &twm &

No comments:

Post a Comment