VNC over SSH..........

Praetor

Diamond Member
Oct 14, 1999
4,498
4
81
I've been working on this problem with my secondary computer/server for the past few days.

Running Gentoo 2.6.8 and Xorg 6.8.0, tightvnc 1.3a5, and openssh on a headless box and WinXP with Putty and Ultr@VNC

I can ssh into the box perfectly fine from both the intranet and internet. I've been trying to get VNC setup on this box so I can use a gui interface remotely when I'm on the road or just for giggles.

I've been reading a guide for running a regular vnc server and trying to adapt some of the pointers there so I can do this over ssh. So far, I haven't had any luck at all.

I've got Putty set to forward the proper ports (on linux, 1200x1024x24 tcp 5973) over ssh, Ultr@VNC is set to search for a terminal on localhost using that port. From what I've read, this should be correct. When I logon via ssh and do a "startx", it goes through the usual routine of parsing the xorg.conf, but it doesn't look any different from what it did when I had a monitor and keyboard attatched. Loading Ultr@VNC after I've done this gets me a "Failed to connect to server!" error.

Has anybody tried anything similar that could help me out? Or should I ask in Operating Systems or Software forums?
 

gaidin123

Senior member
May 5, 2000
962
1
0
I have followed that exact guide twice in the past and eventually have been able to make it work. Neither time went perfectly for some reason. I remember reading through that entire thread which is very long since there are useful tidbits of info from other people who had problems.

You should be SSHing into the box and then running a vnc client connecting to 127.0.0.1:73. I found with UltraVNC that you don't need to specify the full port in the 59xx range for some reason. Also, you should not be running startx from the SSH command line. If you implement that guide correctly what will happen is that when you vnc into the box it will automatically launch the kdm/gdm window manager and give you a normal login prompt in KDE or Gnome or whatever you set it up with.

Gaidin
 

Praetor

Diamond Member
Oct 14, 1999
4,498
4
81
So I do need to start gdm then? Here's the process if I'm understanding this right, correct me if I'm wrong:

SSH into box using putty (Connection | SSH | Tunnels : Source port 5973, destination linuxbox:5973, remote)
Login to linux box
Get command prompt.
Start Ultr@VNC with server being localhost:73.
Get GDM login screen and login again.
Have fun.


Is this correct? I haven't been using gdm at all, but it has been the missing link?
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Make sure VNC is running, and is binding to the correct port (localhost:5973 I guess). SSH in using the forwarding to port 5973 from a local port (> 1024). Start the VNC client, and direct it to localhost:local_port.

EDIT: To check and make sure the vnc server is attaching to the correct port: netstat -an | grep 5973
 

gaidin123

Senior member
May 5, 2000
962
1
0
The SSH connection is solely used for tunneling the vnc connection. You do not need to run a single command once you get the ssh tunnel up and running. If all the config files are correct when you hit port 5973 or one of the others you added into the xinetd.d/xvncserver file it automatically runs Xvnc with the various resolutions and color depths you specify for that port. That will then spawn your window manager of choice which I believe you determine in the /etc/rc.conf.

I use KDE on the one box I currently have this running on and the kdmrc file needs XDMCP enabled on port 177. That is one of those gotchas that you really need to pay attention to whenever KDE gets updated but yeah just make sure it's configured correctly for now as well as the other files.

Gaidin
 

gaidin123

Senior member
May 5, 2000
962
1
0
Originally posted by: n0cmonkey
Make sure VNC is running, and is binding to the correct port (localhost:5973 I guess). SSH in using the forwarding to port 5973 from a local port (> 1024). Start the VNC client, and direct it to localhost:local_port.

n0c, I think in this case the vnc server spawns dynamically through xinetd when the client hits it on a certain port. That's what makes this thing cool since it really acts like a terminal server only allocating resources on demand.

If he has all the config files copy/pasted like in that tutorial vnc should be spawning on the correct ports.

Gaidin
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: gaidin123
Originally posted by: n0cmonkey
Make sure VNC is running, and is binding to the correct port (localhost:5973 I guess). SSH in using the forwarding to port 5973 from a local port (> 1024). Start the VNC client, and direct it to localhost:local_port.

n0c, I think in this case the vnc server spawns dynamically through xinetd when the client hits it on a certain port. That's what makes this thing cool since it really acts like a terminal server only allocating resources on demand.

If he has all the config files copy/pasted like in that tutorial vnc should be spawning on the correct ports.

Gaidin

Ok, didn't know that. But xinetd (ugh) should be listening on the configured port, so I don't think my post was far off. ;)
 

Praetor

Diamond Member
Oct 14, 1999
4,498
4
81
Well, I did copy/paste in the services and xvncserver config exactly. Went through and edited the gdm.conf manually (since I obviously can't login to the gnome and use the gui tool), the services have been restarted countless times, even went as far as to restart the machine.

Netstat shows that putty is indeed listening on the correct port (just 5973 in this case, 1280x1024x24). I've made progress now though, Ultravnc is now giving me a dsm plugin error. So I guess I go from there, with the assumption that everthing on the gentoo box is configured correctly?

Let me clarify the error that I'm getting from ultravnc.

"Connection failed -Error reading Protocol Version

Possible causes:

- You've forgotten to select a DSMPlugin and the Server uses a DSMPlugin (nope)
- Viewer and Server are not compatible (they use different RFB protocoles (spelling error)
- Bad connect (I can ssh in fine?)

I've tried using the TightVNC binary on windows. When I run their viewer though, it goes from the server selection window and then drops out.
 

Praetor

Diamond Member
Oct 14, 1999
4,498
4
81
Further trials reveal that I can't even use an unecrypted vnc session to my gentoo box. This is all on the local network, so firewalls, portforwarding, and the like should not be an issues...
 

alienb

Golden Member
Jul 23, 2004
1,947
3
81
Hey dude, I have this problem all the time, The fix is simple (for me)

I type "192.168.1.1:0" or "192.168.1.1:1"

Give ":x" a try, VNC is kind of retarded, even though :0 is using the default port, it doesnt seem to understand that when connecting to linux boxes.
 

Praetor

Diamond Member
Oct 14, 1999
4,498
4
81
Tried that too, though I should have been more clear when I said "...can't even use an unencrypted session to my gentoo box." Just to make sure I wasn't going crazy, I moved the box back to my monitor and hooked it up and booted with Knoppix and tried out its vnc server. Works perfectly fine. So it has to be something I'm doing wrong in following those instructions. Maybe I'll finally register as a user over there and bug them. :p