1835552 Members
3126 Online
110078 Solutions
New Discussion

Setting up VNC

 
Frederick Maulion
Occasional Advisor

Setting up VNC

How do you set-up VNC server on Linux? Sorry, I am really new at this so please bear with me. (I will respond in kind with points) Thanks.
6 REPLIES 6
Mark Fenton
Esteemed Contributor

Re: Setting up VNC

Actually, it's really quite simple. Obtain the source or binary packages for the architecture you want from:
http://www.uk.research.att.com/vnc/index.html

If you are compiling source code, do so from the recommended directory as a non-root user and install as root.

The binaries come with RedHat distributions now, so you may already have them.
To start the server, enter

/vncserver :

Be aware that whichever user runs this command, that's the desktop that will be displayed for the one connecting to the session.

To change the desktop settings, checkout /usr/share/apps/switchdesk/Xclients. --or whereever your distribution has these things located.

This should get you started.
Marco Paganini
Respected Contributor

Re: Setting up VNC

Hello Frederick,

VNC is composed of two parts: The server and the client. I'm assuming here you want to install both, so, let's go:

1) Download VNC from http://www.uk.research.att.com/vnc/download.html. You can download the 'binary' version for your operating system to make your life easier. I'll assume you're downloading the Linux version. Choose the 'tar.gz' version.

2) Install VNC. That's a very easy step since you downloaded the binary package. Just login as root and type:

cd /usr/local

tar zxvf the_vnc_tar_file_you_downloaded.tar.gz

You should have now a subdirectory under /usr/local (something like vnc_x86_linux_20)

3) Under this directory you will find both the server the the client. You'll want to start the server first. Locate the 'vncserver' file and run it with something like:

cd /usr/local/vnc_x86_linux_20
./vncserver :5

(You may omit the :5. This is just an arbitrary X display number. Remember that if you already have a X display running on that machine, it'll probably be 0, so avoid :0)

4) It's time to test now your vncserver. Try (from that directory):

./vncviewer localhost

This should open a window with your Xvnc server on it.

Later, you may want to start your vncserver automatically and assign a password.

PS: I'm typing these instructions in the absence of my Linux box to verify the correct operation. Details may be missing. Anyway, I believe it will give you an idea to keep going in the right direction.

Regards,
Paga
Keeping alive, until I die.
Frederick Maulion
Occasional Advisor

Re: Setting up VNC

I already did the deed as you suggested. But the Linux box won't even connect to itself, let alone allow an external PC (Win95) to connect to it.

Here was the message displayed after I typed in:

/vncviewer localhost
vncviewer:ConnectToTcpAddr: connect: Connection refused
Unable to connect to VNC server

Help!!!
Marco Paganini
Respected Contributor

Re: Setting up VNC

Hello Frederick!

Did you start your vncserver correctly? vncserver *needs* Xvnc on its path or else it won't work.

Login as root and try:
(I'm supposing you installed vnc on /usr/local/vnc_x86_linux_2.0)

export PATH=$PATH:/usr/local/vnc_x86_linux_2.0
cd /usr/local/vnc_x86_linux_2.0
./vncserver

Make sure you see no error messages. After that, do

ps -ef | grep -i xvnc

and make sure Xvnc is running.

Try ./vncviewer 127.0.0.1 and let me know what happens.

Regards,
Paga

Keeping alive, until I die.
Frederick Maulion
Occasional Advisor

Re: Setting up VNC

Tried as you suggested. Xvnc is running. ./vncserver went without a hitch. But
./vncviewer 127.0.0.1 still generated an error of "vncviewerUnable to connect to VNC server".

Frederick
Marco Paganini
Respected Contributor

Re: Setting up VNC

Hello Frederick:


One point: Try to start vncserver in the same way as described above, but using the same user that started the current X environment (not root). Also, VNCserver writes a log to your ~/.vnc. Take a look there and send me anything you find relevant.

Regards,
Paga
Keeping alive, until I die.