LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Win2003 login remotely to FC4 via VNC (https://www.linuxquestions.org/questions/linux-networking-3/win2003-login-remotely-to-fc4-via-vnc-444445/)

zillah 05-13-2006 11:36 AM

Win2003 login remotely to FC4 via VNC
 
I know that there are heaps threads about this topics , but this what I did without any success



This is what I did on FC4 I am logging as root (I know the security implication)

First:

[root@localhost ~]# rpm -q --info vnc-server

Code:

Name        : vnc-server                Relocations: (not relocatable)

Version    : 4.1.1                            Vendor: Red Hat, Inc.

Release    : 10                            Build Date: Wed 27 Apr 2005 10:44:11 AM GST

Install Date: Wed 15 Feb 2006 11:53:50 PM GST    Build Host: decompose.build.redhat.com

Group    : User Interface/X            Source RPM: vnc-4.1.1-10.src.rpm

Size        : 3054396                        License: GPL

Signature : DSA/SHA1, Fri 20 May 2005 10:28:29 PM GST, Key ID b44269d04f2a6fd2Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>

URL        : http://www.realvnc.com

Summary    : A VNC server.

Description :

The VNC system allows you to access the same desktop from a wide

variety of platforms. This package is a VNC server, allowing others to

access the desktop on your machine.



Second:

The gedit /etc/sysconfig/vncserver

Code:


# The VNCSERVERS variable is a list of display:user pairs.

# Uncomment the lines below to start a VNC server on display :2

# as my 'myusername' (adjust this to your own). You will also

# need to set a VNC password; run 'man vncpasswd' to see how

# to do that.

# DO NOT RUN THIS SERVICE if your local area network is

# untrusted! For a secure way of using VNC, see

# <URL:http://www.uk.research.att.com/vnc/sshvnc.html>.

#zillah uncomment VNCSERVERS="2:myusername"

 

VNCSERVERS="2:root"

#zillah uncomment VNCSERVERARGS[2]="-geometry 800x600"

VNCSERVERARGS[2]="-geometry 800x600"





Third:

[root@localhost ~]# vncpasswd root

Password:

Verify:



Fourth:

[root@localhost ~]# vncserver

New 'localhost.localdomain:2 (root)' desktop is localhost.localdomain:2

Starting applications specified in /root/.vnc/xstartup

Log file is /root/.vnc/localhost.localdomain:2.log

And i run the below command as well

[root@localhost ~]# service vncserver start

Starting VNC server: 2:root A VNC server is already running as :2


Fifth:
http://www.redhat.com/archives/rhl-l.../msg05595.html

Quote:

I am using FC4. The fix for me was that the default iptables (i think

thats the firewall settings) were preventing incoming VNC connections.

To overcome this in gnome i went to Desktop>System Settings>Server Settings>Services There I stopped iptables - and immediately I was able to connect!
I did stop iptables as qoute above suggested.


Sixth:
Code:

http://img273.imageshack.us/img273/8994/vncviewer5vn.jpg
From windows 2003 I opened VNC Viewer and I typed in this :
198.222.168.189:2

The error message that I received when I typed in the ip address for the address is below:

Code:

VNC Viewer: 198.222.168.189:Error
unable to connect to host: The requested address is not valid in its context.(10049)


Note:
1- FC4 box and Win2003 box within the same LAN, the reachability is there (ping each other)


2- From within FC4 I tried : vncviewer 127.0.0.1:2 (same as vncviewer :2 ),,,,,,it worked.

3- I tried to do test by telnet from win2003 :
Telnet 198.222.168.189:5902,,,,failed

4- I tried to http://198.222.168.189:5802,,,,,failed as well.





I tried to configure from GUI method



Desktop - Preferences - Remote Desktop , check the users view and use boxes , uncheck the 'ask you for confirmation' box , set password ,



then - Desktop - Server Settings - Services , tick vncserver box - start - save , (starts at boot up)





Any suggestion ?

Hangdog42 05-13-2006 12:49 PM

The fact that you can connect from within the Fedora box tells you that the server is running and accepting connections. Also, the syntax you used to connect either via a vnc viewer or from your browser are correct. To me, that suggests that something in between is blocking the connections, and I personally suspect the firewall. I know you said that you stopped the firewall, but does that turn off the firewall or does it simply stop all network traffic? Have a look at the output of iptables -L -n and make sure that the firewall is down.

Along related lines, that IP address looks like a real, routable IP address. Do you have a router that this traffic would have to go through?

jiml8 05-13-2006 01:39 PM

On my system, I have had to deal with a bug in vncviewer that prevents me selecting the particular port I want when tunneling over SSH, using the client option for tunneling.

I cannot say that your problem is the same, but it might be similar. The security of VNC sucks anyway so remote accessing via SSH tunneling is a good plan under any circumstances.

Try setting your VNC server to only accept local connections (or, perhaps it is already set that way? Something to check). Then make sure sshd is running.

Once you have done that, set up a batch file on the client like this, invoke the batch file, and it will work:

ssh -f -L 5901:localhost:5900 myserver sleep 20
vncviewer -owncmap localhost:1

zillah 05-14-2006 01:40 AM

Quote:

but does that turn off the firewall or does it simply stop all network traffic? Have a look at the output of iptables -L -n and make sure that the firewall is down.
See the attachment please
Code:

http://img103.imageshack.us/img103/2519/screenshot7eg.jpg

Hangdog42 05-14-2006 07:28 AM

OK, your firewall is definitely off and traffic should flow through without an obstacle.

So that leave the other question, are there any devices like a router between your client machine and the vncserver? And is the vncserver directly connected to the Internet?

zillah 05-14-2006 10:48 AM

Quote:

So that leave the other question, are there any devices like a
router between your client machine and the vncserver? And is the vncserver directly connected to
the Internet?
Since I am doing the test at work, and since both PCs (Server, and client) within the same LAN, there is
only switch between the server and client.

To assure that there is no devices between the client and the server, I unplugged PCs from work's LAN and
connected both PCs directly by using cross over cable.

I assigned private ip address to both PCs (cleint 192.168.1.5 and server 192.168.1.1),still I can not connect

The message that I recieved is this :
Code:

VNC Viewer:192.168.1.1:Error
unable to connect to host:Coniction refused (10061)


Hangdog42 05-14-2006 11:12 AM

This is weird. OK, here is a few ideas:

1) Check /etc/hosts.allow and /etc/hosts.deny on the server to see if there is anything there that might cause an issue.

