Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to turn your box into a Xvnc Terminal Server
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 10, 11, 12 ... 15, 16, 17  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
VinnieNZ
Tux's lil' helper
Tux's lil' helper


Joined: 11 Mar 2004
Posts: 126
Location: New Zealand

PostPosted: Wed Jul 14, 2004 11:50 pm    Post subject: Reply with quote

Right, to try to complicate things some more...

I'm at work and would like to VNC in to my own machine at home (via SSH as the work network's ports are quite heavily locked). The problem is this. To get to my machine via SSH (which I can do from work) I go:

WorkPC -> Home Server (Debian - my flatmates setup; basically sits as a gateway between the router and the rest of the network) -> Cobra (My Gentoo setup).

So I have to SSH onto the home server then SSH from there to Cobra.

Is it possible to somehow 'bounce' the tunneling through the Home Server to my machine? Or is this just wishful thinking :roll:
Back to top
View user's profile Send private message
opm8
n00b
n00b


Joined: 10 Sep 2003
Posts: 56

PostPosted: Sat Jul 17, 2004 12:19 am    Post subject: Reply with quote

VinnieNZ,

What you need to do is establish an ssh tunnel from your work machine to Cobra through the Home Server, easily accomplished through ssh.

Code:

ssh HomeServer -L 2222:Cobra:22 -L 5900:Cobra:5900 -C -N


What this does is establishes a tunnel from your local port 2222 (on your work computer) directly to port 22 of Cobra. Disregard the 5900:Cobra:5900 for now, I'll explain in a minute. The -L means it's a tunnel from local port, -C compresses the connection (a good thing, especially if you're going to use vnc), and -N simply establishes this connection without spawning a shell on Cobra. After you enter this on the command line it will just sit there so minimize the shell to get rid of it.

Now all you need to do is
Code:

ssh localhost -p 2222 -l <your username on Cobra>


and you'll be connected directly to Cobra. That's for direct command-line level access to Cobra. You want vnc access, which is a different kettle of fish. :)

Here's what I do, since I have a similar setup:

At home:

Code:

emerge libvncserver


This gives you the x11vnc executable. What you'll do is create a tunnel and then vnc through it. This is where -L 5900:Cobra:5900 comes in. This is a tunnel from your work machine to port 5900 on Cobra, where x11vnc is listening. Create an executable (I call it vnc_home) and put it into /usr/local/bin.

Code:

#!/bin/bash

#Establish tunnel to home box and start x11vnc there
ssh localhost -C -p 2222 '/usr/local/bin/x11vnc -display :0 -bg'

#Establish a vnc session thru ssh
vncviewer localhost::5900 -passwd ~/.vnc/passwd -noshared -compresslevel 9 -quality 5 -encodings Tight -xrm '*grabKeyboard: true' -xrm '*desktop.translations: #override\n <Key>F12: Quit()'


You can use F8 to go to fullscreen and back, and F12 to close the session. The ~/.vnc/passwd is created with vncpasswd so you don't have to enter the password when Cobra prompts you for it every time. Do this before running this script. Notice also that the connection is encoded Tight, which is one of the best features of tightvnc. From work you now type:

Code:

vnc_home


and sit back in amazement. :) Have fun!

--opm8

VinnieNZ wrote:
Right, to try to complicate things some more...

I'm at work and would like to VNC in to my own machine at home (via SSH as the work network's ports are quite heavily locked). The problem is this. To get to my machine via SSH (which I can do from work) I go:

WorkPC -> Home Server (Debian - my flatmates setup; basically sits as a gateway between the router and the rest of the network) -> Cobra (My Gentoo setup).

So I have to SSH onto the home server then SSH from there to Cobra.

Is it possible to somehow 'bounce' the tunneling through the Home Server to my machine? Or is this just wishful thinking :roll:
[/code]
Back to top
View user's profile Send private message
xtcrush
n00b
n00b


