Author Topic: VNC Server  (Read 5771 times)

0 Members and 1 Guest are viewing this topic.

Offline KiWi

  • Newbie
  • *
  • Posts: 8
  • I haven't visited my profile!
    • View Profile
VNC Server
« on: January 22, 2005, 12:55:34 am »
I need help running a VNC server on linux.  Trying to connect from a Windows machine (if it helps any, this is all behiend a router).

I start up the VNC server, and everything seems to be fine, but it fails to connect :/

Yes, I am unexpierenced linux user, and
no, I don't know what I'm doing.

Any help would be appreciated... or alternative remote desktop connections?

Offline Quik

  • Webmaster Guy
  • x86
  • Hero Member
  • *****
  • Posts: 3262
  • \x51 \x75 \x69 \x6B \x5B \x78 \x38 \x36 \x5D
    • View Profile
Re: VNC Server
« Reply #1 on: January 22, 2005, 01:50:39 am »
You need to forward a port on your router. If you're connecting to the Windows machine, have them open up a port (I suggest 5995) and then give them your IP. Have them connect you to them. iago and I have done it, myself on WinXP and him on Linux. When he sees this thread, he'll explain in-depth.
Quote
[20:21:13] xar: i was just thinking about the time iago came over here and we made this huge bomb and light up the sky for 6 min
[20:21:15] xar: that was funny

Offline KiWi

  • Newbie
  • *
  • Posts: 8
  • I haven't visited my profile!
    • View Profile
Re: VNC Server
« Reply #2 on: January 22, 2005, 03:37:17 am »
Well, both computers are behiend the same router (sorry I didn't mention earlier), so I don't think I'll need to forward/open any ports.
[So this would all be LAN]

Another thing I thought I might mention, I'm able to connect to the Windows VNC Server, but not vice versa.  Also, I'm positive the VNC Server is running correctly on the Linux machine, but the Windows Client doesn't seem to be able to connect to it.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: VNC Server
« Reply #3 on: January 22, 2005, 11:32:13 am »
Since VNC on Linux uses an X server, it has to be independant of the one you're logged in as.  So if u're logged in as :0, VNC will use :1.  That means that when you connect through vnc, you have to specify 192.168.1.101:1 on vnc, to make it use the second X session.  When vncserver loads on Linux, it'll tell you which one it's running as:
Quote
iago@Slayer:~$ vncserver
New 'Slayer:1 (iago)' desktop is Slayer:1

Starting applications specified in /usr/local/home/iago/.vnc/xstartup
Log file is /usr/local/home/iago/.vnc/Slayer:1.log

The :1 tells you it's running on port 5901, and using display :1.

If that's not your problem, try these two things:
1) Get a portscanner (nmap -- www.insecure.org) and scan the vnc computer from the other computer.  Make sure it sees the appropriate port as open (5900 or 5901).  If you're seeing that as open, then..

2) Load up a packet sniffer, like ethereal or tcpdump.  Then try to connect with vnc, and see what happens.  Then you'll see if it's going for the wrong port or whatever.


Hope that helps.

Offline KiWi

  • Newbie
  • *
  • Posts: 8
  • I haven't visited my profile!
    • View Profile
Re: VNC Server
« Reply #4 on: January 22, 2005, 01:30:11 pm »
For nmap, would: nmap -p 5900-5901 192.168.123.87
be the correct command?  If so, I get a message saying:


nmap -p 5900-5901 192.168.123.87

Starting nmap 3.75 ( http://www.insecure.org/nmap ) at 2005-01-22 11:21 US Mount
ain Standard Time
Note: Host seems down. If it is really up, but blocking our ping probes, try -P0

Nmap run completed -- 1 IP address (0 hosts up) scanned in 4.141 seconds


Didn't think I need to try step two at that point...

The following is what I get when I start up VNCServer

[root@sm1le ~]# vncserver

New 'sm1le.localdomain:13 (root)' desktop is sm1le.localdomain:13

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/sm1le.localdomain:13.log

[root@sm1le ~]#


And this is my log file for VNCServer:

Sat Jan 22 11:25:09 2005
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on port 5913
 vncext:      Listening for HTTP connections on port 5813
 vncext:      created VNC server for screen 0
error opening security policy file /usr/X11R6/lib/X11/xserver/SecurityPolicy
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!

« Last Edit: January 22, 2005, 01:32:13 pm by KiWi »

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: VNC Server
« Reply #5 on: January 22, 2005, 05:37:25 pm »
Ok, it's started on :13.  So on your vnc server, specify :13. 

And if you get that error on nmap, it means the computer isn't responding to pings and you shoudl specify the -P0 flag.

Offline KiWi

  • Newbie
  • *
  • Posts: 8
  • I haven't visited my profile!
    • View Profile
Re: VNC Server
« Reply #6 on: January 22, 2005, 05:39:57 pm »
What... what exactly do you mean by "specify: 13"? on the VNC Server?

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: VNC Server
« Reply #7 on: January 22, 2005, 06:48:40 pm »
I mentioned it in my first post.  Because it says it's starting vnc on "sm1le.localdomain:13", it's running on the 13th port.  To tell vncviewer that, you want to tell it to connect to 192.168.123.87:13

Offline KiWi

  • Newbie
  • *
  • Posts: 8
  • I haven't visited my profile!
    • View Profile
Re: VNC Server
« Reply #8 on: January 22, 2005, 07:16:30 pm »
Sorry about that, didn't quite understand it when you first posted it.

Anyways, when I telling VNCViewer to connect to 192.168.123.87:13, I get an error message saying the following:
unable to connect to host: A socket operation was attempted to an unreachable host. (10065)

:/  Same problem as before.

Offline iago

  • Leader
  • Administrator
  • Hero Member
  • *****
  • Posts: 17914
  • Fnord.
    • View Profile
    • SkullSecurity
Re: VNC Server
« Reply #9 on: January 23, 2005, 12:30:27 am »
Hmm..

with your VNCServer running, nmap the server:
nmap -P0 -p 5800-6000 <ip>

See what port it's running on.

Offline KiWi

  • Newbie
  • *
  • Posts: 8
  • I haven't visited my profile!
    • View Profile
Re: VNC Server
« Reply #10 on: February 01, 2005, 09:38:26 am »
Sorry the delayed reply, I've been pretty busy lately.

Anyways, not sure, but after just a tons of screwing around, it just randomly worked >_<'

Thanks for the help.