Go Premium for a chance to win a PS4. Enter to Win


Remote Desktop in Linux Red Hat

Posted on 2004-09-08
Medium Priority
Last Modified: 2013-12-06
I can remotely access the windows xp PC from Linux Red Hat


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

Accepted Solution

xDamox earned 2000 total points
ID: 12007858

In redhat you can setup a vncserver check out:


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:

$  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:

$  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:

$  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:
xrdb $HOME/.Xresources
xsetroot -solid grey
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

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:

[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*             LISTEN
Tcp     0            0*             LISTEN
Tcp     0            0*             LISTEN
[root@server root]#

The 2 lines that have & indicate we have VNC listening for incoming connections on all interfaces ( 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:


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).

Author Comment

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
LVL 16

Expert Comment

ID: 12009875
yea you can use MS Desktop viewer

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

also have a look at the apt get rpm

Author Comment

ID: 12027566

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month10 days, 22 hours left to enroll

885 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