2) On the server, have a look at the output of lsof -i (run as the vncserver user) to make sure that vnc is actually listening to the ports you think it is.

3) You also might have a look at the client firewall and see if that might be causing trouble.


4) As jiml8 suggested, try establishing an SSH tunnel between the two machines and then see if you can connect to localhost:X from the client.

As a last resort, you might think about ditching VNC for FreeNX. It is a similar concept to VNC, but natively runs over an SSH connection.

zillah 05-25-2006 04:22 PM

Quote:

On my system, I have had to deal with a bug in vncviewer that prevents me selecting the
particular port I want when tunneling over SSH, using the client option for tunneling.
I am using vncviewer from windows box to access the vncserver on the Linux box,,,,
did you mean that in your case there was problem on thr vncviewer on your winodws box ?

Quote:

Try setting your VNC server to only accept local connections (or, perhaps it is already
set that way? Something to check). Then make sure sshd is running.
Could you please post some resource or documentation how to configure ssh client (like putty)
and how to configure vncserver to accept that connection.

Quote:

set up a batch file on the client like this, invoke the batch file, and it will work:
Iam using vncviewer in my case from windows box

zillah 05-28-2006 11:57 PM

1- Shouldn't I be a root to add vnc sessions for each users ?

While I was reading this threat
Quote:

6.VNCSERVER="1:username" (example root). Make a space before the quotes if
you want to add another user and type 2:username, etc.
I get confused how to add more than one users,,,,do I need to do like below ?

VNCSERvERS="2:root"
VNCSERVERARGS[2]="-geometry 800x600"

VNCSERvERS="3:jsmith"
VNCSERVERARGS[3]="-geometry 800x600"

VNCSERvERS="10:jpeter"
VNCSERVERARGS[10]="-geometry 800x600"

Hangdog42 05-29-2006 07:24 AM

Quote:

VNCSERvERS="2:root"
Did you notice that you've got a typo in each of those lines? The lowercase v could be messing things up. The other thing you may need to check is that each of the users probably needs to have run vncserver one so that passwords are set up. Also, if I'm reading the documenation correctly, I think you may need something more along the lines of this:

Code:

VNCSERVERS= "1:root" "2:jsmith" "10:jpeter"
ARGUS="geometry 800x600 -alwaysshared"

Quote:

1- Shouldn't I be a root to add vnc sessions for each users ?
Personally I just let users start their own vncserver sessions, but I don't have many users besides myself. Doing it the way you are, yes, you proabably need to be root.

And just a suggestion, you might want to reconsider running a vncserver session for root. VNC has little security and it would personally make me nervous to have a root session automatically started.

zillah 05-31-2006 12:08 AM

Quote:

Did you notice that you've got a typo in each of those lines? The lowercase v could be messing things up
Yes, because I did copy and paste

Quote:

if I'm reading the documenation correctly, I think you may need something more along the lines of this:
I will try this,,,thanks for that

Quote:

And just a suggestion, you might want to reconsider running a vncserver session for root. VNC has little security and it
would personally make me nervous to have a root session automatically started.
I fotgot to tell you that the problem that I have posted in my early thread, was solved (I have been given an advice from another forum) , by logging not as root,,,,(i.e when I logged as
normal user I have not got any problem)

Hangdog42 05-31-2006 08:30 AM

If the starting line I posted doesn't work, you might try this:

VNCSERVERS= "1:root 2:jsmith 10:jpeter" (note that evertying is in a single set of quotes).

ARGUS="geometry 800x600 -alwaysshared"

I saw someone post this as their example of starting vncservers.


All times are GMT -5. The time now is 03:40 AM.