Joined: 10 Jul 2004
Posts: 7

PostPosted: Mon Aug 02, 2004 5:06 pm    Post subject: Reply with quote

Tutorial's great and It is working perfectly, but question...

If I connect to the server, log in and then just kill the connection, when I re-login next time, is there anyway to get my original session back?

Either that or I guess I need to know what to configure to VNC directly into the local desktop.

Thx
Back to top
View user's profile Send private message
opm8
n00b
n00b


Joined: 10 Sep 2003
Posts: 56

PostPosted: Mon Aug 02, 2004 10:35 pm    Post subject: Reply with quote

xtcrush,

I'm glad you like the tutorial, it's my first one. :)

I don't quite understand your question, but here goes. If you're connecting via ssh for command line access to the target system, then once you close out that session, it's gone forever. Just like a shell on your local machine.

If you're connecting via vnc what you'll see is the same thing as if you were sitting in front of the target computer in person. VNC is stateless, so if you close out your session, then establish a new one it's as though you never left, and everything is as you left it.

--opm8

xtcrush wrote:
Tutorial's great and It is working perfectly, but question...

If I connect to the server, log in and then just kill the connection, when I re-login next time, is there anyway to get my original session back?

Either that or I guess I need to know what to configure to VNC directly into the local desktop.

Thx
Back to top
View user's profile Send private message
DoubleSHOT
n00b
n00b


Joined: 03 Aug 2004
Posts: 11

PostPosted: Tue Aug 03, 2004 9:30 pm    Post subject: Reply with quote

I keep getting the following error

Code:
doubleshot@penthouse doubleshot $ vncviewer server:72
VNC viewer version 3.3.7 - built Aug  3 2004 15:36:06
Copyright (C) 2002-2003 RealVNC Ltd.
Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
See http://www.realvnc.com for information on VNC.
VNC server supports protocol version 3.7 (viewer 3.3)
Password:
[b]VNC authentication failed[/b]


syslog
Code:
Aug  3 17:20:00 [CRON] (root) CMD (test -x /usr/sbin/run-crons && /usr/sbin/run-crons )_
Aug  3 17:25:55 [xinetd] START: vnc-1024x768x24 pid=23254 from=192.168.1.15
Aug  3 17:25:55 [kdm_greet] Can't open default user face


I didn't notice that any of you had authentication problems at all...much less needing to authenticate at all...i've tried all the passwords i have setup for the box, also, it doesn't ask for a username...=/

any help would be appreciated...

P.S. - I'm using KDE 3.3_beta2
Back to top
View user's profile Send private message
Doc7
Tux's lil' helper
Tux's lil' helper


Joined: 18 Jul 2004
Posts: 133
Location: AC-Germany

PostPosted: Thu Aug 19, 2004 12:23 pm    Post subject: Reply with quote

i still got some problems opening a session via vnc....

i already tried about anything in this thread (except gdm/kdm)

if i start a vncserver manually i can connect to this session without a problem and get twm as expected (works also with fluxbox)



but if i try to connect to my xinetd-service i get my xdm-login and after login it disconnects.

On the client side i get the following
Code:
VNC server supports protocol version 3.3 (viewer 3.3)
No authentication needed
Desktop name "nobody's x11 desktop (lap0003-vm03:3)"
Connected to VNC server, using protocol version 3.3
VNC server default format:
  32 bits per pixel.
  Least significant byte first in each pixel.
  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
Using default colormap which is TrueColor.  Pixel format:
  32 bits per pixel.
  Least significant byte first in each pixel.
  True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
Using shared memory PutImage
Same machine: preferring raw encoding
vncviewer: VNC server closed connection
ShmCleanup called


On the server side i get following log-entires:
Code:
==> /var/log/everything/current <==
Aug 19 14:21:09 [xinetd] START: vnc-800x600x24 pid=16328 from=127.0.0.1
Aug 19 14:21:09 [su(pam_unix)] session opened for user nobody by (uid=0)
Aug 19 14:21:10 [su(pam_unix)] session closed for user nobody

==> /var/log/xdm.log <==
xdm info (pid 7088): Couldn't connect to PRNGD socket "/tmp/entropy": No such file or directory


any suggestions ?
Back to top
View user's profile Send private message
r0dzilla
n00b
n00b


Joined: 06 Feb 2003
Posts: 70
Location: South Carolina, USA

PostPosted: Thu Aug 19, 2004 7:56 pm    Post subject: Reply with quote

I've got everything setup, however:

I'm trying to connect to my linux box from a windows box

I've only setup the 1024x768x24 service

When I run vncviewer on windows and have it to connect to machine:72 nothing happens, no error message or nothing.

if I change 72 to a bogus port I know I'm not using then I get a connect error.

Looking at the logs, it appears xinted is trying to start things:
Code:
Aug 19 10:10:41 [xinetd] Started working: 1 available service
Aug 19 10:10:48 [xinetd] START: vnc-1024x768x24 pid=31035 from=<IP ADDR REMOVED>

any ideas?

NOTE: I removed the ip address to protect the innocent... er somethin' :P
Back to top
View user's profile Send private message
Galuvian
n00b
n00b


Joined: 16 Sep 2004
Posts: 30

PostPosted: Fri Sep 24, 2004 3:51 am    Post subject: Reply with quote

Quote:
vncviewer: ConnectToTcpAddr: connect: Connection refused
Unable to connect to VNC server


Felt really stupid when I realized what I had to do to fix this.

In /etc/hosts.allow add the line:
Code:
Xvnc : 192.168.0.* : allow
Back to top
View user's profile Send private message
Galuvian
n00b
n00b


Joined: 16 Sep 2004
Posts: 30

PostPosted: Fri Sep 24, 2004 10:04 pm    Post subject: Reply with quote

Having lukewarm results getting this going from work.

Everything works fine if I use a direct VNC connection. But when I try going through ssh, it crashes whenever I try doing something on the remote machine that requires much of a re-draw. Opening Firefox, an irc client, a KDE menu. If I do the same thing outside of ssh there is no problem. I've been searching for SSH help but there is so much out there I haven't found what I need yet.

SSH clients I've tried: Putty, OpenSSH, Cygwin

There is a NAT box at work. I added *.mycompany.com to hosts.allow, and it works fine without ssh. Enable ssh and connections are refused. Had to allow connections from * just to get it working from here. My laptop at work is not on the company domain, but if that were the problem it shouldn't work without ssh either.

My home firewall/router is only allowing ports 22 and 5972 through.
Back to top
View user's profile Send private message
Phorem
Tux's lil' helper
Tux's lil' helper


Joined: 05 Mar 2004
Posts: 92
Location: Toronto, Canada

PostPosted: Sun Sep 26, 2004 1:39 am    Post subject: Reply with quote

Has anyone been sucessful getting VNC (any kind) and OpenGL to work? I've read about xf4vnc and i tried installing chromium (not the game) http://chromium.sourceforge.net/ but i still get the.....

>>Xlib: extension "GLX" missing on display ":1.0" <<

I want to have OpenGL so i can watch tv at work using TVTime :-))

Anyone have OpenGL and VNC working?
_________________
Gentoo AMD64 2004.1, AMD64 Athlon 3200, Asus K8V Deluxe, 1 gig 3200 ram, GeForce FX 5900XT 128, ATI Wonder VE Remote, HP 420i DVD+R+RW, HP Scanjet 2200c, Epson Stylus C84
Back to top
View user's profile Send private message
tscolari
l33t
l33t


Joined: 02 May 2004
Posts: 602
Location: curitiba - pr - Brazil

PostPosted: Sun Oct 17, 2004 12:38 am    Post subject: Reply with quote

Help me here, i read half of the post and saw a lot of people with the same problem im having but no solution...

