On 7/20/05, david rankin <drankin@cox-internet.com> wrote:
Mates,
I hadn't played with tightVNC until now, opting to do all remote administration via ssh. After going through the learning process, I got to say "it's pretty cool." Now mind you, I still prefer ssh and the CLI from a speed standpoint, but if you want your whole desktop in front of you, VNC is the way to go. It's really not that bad on speed either.
Now for what it is worth here is the lowdown:
First, I wanted to get my local Suse 9.0 headless server's kde display up on my Win XP laptop. My server is named 'skyline'. Didn't seem like a tough thing to do. And it really wasn't. The steps were:
(1) make sure you have vncserver installed;
then start the server for the first time to set passwords and create initial config files
(2) skyline:~> vncserver -geometry 1024x768 -depth 16 :1 (this creates the initial ~/.vnc/xstartup file and sets the password)
kill the server and set the default display manager to kde or your preferred manager
(3) vncserver -kill :1 (4) the default display manager is twm, so you need to edit ~/.vnc/xstartup and replace 'twm' with 'startkde'. Interestingly on mandriva, you get kde as default.
now just restart the server
(5) skyline:~> vncserver -geometry 1024x768 -depth 16 :1
next, go get a windows based vnc viewer (Realvnc or tightvnc will both work)
(6) start realvnc, enter 'host:display' or 'host::port' in the box ( 'skyline:1' in my case), you will be prompted for the password, and you are done! If your not prompted for a password, revisit 1-5 above, try killing vncserver, and check with ps ax for any stray X process, kill them, restart vncserver again and try again.
Now for the fun. At home I had basically a direct connection to the vnc connection. I wanted to try and tunnel this over ssh to the 3 linux boxes at work and get their displays up as well. At work, the router forwards ssh to 'nemesis' an old mdk 7.2 box (no X) from which I can then get to 'bonza' a mandriva 2005LE box and 'rankin-xp' a Suse 9.3 box. Getting there required a little thought and a few tricks from ssh, but is all works.
With my basic set up at home, display 1 was already running, so port 5901 was in use in 'skyline'. To get around this problem ssh allows you to forward a remote port to a different local port - say 5902 which allowed a second vnc connection to display 2 on 'skyline' that was actually a local forward of display 1 on 'bonza' or 'rankin-xp' at work. The trick to get ssh to do this was to ssh into 'skyline' and then create a tunnel to 'nemesis' and tell 'nemesis' for forward port 5901 from either 'bonza' or 'rankin-xp' back to 'skyline' on port 5902 over ssh so it could be viewed as 'skyline:2' (display 2) on my XP laptop. After setting up vncserver on 'bonza' and 'rankin-xp' it actually worked. All it took was an ssh session via putty to skyline from windows. Then from skyline:
skyline:~> ssh -g -L 5902:bonza:5901 nemesis
and then in XP simply start another realvnc session and point it to skyline:2, and your there. For grins, and in theory, you can set another display at 5903 and have 3 active vnc connections and 3 linux desktops on your XP box at the same time. (Now that's a great use of windows.....)
So for what it is worth, I thought I would share the information in hopes that it helps some other poor soul -- before I forgot what it was I did to get it working!
Useful links were:
http://www.uk.research.att.com/archive/vnc/sshvnc.html http://www.uk.research.att.com/archive/vnc/sshwin.html http://www.uk.research.att.com/archive/vnc/xvnc.html
-- David C. Rankin, J.D., P.E. RANKIN LAW FIRM, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 (936) 715-9333 (936) 715-9339 fax www.rankinlawfirm.com
Nice description. Why don't you put it in susewiki.org? Cheers Svetoslav Milenov (Sunny)