LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-07-2005, 10:10 AM   #1
krayz1e
Member
 
Registered: Aug 2004
Location: Sydney
Distribution: FC3
Posts: 39

Rep: Reputation: 15
vnc port forwarding


im not sure which ports i should be forwarding to my box so that i can connect remotely 2 my desktop through my adsl router

i have the following options

ID Public Port - Start Public Port - End Private Port Port Type Host IP Address
1 ??? ???? ????? udp/tcp 192.168.1.3


any ideas guys??
 
Old 07-07-2005, 10:22 AM   #2
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
You should have tried google, or all of the VNC documentation. VNC uses 5900 or 5901 on linux, 5800 for the java browser.

Peace,
JimBass
 
Old 07-07-2005, 10:27 AM   #3
krayz1e
Member
 
Registered: Aug 2004
Location: Sydney
Distribution: FC3
Posts: 39

Original Poster
Rep: Reputation: 15
so i have 2 open all 3 ports just 2 connect 2 my computer?
 
Old 07-07-2005, 10:37 AM   #4
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
Depends on how you connect. If you just use the vncviewer, then all you need to open is 5901. If you configured VNCserver it could be 5900, and if you connect through a browser it is 5800. 5901 is usually the correct one for a linux box.

Peace,
JimBass
 
Old 07-07-2005, 11:31 AM   #5
Xzanron
LQ Newbie
 
Registered: Dec 2004
Location: London, UK
Distribution: Mandriva 2005 LE
Posts: 11

Rep: Reputation: 0
Not quite correct...

VNC uses 5900+d

where d is the desktop.

So if your vncserver is running desktop 1 tehn you need 5901. If it's desktop 2 then 5902 etc. Therefore if you have more than one VNC session running (e.g. different users) then you'll need to forward more ports.
 
Old 07-07-2005, 10:12 PM   #6
krayz1e
Member
 
Registered: Aug 2004
Location: Sydney
Distribution: FC3
Posts: 39

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by Xzanron
Not quite correct...

VNC uses 5900+d

where d is the desktop.

So if your vncserver is running desktop 1 tehn you need 5901. If it's desktop 2 then 5902 etc. Therefore if you have more than one VNC session running (e.g. different users) then you'll need to forward more ports.

ohhh i get ya now... thanks ill give it a try


but how do i know if it is running desktop 1 or 2

Last edited by krayz1e; 07-07-2005 at 10:25 PM.
 
Old 07-08-2005, 05:10 AM   #7
Xzanron
LQ Newbie
 
Registered: Dec 2004
Location: London, UK
Distribution: Mandriva 2005 LE
Posts: 11

Rep: Reputation: 0
Not sure...

I only activate my vncserver when i need it.

That is i ssh into my box, run vncserver and that command tells me the desktop number of the new session.

Since i only vnc from windows, i use the port forwarding in putty (ssh client) and hence have a secure VNC session.

Code:
 
[martin@*** ~]$ vncserver

New 'X' desktop is ***.net:2

Starting applications specified in /home/martin/.vnc/xstartup
Log file is /home/martin/.vnc/****.net:2.log
Above the :2 indicates display 2, hence port 5902

I'm not sure how to determine it for already running vnc sessions. sorry.

Last edited by Xzanron; 07-08-2005 at 05:13 AM.
 
Old 07-08-2005, 05:16 AM   #8
Xzanron
LQ Newbie
 
Registered: Dec 2004
Location: London, UK
Distribution: Mandriva 2005 LE
Posts: 11

Rep: Reputation: 0
When you are done with a vnc session you can get rid of it using:

Code:
vncserver -kill :2
where :2 is the desktop number

I usually log out of the desktop before doing this (i.e. close gnome, or kde or whatever)
 
Old 07-08-2005, 11:53 PM   #9
krayz1e
Member
 
Registered: Aug 2004
Location: Sydney
Distribution: FC3
Posts: 39

Original Poster
Rep: Reputation: 15
thanks guys

the port was 5901

when i was tryin 2 access it remotely i was just puttin in my wan ip and not as a socket
i.e wanip:5901

when i put that in the viewer it ran beautifully

thanks for your help guys
 
Old 08-14-2005, 05:46 PM   #10
cfamsler
LQ Newbie
 
Registered: Sep 2004
Posts: 3
Blog Entries: 5

Rep: Reputation: 0
Not sure if this will help..

We recently started using SuSE - sles 9 and they have set up VNC as a xinetd service. It is tied to the user nobody, and will host lots of different users all on port 5900. I think I read a post on linuxmagazines web site on setting it up this way as well. We can only access port 5900 through our firewall, so this helped me bunches.

It works great, only downside, is that the session only lasts while connected. You can still start individual vnc servers if you need persistent connections.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 08:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 01:08 PM
forwarding ssh->vnc through 1 computer disorderly Linux - General 1 10-06-2005 03:43 PM
VNC desktop forwarding on :0 ??? nicedreams Linux - Software 4 06-01-2005 03:39 AM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 11:37 AM


All times are GMT -5. The time now is 07:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration