Solved

Remote Desktop in Linux Red Hat

Posted on 2004-09-08
4
1,126 Views
Last Modified: 2013-12-06
I can remotely access the windows xp PC from Linux Red Hat

rdp:/$hostname$

I wanted to see if there is any way I can remote in this Red Hat linux from the windows xp PC
0
Comment
Question by:jibranilyas
  • 2
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
xDamox earned 500 total points
ID: 12007858
Hi,

In redhat you can setup a vncserver check out:

http://www.prosig.com/protor/kbase/vnc-install.html


What is VNC? - A practical introduction
VNC stands for Virtual Network Computing. It is, in essence, a remote display system which allows you to view a computing 'desktop' environment not only on the machine where it is running, but from anywhere on the Internet and from a wide variety of machine architectures.

The VNC system allows you to access the same desktop from a wide variety of platforms.

Many of us, for example, use a VNC viewer running on a PC on our desks to display our Unix environments, which are running on a large server in the machine room downstairs.
(What is VNC? A practical introduction - taken from http://www.uk.research.att.com/vnc/ all rights reserved)


Obtaining VNC
VNC is freely available from the official VNC homepage: http://www.uk.research.att.com/vnc/ the version we will cover in this tutorial is RealVNC version 3.3.6, which can be downloaded from http://www.realvnc.com/download.html

If you prefer to use the command line as opposed to a GUI for installation, run the following command from your Linux CLI. When run, this command will download the RPM package to your current working directory. The file is 700k approx:

Code:
$  wget http://www.realvnc.com/dist/vnc-3.3.6-2.i386.rpm




The Installation
Installing from RPM is straightforward enough, simply run the following command:

Code:
$  rpm vnc-3.3.6-2.i386.rpm -i


Now you have the core VNC files installed on your system. The first time you run VNC server, you be required to set a password. Remember that it is good practice to choose a password that is not in the dictionary, contains a combination of numbers, letters, and other characters.

To start VNC server, at the command prompt type:

Code:
$  vncserver


If you wish to change the VNC password at any time, enter vncpasswd at the command prompt. The VNC password is not integrated with the standard Linux passwords (any thing inside /etc/passwd), so changing the VNC password will leave all other passwords on the system intact. That also applies the other way round; changing the password on a user account will not affect the VNC password.


You will need to edit the configuration script found in $home/.vnc/xstartup. Any standard text file editor such as vim, emacs or pico will suffice.

For Gnome:
Code:
xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &


For KDE
Code:
xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
startkde &

The key line in the sample file above is the last one, which in this case is set to twm. This controls which window manager you wish VNC to use. By default, Redhat systems use gnome, but you may be using kde. The twm should only be used if you do not have a window manager setup on your system. If you are using kde, you should change twm to startkde and if you are using gnome, you should change it to gnome-session.

You should also understand how to kill existing desktops, shutting VNC down. To do this, you should type vncserver -kill :1 at the CLI, where 1 is the desktop you wish to kill off.

That's it. VNC should now be successfully setup on your system. The last piece of information you need is the ports VNC uses. For the VNC viewer, 5901 is used by default, and for java based VNC access, 5801 is used. You will need to add rules to your firewall to allow traffic into either or both of these port numbers.



Check If VNC is running
You can check at anytime to see if you have a VNC server currently running. To do so, I recommend that you use netstat a tool designed to give you information about what ports are listening for connections on your machine. The following output is an example of what you can expect to see from a netstat command. The important part of this output is highlighted in bold:
Code:

[root@server root]# netstat -an | more
Active Internet connections (servers and established)
Proto   Recv-Q   Send-Q   Local Address   Foreign Address  State
Tcp     0            0     0.0.0.0:22     0.0.0.0:*             LISTEN
Tcp     0            0     0.0.0.0:5801   0.0.0.0:*             LISTEN
Tcp     0            0     0.0.0.0:5901   0.0.0.0:*             LISTEN
[root@server root]#


The 2 lines that have 0.0.0.0:5801 & 0.0.0.0:5901 indicate we have VNC listening for incoming connections on all interfaces (0.0.0.0). If you find that you cannot connect to VNC, I would recommend that you check it is running. If you see that VNC is running from a netstat command, then I would check your firewall is not blocking your connection attempts.


The VNC Viewer
From within you X desktop, you will have access to a VNC viewer, which you may use to remotely control other machines. To access this, open a command terminal, and type in vncviewer. You will be prompted for an IP address to connect to. Enter this, and click ok. You should now have remote control of another PC.


Troubleshooting VNC installations
For troubleshooting, remember that most answers can be found lurking inside your favourite search engine. As the first port of call, I would recommend that you see the following URL:
http://www.uk.research.att.com/vnc/faq.html you can post any VNC questions at www.linuxforums.org

If you have Redhat your firewall in the GUI may always appear to be on, even when its not.

Drop to a command prompt, and run: "iptables -L". If the firewall is really off, then you should see:

Code:

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


When using Winvnc to vnc (linux) remember when connecting with the vnc client to use x.x.x.x:1, where x.x.x.x is the ipaddress. The ":1" is important, as it tells the VNC client the server is listening on tcp/5901 as opposed to 5900 (default on windows).
0
 

Author Comment

by:jibranilyas
ID: 12008055
root@localhost jibran]# rpm vnc-3.3.6-2.i386.rpm -i
error: Failed dependencies:
        libstdc++-libc6.2-2.so.3 is needed by vnc-3.3.6-2

i get this error

i have the rpm file in folder  /jibran


One quick question, after installing and following the instructions,... can i access this linux pc with REMOTE DESKTOP..
I went to the download site and i saw the package for windows
x86 Win32
full installation (server and viewer)

Please tell me if that is needed on the windows machine
0
 
LVL 16

Expert Comment

by:xDamox
ID: 12009875
yea you can use MS Desktop viewer

goto: http://freshrpms.net/ <-- redhats rpms

also have a look at the apt get rpm
0
 

Author Comment

by:jibranilyas
ID: 12027566
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now