You are not logged in.

#1 2005-04-25 15:47:32

nehsa
Member
Registered: 2003-01-14
Posts: 159

Tunnelling to VNC

Can someone help fill me in on how this works?  Does it actually use port 22?  I'm using putty, I've setup the tunnel from 5902 (client) to 5900 (server) but can't get it to work.

Sorry for the vague question, I'm a little lost on how tunnelling works.

Offline

#2 2005-04-25 16:34:17

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: Tunnelling to VNC

First, you need to set
X11Forwarding yes
in both /etc/ssh/ssh_config and /etc/ssh/sshd_config
There is also a port setting in there you can set it to listen on whatever port you like.  Then restart ssh.

/etc/rc.d/sshd restart

Then in putty...On the session tab, obviously, put in your IP address or dns name if you have one, and port number. 
Then go to the SSH tab and check enable compression or it's gonna be kinda slow.
Then go to the Tunnels tab and check Enable X11 forwarding.  Enter localhost:0 for X display location.
Then down at the bottom, where it says Add new forwarded port...
Enter 5901 for source port.  then for destination port, enter 192.168.xxx.xxx:5901   obviously replacing the ip addy here with whatever your server's ip address is.  Make sure the Local radio button is selected then click Add.  It should put something like this in the bigger white box above.

L5901              192.168.xxx.xxx:5901

Save your configuration because you don't want to have to do all this every time.  Then ssh into your box...Before you can connect to VNC you have to type:

vncserver

Then open your vnc viewer on your windows box....and enter
localhost:1
for the vnc server.  It should then prompt you for vnc session password.  You will have entered that password the first time you start vncserver.

Offline

#3 2005-04-25 18:32:37

nehsa
Member
Registered: 2003-01-14
Posts: 159

Re: Tunnelling to VNC

Awesome, thanks for the quick reply.  When you ""tunnel"" does it then use port 22?  The reason I am trying to tunnel to begin with is that ports 59** are firewalled.

Anyways, assuming thats not the problem now what happens is, after I try connecting to localhost:1 it pops up with "The connection closed unexpectedly".

Offline

#4 2005-04-25 19:06:41

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: Tunnelling to VNC

Hmmm...When you tunnel, it does then use port 22..or whatever port you sepcify in ssh_config and sshd_config. 
Connection Closed unexpectedly huh?  Maybe I missed a step or something.  I wouldn't be surprised since I was going on memory.  Anything jump out at anybody as something that I missed?

Offline

#5 2005-04-26 14:35:36

nehsa
Member
Registered: 2003-01-14
Posts: 159

Re: Tunnelling to VNC

Has anyone noticed anything special needing to be done with VNC?  The regular VNC doesn't work, says: 

vncserver: couldn't find "Xvnc" on your PATH

  The weird thing is, even a locate can't find it.

Tightvnc gets further saying:

Couldn't start Xvnc; trying default font path.
Please set correct fontPath in the vncserver script.

x11vnc says this:

Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
26/04/2005 07:27:54 XOpenDisplay failed (localhost:10.0)

All these errors seem easilly fixible except that I don't know how.. smile[/code]

Offline

#6 2005-04-26 16:33:28

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: Tunnelling to VNC

I knew there was something else!!!
For TightVnc,
edit /usr/bin/vncserver with vi or whatever your favorite editor is...
You will see a line that starts with $fontpath fairly close to the top.
change it to this:

$fontPath ="/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/75dpi";

That'll fix that error.

Offline

#7 2005-04-26 20:32:23

nehsa
Member
Registered: 2003-01-14
Posts: 159

Re: Tunnelling to VNC

Hehe, OK, that error did go away, still same thing though.  I am sure I am hitting my computer because I get that message much quicker if I turn off IPTables.

So I'm pretty sure that it is a problem with VNC still, here is what the logfile says:

xrdb: No such file or directory
xrdb: can't open file '/root/.Xresources'

That have anything to do with it?

Offline

#8 2005-04-26 21:17:50

khazdar
Member
From: ohio
Registered: 2003-11-06
Posts: 123

Re: Tunnelling to VNC

You dont need to enable X11Forwarding for vnc to work over SSH.
i'm sorry, but i re-read thist post a few times and I dont see what the actual problem is. is your vnc connection to localhost:1 not working? are you sure vncserver is running ?

Offline

#9 2005-04-26 21:44:27

nehsa
Member
Registered: 2003-01-14
Posts: 159

Re: Tunnelling to VNC

The problem now is that I get a "The connectin closed unexpectedly" message while attempting to VNC.  I am certain that I am reaching my computer at home because it is affected by IPtables. 

I think that the problem now is that the vncserver is not working correctly.

Xvnc is a running process but I don't know if it is running correctly.

Offline

#10 2005-04-26 23:59:34

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: Tunnelling to VNC

Did you launch vncserver as root?  It sounds like it.  I don't think that's a good idea.  If you did launch it as root, kill it with vncserver -kill :1
Then launch it as your user.  Then ssh in as your user and try it that way.

Offline

#11 2005-04-27 14:40:47

nehsa
Member
Registered: 2003-01-14
Posts: 159

Re: Tunnelling to VNC

I was running from root, same thing with user though.

Offline

#12 2005-04-27 19:13:34

nehsa
Member
Registered: 2003-01-14
Posts: 159

Re: Tunnelling to VNC

UPDATE:
Found this on realvnc.com

A firewall blocking the connection by explicitly closing it.
VNC Server's security is not properly configured.
Ensure that you have selected an authentication method, set a password if required, and generated secure keys for the server if required.
VNC Server is crashing for some reason.
If this is the case, then the VNC Server Service will no longer be "running" on the server machine.

The problem is, I can't rule any of them out.  Is there a simple WM that I can use that should work no matter what.. I'm tried fluxbox and frvm but both have errors in the logfile.

Offline

#13 2005-04-27 23:31:12

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: Tunnelling to VNC

Just so I've got this straight...Do you get that error when you ssh into your box?  Or after you ssh in and try to connect to localhost:1 with vncviewer?

Offline

#14 2005-04-28 20:47:17

nehsa
Member
Registered: 2003-01-14
Posts: 159

Re: Tunnelling to VNC

SSH is fine.  Happens immediately when I try and use VNC.

Offline

#15 2005-04-29 19:01:59

nehsa
Member
Registered: 2003-01-14
Posts: 159

Re: Tunnelling to VNC

Doesn't have anything to do with it assigning the desktop to something other then localhost does it? 

New 'X' desktop is server:1

Also, is there anyway to get it to log more.  I can't find anywhere to increase the logging.

Offline

#16 2005-04-30 00:47:32

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: Tunnelling to VNC

New 'X' desktop is server:1

This is correct.  It's exactly what mine says. 
The only thing I can think of is...replace "localhost" with your actual arch computer name.  I'm not sure if that'll do any good though.  Mine works either way.  Now that mine's working, I can't seem to break it.  Without messing with the settings in putty at least.  I'm not running a firewall though on my arch box as you are.  I have a Slack box that I use for my firewall, router, ftp server, and web server so.....And I only have one port open on it for ssh.  So...I'm kinda at a loss.  Out of ideas even.

Offline

#17 2005-05-13 20:32:49

nehsa
Member
Registered: 2003-01-14
Posts: 159

Re: Tunnelling to VNC

In an attempt to try something different I want to try and get the java based vnc to work, the problem I'm running into is the java classes.  I can't seem to find them anywhere.  Anyone know where they are?

Offline

#18 2005-05-13 20:47:23

nehsa
Member
Registered: 2003-01-14
Posts: 159

Re: Tunnelling to VNC

/home/nehsa/.vnc/xstartup: line 5: vncconfig: command not found
Warning: Failed to open catalog, using default messages.
Failed to load groupfile:
BScreen::BScreen: managing screen 0 using visual 0x22, depth 24
Warning: Failed to open catalog, using default messages.
/root/.fluxbox/menu: Permission denied

It's been awhile since I've had a chance to mess with this so I don't remember exactly what I was doing when I stopped.. this seems odd though, any ideas while it would be trying to run fluxbox as root?  I am running vncserver as a normal users.

Offline

#19 2005-05-25 19:18:37

nehsa
Member
Registered: 2003-01-14
Posts: 159

Re: Tunnelling to VNC

I got this to work.  It was so dumb that I don't want to say what was wrong.

Anyways.. the problem I'm having now is w/ fluxbox.  Every other WM works fine but fluxbox is trying to use

/root/.fluxbox/menu: Permission denied

instead of the menu from my user.  Anyone know how to change this?  I am running vncserver as my user.  I've tried gnome, kde, windowmaker, XMCE, everything works except that.

Offline

#20 2005-05-26 02:36:09

Stinky
Member
From: The Colony, TX
Registered: 2004-05-28
Posts: 187

Re: Tunnelling to VNC

No idea.  I would be very interested to know what was wrong though.  (You can send me a PM if you like)   big_smile

Offline

#21 2006-02-06 06:56:59

Arch
Member
Registered: 2005-11-05
Posts: 37

Re: Tunnelling to VNC

There's a short video tutorial on this on Hak.5 (episode 7.)
http://www.hak5.org/


This signature just crossed the line.

Offline

Board footer

Powered by FluxBB