Results 1 to 2 of 2
Updated 07/09/03 Written by Jason Lambert About this site This site is a free and open place to discuss and get help with linux. Please do Register and visit the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-22-2003 #1
- Join Date
- Apr 2003
- London, UK
Installing & Running VNC on Redhat/RPM Linux
Updated 07/09/03 Written by Jason Lambert
About this site
This site is a free and open place to discuss and get help with linux. Please do Register and visit the forums.
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)
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
Installing from RPM is straightforward enough, simply run the following command:
$ rpm vnc-3.3.6-2.i386.rpm -i
To start VNC server, at the command prompt type:
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.
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 &
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 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 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
keywords: redhat, linux, vnc, tutorial
This content is copyright of the author, it may NOT be reproduced in any form with out the express written permission of the author.
- 12-22-2004 #2
- Join Date
- Dec 2004
VNC on Linux - xstartup commands
Funny that this tread just started as I am changing out my little home NT Network w/Redhat Linux 9.0 using Samba for Windows to access to my music collection.
I previously used VNC Viewer from a Win 2000 machine to control a Win NT Server 4.0 running VNC Server and everything worked great.
When I installed on Redhat Linux, all I got on the viewer end was the command prompt - no graphical display on the VNC Viewer from Windows.
Here are the two lines that did the trick.
in the /root/.vnc/xstartup file.
You will get some error messages in your log file, but all seems to work great.
The first line disables the gnome-session since it thinks you are trying to load two sessions. The 2nd line starts a new session.
The tricky issue here is security. I ran vncserver under root (su) so when you log in on the VNC Viewer you are in a "su" graphical session which for my little world is fine since all of the things I am doing are admin related.
If you are in a non-secure environment, I'd create a new user account and start from there. I've played with that some, but decided it did not matter for me.
As an FYI, I'm a long time Windows person, so I apologize for my lack of "Unix"-ize for lack of a better term.
Hope this helps.