When i connect to the vnc server i see only the grey screen...

I tryed to add xdm to the .vnc/ startup file, no sucess...
I have edited all the files as the tutorial told...
also i tryed to run the vncpasswd but still my vnc dont ask for the password to connect...

What could i do to fix the grey screen problem?
And to setup a passwd to connect to the vnc?
_________________
------------------------------------
Tiago Scolari
Back to top
View user's profile Send private message
tscolari
l33t
l33t


Joined: 02 May 2004
Posts: 602
Location: curitiba - pr - Brazil

PostPosted: Sun Oct 17, 2004 12:56 am    Post subject: Reply with quote

okay... with kdm it worked... but i really would like to make it to work with xdm... any idea?

orther question is, how can i change the resolution/quality of the connection? how can i change in the execution time the color depth/resolution?
I saw a friend of mine doing this with his vnc
_________________
------------------------------------
Tiago Scolari
Back to top
View user's profile Send private message
jerry arns
Tux's lil' helper
Tux's lil' helper


Joined: 13 Dec 2003
Posts: 95
Location: France

PostPosted: Sun Oct 17, 2004 1:56 pm    Post subject: Reply with quote

You can even avoid to modify the /etc/services files by configuring the /etc/xinetd.d/xvncserver file like this :

Code:

service vnc-what-ever-name
{
    type = UNLISTED
    port = 5950
    protocol = tcp
    socket_type = stream
    wait = no
    user = nobody
    server = /usr/X11R6/bin/Xvnc
    server_args = -inetd -query localhost -once -geometry 1024x768 -depth 24
    disable = no
}



i.e just add the "type" and "port" lines.

I don't know if it is better or not, just another way to do it (less work !).
_________________
Left handed, right minded.
Back to top
View user's profile Send private message
tscolari
l33t
l33t


Joined: 02 May 2004
Posts: 602
Location: curitiba - pr - Brazil

PostPosted: Sun Oct 17, 2004 4:36 pm    Post subject: Reply with quote

Okay... i just would like to know if someone did Xdm work on this...
im trying it but no sucess at all...
only kdm is working, xdm gives a grey screen...
_________________
------------------------------------
Tiago Scolari
Back to top
View user's profile Send private message
Frontier
n00b
n00b


Joined: 19 Oct 2004
Posts: 16
Location: Chios, Greece

PostPosted: Tue Oct 19, 2004 8:17 pm    Post subject: Reply with quote

Followed the thread at all and still I can't get this to work :(

I run KDE but I don't have KDM in my system, plus the xinet.d/xvncserver script does not get executed on startup...
_________________
The Mighty Frontier
Back to top
View user's profile Send private message
JohnHerdy
n00b
n00b


Joined: 11 Jul 2002
Posts: 61

PostPosted: Tue Nov 02, 2004 4:32 pm    Post subject: Reply with quote

Great howto, thanks a lot!
Back to top
View user's profile Send private message
lonyx
n00b
n00b


Joined: 10 Sep 2004
Posts: 7
Location: UK

PostPosted: Wed Nov 10, 2004 10:03 pm    Post subject: Great How To but... latest PAM breaks it... Reply with quote

Only got this running last week - fantastic not having to walk around the so much!

However, the latest version of PAM 0.77-r3, kindly installed after an

Code:
emerge -uD world


results in the session terminating at login.

Error messages in /var/log/everything/current contain
Code:
Nov 10 21:21:56 [xinetd] START: vnc-800x600x16 pid=612 from=xxx.xxx.xxx.xxx
Nov 10 21:22:17 [PAM-env] Unknown PAM_ITEM: <XAUTHORITY>
Nov 10 21:22:17 [gdm] PAM pam_putenv: delete non-existent entry; XAUTHORITY
Nov 10 21:22:17 [PAM-env] Unknown PAM_ITEM: <XAUTHORITY>
Nov 10 21:22:17 [gdm] PAM pam_putenv: delete non-existent entry; XAUTHORITY
Nov 10 21:22:17 [gdm(pam_unix)] session opened for user lonyx by (uid=0)
Nov 10 21:22:17 [gdm(pam_unix)] session closed for user lonyx
Nov 10 21:22:17 [PAM-env] Unknown PAM_ITEM: <XAUTHORITY>
Nov 10 21:22:17 [gdm] PAM pam_putenv: delete non-existent entry; XAUTHORITY
Nov 10 21:22:17 [PAM-env] Unknown PAM_ITEM: <XAUTHORITY>
Nov 10 21:22:17 [gdm] PAM pam_putenv: delete non-existent entry; XAUTHORITY



Forgive me if this is blindingly obvious to fix, but I'm a complete noob (started with Linux in July).
Back to top
View user's profile Send private message
Veneroso
n00b
n00b


Joined: 26 May 2004
Posts: 27
Location: Batavia, New York

PostPosted: Thu Nov 11, 2004 5:49 am    Post subject: Reply with quote

I've seen this question posted a few times in this thread, but I haven't been able to find a solution that works.

I have everything set up according to the guide, and when I connect to my server with vncviewer it brings up the login screen. However after I login, a grey screen comes up and nothing else and I get this error message:

Code:
vncviewer: VNC server closed connection


This happens even when I launch the vncviewer locally. It allows me to login, brings up the grey screen, sits for about a minute, then sudenly closes.

I am currently using gdm, but kdm has the same problem.

I broke down and installed the demo of Starnet's X-win32 to see if XDMCP was working, which it does. I was able to login normally, although there was a long delay in the desktop being loaded (probably due to it being run on my old pentium 166). But at least it worked. X11 forewarding with ssh has virtually no delay when launching individual X-apps from the terminal.

I am running:
tightvnc-1.3_alpha5
xorg-x11-6.8.0-r1

I am leaning towards this being an issue with tightvnc, I will try an earlier version.

--edit--

nope, not tightvnc...well, tightvnc-1.2.9-r1 has the same problem, and its the version I had on the last time this worked, a few months ago on a stage 3 install. So my guess that its not it. It shouldn't be xorg either because XDMCP does work in the standard mode, so I don't know.

Any suggestions?
_________________
All you need is the handyman's secret weapon, duct-tape.
Back to top
View user's profile Send private message
schneider
n00b
n00b


Joined: 11 Mar 2003
Posts: 2

PostPosted: Thu Nov 11, 2004 9:46 pm    Post subject: Reply with quote

Veneroso wrote:
This happens even when I launch the vncviewer locally. It allows me to login, brings up the grey screen, sits for about a minute, then sudenly closes.

edit /etc/security/pam_env.conf and comment out the following lines:
Code:
REMOTEHOST     DEFAULT= OVERRIDE=@{PAM_RHOST}
DISPLAY        DEFAULT=${REMOTEHOST}:0.0 OVERRIDE=${DISPLAY}
XAUTHORITY     DEFAULT= OVERRIDE=@{XAUTHORITY}
Back to top
View user's profile Send private message
frenkel
Veteran
Veteran


Joined: 13 May 2003
Posts: 1034
Location: .nl

PostPosted: Fri Nov 12, 2004 7:07 pm    Post subject: Reply with quote

Hi, I'm trying to set up Tightvnc with XDM and Fluxbox. Everything seems to work when I do a vncviewer localhost:71, I get a XDM login screen. After typing in a username and password, I get disconnect from the server.
Here are my logs:
Quote:

/var/log/xdm.log:
<snip>
sessions: SessionTypes=fluxbox,
Changing kdmrc in /usr/kde/3.3
/etc/X11/xdm/Xsetup_0: line 25: cd: /usr/kde/3.3/share/config/kdm: No such file or directory
Changing kdmrc in /usr
/etc/X11/xdm/Xsetup_0: line 25: cd: /usr/share/config/kdm: No such file or directory
Changing kdmrc in /usr/kde/3.3
/etc/X11/xdm/Xsetup_0: line 25: cd: /usr/kde/3.3/share/config/kdm: No such file or directory
xdm info (pid 9531): Couldn't connect to PRNGD socket "/tmp/entropy": No such file or directory
</snip>

Quote:

~/.xsession-errors:
Xlib: connection to "localhost:1.0" refused by server
Xlib: Client is not authorized to connect to Server
torsmo: can't open display: localhost:1
Xlib: connection to "localhost:1.0" refused by server
Xlib: Client is not authorized to connect to Server
Error: Can not connect to X server.
Make sure you started X before you start Fluxbox.


Does anybody know how to solve this?
Thanks,
Frank
_________________
http://techfield.org
Back to top
View user's profile Send private message
frenkel
Veteran
Veteran


Joined: 13 May 2003
Posts: 1034
Location: .nl

PostPosted: Sat Nov 13, 2004 10:17 am    Post subject: Reply with quote

Doesn't anyone know how to solve this? I need this for school :cry:

Thanks in advance,
Frank
_________________
http://techfield.org
Back to top
View user's profile Send private message
abeowitz
n00b
n00b


Joined: 17 Mar 2003
Posts: 20
Location: Seattle

PostPosted: Sun Nov 14, 2004 3:56 am    Post subject: Step back on PAM Reply with quote

emerge pam-0.77-r2.ebuild and do the etc-update.

This fixed my remote GDM login problem, my tightvnc server problem, AND my SSH DISPLAY="localhost:10.0" problem!!!!
Back to top
View user's profile Send private message
ezechiel_dantec
n00b
n00b


Joined: 14 Nov 2004
Posts: 32

PostPosted: Tue Nov 16, 2004 12:15 am    Post subject: Reply with quote

schneider wrote:
Veneroso wrote:
This happens even when I launch the vncviewer locally. It allows me to login, brings up the grey screen, sits for about a minute, then sudenly closes.

edit /etc/security/pam_env.conf and comment out the following lines:
Code:
REMOTEHOST     DEFAULT= OVERRIDE=@{PAM_RHOST}
DISPLAY        DEFAULT=${REMOTEHOST}:0.0 OVERRIDE=${DISPLAY}
XAUTHORITY     DEFAULT= OVERRIDE=@{XAUTHORITY}


I have the same problem, and these lines are NOT commented in my pam_env.conf...
I don't get it... :?

EDIT: I emerged the r2 version of pam, but now, how do I avoid it getting updated when I
Code:
emerge -Dua world
?
Back to top
View user's profile Send private message
GrimSage
n00b
n00b


Joined: 13 Sep 2004
Posts: 42

PostPosted: Tue Nov 16, 2004 2:38 pm    Post subject: Reply with quote

Ok I dont know if this is possible or not, not the best with all this stuff.

Is is possible to do something like screen with this. As in can I connect do soemthing to detach from the session but keep it running then when I get back to the computer reconnect to it?
I didnt read though all 11 pages so I dont know if this has been asked, if it has please forgive me and direct me to where it is.
Back to top
View user's profile Send private message
ezechiel_dantec
n00b
n00b


Joined: 14 Nov 2004
Posts: 32

PostPosted: Tue Nov 16, 2004 2:42 pm    Post subject: Reply with quote

GrimSage wrote:
Ok I dont know if this is possible or not, not the best with all this stuff.

Is is possible to do something like screen with this. As in can I connect do soemthing to detach from the session but keep it running then when I get back to the computer reconnect to it?
I didnt read though all 11 pages so I dont know if this has been asked, if it has please forgive me and direct me to where it is.


AFAIK nothing exists of this sort, and I looked for it...
However there's something you can do to take control of you currently opened session... if you're interested...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3 ... 10, 11, 12 ... 15, 16, 17  Next
Page 11 of 17

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum