By using Virtual Network Computing (VNC) , you can display or access the Linux desktop from any Network or Internet. Linux Desktop can be accessed by another Linux
System or Windows System which is on a network or internet. Here letus focus on
Steps to be followed for accessing Linux Desktop from Windows System
We have to establish a VNC connection to a desktop environment (such as KDE or GNOME) on the Linux system
Step 1. Ensure VNC server is installed and running on the Linux system whose desktop you want to access. ( from windows system)
Step 2. Ensure VNC viewer client installed on the system on which you want to display your Linux desktop. (TightVNC)
Step 3. Secure shell (ssh) connection may be established between the Linus & Windows system.
How to Get VNC Server and Client ?
Recent releases of Linux such as Redhat Linux and Fedora Core come with vncserver which is installed automatically. You can also use TightVNC which can be downloaded for free from http://www.tightvnc.com/download.html
Detail of Step 1 :
------------------
How to Start & Stop the the VNC Server in Linux system.
To start the VNC Server , run the command vncserver
when you run the command first time , it will ask password. give password. then You will get the following message if you are a root user:
New 'vkj:3 (root)' desktop is vkj:3
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/vkj:3.log
where vkj is the hostname of the linux machine.
To change the password use the command vncpasswd
The above statement indicates that vncserver has started up an X server as display :3 on system "vkj" and that it has created a sub-directory called .vnc in the /root
directory that started the server containing a startup script xstartup. In addition it creates a log file that can be used to diagnose any problems when the server failed to start.
To stop the VNC server , run the following command:
vncserver -kill :3
where the :3 matches the display that was indicated when vncsever started up. This will display something along the lines of:
Killing Xvnc process ID 9523
Configuring the Desktop Environment to be Launched by VNC. When we start the vncserver it runs the script xstartup which is located in the folder .vnc under /root or /home/username/.vnc for other than root user.
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
To launch the GNOME desktop environment change the twm line in xstartup to:
gnome-session &
Similarly to launch the KDE desptop environment change the line to:
startkde &
Detail of Step 2 :
------------------
Installing the VNC Viewer Client
---------------------------------
Next step is to install the client side VNC viewer on Windows machine. (vncviewer incase of linux) . TightVNC can be used which can be downloaded from
http://www.tightvnc.com/download.html
Detail of Step 3 :
-----------------
Establishing a SSH between the two systems :
Due to security reasons, it is recommended that the VNC communication take place through an encrypted secure tunnel connection. SSH can be used On Linux for secure remote connection. On Windows we can use PuTTY which is freely downloaded from http://www.putty.nl/download.html
By default the VNC server will use the port 59xx for communication where xx represents the display number. If vncserver is running as display :1 then the port being used is 5901. If it running as display :3 then port 5903 is used. Suppose if the VNC is using the port 5903 on a system called "vkj" then can establish an ssh connection as follows:
Windows using PuTTY:
--------------------
1. Start PuTTY, enter the hostname or IP address of the system running VNC server. In our example this is "192.168.79.128" ip address of vkj
2. Set the "SSH" toggle.
3. Select the SSH --> Tunnels option from the tree and enter the following information:
Source port: 5903
Destination: 192.168.79.128:5903 , The click on add button.
4. Save the profile you have entered by selecting "Session" from the Tree, entering name (in our example kk) in the "Saved Sessions" text field and press "Save"
5. Press the "Open" button to establish the secure connection.
You will be prompted for a password for the user under which you are logging in.
( Note : incase of Linux system use the command : ssh -L 5903:localhost:5903 vkj)
Launching the VNC Viewer Client
On Window using TightVNC simply launch the TightVNC viewer and enter localhost:3 into the Connection details dialog and press "OK".
( in case of Linux or UNIX , ou have to give the command : vncviewer localhost:3)
Now You will be prompted for a password. This is the password of vncserver.
Showing posts with label VNC. Show all posts
Showing posts with label VNC. Show all posts
How to Access Linux Desktop from Windows?
Read more...