Networking Forums

Networking Forums > Computer Networking > Linux Networking > Is there a way to speed up and resume a SSH X forwarding session from a disconnection?

Reply
Thread Tools Display Modes

Is there a way to speed up and resume a SSH X forwarding session from a disconnection?

 
 
ANTant@zimage.com
Guest
Posts: n/a

 
      04-18-2006, 08:03 PM
I fell in love with this X forwarding method with SSH between two Linux boxes. I love being
able to access my home Linux box and from my Linux machine (actually in a VMware v5.5.1, but
it works well).

I did get a nasty two minutes lag. I thought I was going to lose my connection since I
couldn't ping my home connection. If there were to be a disconnection, is it possible to
resume the SSH X forwarding session I made earlier? Or do I have to make a new session and
reopen all my programs again?

Also, is there a way to tweak the speed? My cable modem connection is limited in its upload
speed (256 Kb/sec). Its download speed is 3 Mb/sec. I was wondering if I could tweak like
don't transfer full colors, etc.

Thank you in advance.
--
"The men of experiment are like the ant; they only collect and use. But the bee...gathers its materials from the flowers of the garden and of the field, but transforms and digests it by a power of its own." --Leonardo da Vinci
/\___/\
/ /\ /\ \ Phillip (Ant) @ http://antfarm.ma.cx (Personal Web Site)
| |o o| | Ant's Quality Foraged Links (AQFL): http://aqfl.net
\ _ / Please remove ANT if replying by e-mail.
( )
 
Reply With Quote
 
 
 
 
Dances With Crows
Guest
Posts: n/a

 
      04-18-2006, 08:37 PM
["Followup-To:" header set to comp.os.linux.x.]
On Tue, 18 Apr 2006 15:03:18 -0500, (E-Mail Removed) staggered into the
Black Sun and said:

Fix your NNTP client so it wraps lines at <= 72 characters, please.

> I fell in love with this X forwarding method with SSH between two
> Linux boxes. I did get a nasty two minutes lag. I thought I was going
> to lose my connection since I couldn't ping my home connection. If
> there were to be a disconnection, is it possible to resume the SSH X
> forwarding session I made earlier? Or do I have to make a new session
> and reopen all my programs again?


This question is kind of ill-formed, but I think you may want something
like xmove and xmovectrl. You start a pseudo-display with xmove, then
you set DISPLAY to that pseudo-display, and all X apps are directed
there. You can then use xmovectrl to switch an app from one real
display to another. This can be useful/handy, as it's practically
impossible to switch X clients from one display to another otherwise.

Or just deal with the hiccups. ssh connections are reasonably resistant
to momentary lossage IME. 30 seconds where no packets are going back
and forth = no problem. 30 *minutes*, it could drop out.

> Also, is there a way to tweak the speed?


You can't make a connection have more bandwidth than it has. You can
try the -C option to ssh, though I've had mixed results with that.
Running Firefox over ssh -XC (weakest links: T1s, 32K/s cablemodem) was
slooow.

> I was wondering if I could tweak like don't transfer full colors, etc.


Not with X, not easily. Running X in 16-bit color depth instead of 24
could help a bit, or it might not.

--
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin / mail: TRAP + SPAN don't belong
http://www.brainbench.com / "He is a rhythmic movement of the
-----------------------------/ penguins, is Tux." --MegaHAL
 
Reply With Quote
 
Richard E. Silverman
Guest
Posts: n/a

 
      04-19-2006, 02:43 AM
>>>>> "ANTant" == ANTant <(E-Mail Removed)> writes:

ANTant> I fell in love with this X forwarding method with SSH between
ANTant> two Linux boxes. I love being able to access my home Linux box
ANTant> and from my Linux machine (actually in a VMware v5.5.1, but it
ANTant> works well).

ANTant> I did get a nasty two minutes lag. I thought I was going to
ANTant> lose my connection since I couldn't ping my home
ANTant> connection. If there were to be a disconnection, is it
ANTant> possible to resume the SSH X forwarding session I made
ANTant> earlier? Or do I have to make a new session and reopen all my
ANTant> programs again?

A neat approach to this is to use VNC server on the remote Unix box, and
connect to it with a VNC client. All your X clients talk to the VNC
server process on the same machine. You can connect and disconnect to it
as you like with your VNC client, and not disturb your "X state" at all.

This is especially nice for Windows clients, since it means you can reboot
your Windows box as many times as Bill deems necessary, and not disturb
your X session.

--
Richard Silverman
(E-Mail Removed)

 
Reply With Quote
 
Felix E. Klee
Guest
Posts: n/a

 
      04-19-2006, 09:29 AM
On Tue, 18 Apr 2006 15:03:18 -0500, ANTant wrote:
> Also, is there a way to tweak the speed? My cable modem connection is
> limited in its upload speed (256 Kb/sec). Its download speed is 3
> Mb/sec. I was wondering if I could tweak like don't transfer full
> colors, etc.


Check out NX: http://freenx.berlios.de/

256 Kb/sec upload should be sufficient. We're regularly using NX over
ISDN at 64 Kb/sec up- and download.

--
Dipl.-Phys. Felix E. Klee
Email: (E-Mail Removed) (work), (E-Mail Removed) (home)
Tel: +49 721 8307937, Fax: +49 721 8307936
Linuxburg, Goethestr. 15a, 76135 Karlsruhe, Germany
 
Reply With Quote
 
Nico Kadel-Garcia
Guest
Posts: n/a

 
      04-19-2006, 10:54 AM
(E-Mail Removed) wrote:
> I fell in love with this X forwarding method with SSH between two
> Linux boxes. I love being able to access my home Linux box and from
> my Linux machine (actually in a VMware v5.5.1, but it works well).
>
> I did get a nasty two minutes lag. I thought I was going to lose my
> connection since I couldn't ping my home connection. If there were to
> be a disconnection, is it possible to resume the SSH X forwarding
> session I made earlier? Or do I have to make a new session and reopen
> all my programs again?


That's what VNC is for. It's not as well protected as an SSH-forwarded X
session, but the password handling at least is encrypted.

> Also, is there a way to tweak the speed? My cable modem connection is
> limited in its upload speed (256 Kb/sec). Its download speed is 3
> Mb/sec. I was wondering if I could tweak like don't transfer full
> colors, etc.


Simplifying the settings, by using the VNC settings to do fewer colors, is
pretty easy. But unfortunately X is notorious for being quite slow over
long-distance, remote connections: it really was not designed for
efficiency.


 
Reply With Quote
 
ANTant@zimage.com
Guest
Posts: n/a

 
      04-19-2006, 06:18 PM
In comp.security.ssh Nico Kadel-Garcia <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > I fell in love with this X forwarding method with SSH between two
> > Linux boxes. I love being able to access my home Linux box and from
> > my Linux machine (actually in a VMware v5.5.1, but it works well).
> >
> > I did get a nasty two minutes lag. I thought I was going to lose my
> > connection since I couldn't ping my home connection. If there were to
> > be a disconnection, is it possible to resume the SSH X forwarding
> > session I made earlier? Or do I have to make a new session and reopen
> > all my programs again?


> That's what VNC is for. It's not as well protected as an SSH-forwarded X
> session, but the password handling at least is encrypted.


Hmm, I was reading about setting up SSH for VNC. I thought the whole connection was encrypted?


> > Also, is there a way to tweak the speed? My cable modem connection is
> > limited in its upload speed (256 Kb/sec). Its download speed is 3
> > Mb/sec. I was wondering if I could tweak like don't transfer full
> > colors, etc.


> Simplifying the settings, by using the VNC settings to do fewer colors, is
> pretty easy. But unfortunately X is notorious for being quite slow over
> long-distance, remote connections: it really was not designed for
> efficiency.


Yeah, I noticed even on LAN, VNC can be sluggish. I can't imagine doing it over the Internet.
--
"The men of experiment are like the ant; they only collect and use. But the bee...gathers its materials from the flowers of the garden and of the field, but transforms and digests it by a power of its own." --Leonardo da Vinci
/\___/\
/ /\ /\ \ Phillip (Ant) @ http://antfarm.ma.cx (Personal Web Site)
| |o o| | Ant's Quality Foraged Links (AQFL): http://aqfl.net
\ _ / Please remove ANT if replying by e-mail.
( )
 
Reply With Quote
 
Richard E. Silverman
Guest
Posts: n/a

 
      04-19-2006, 07:35 PM
>>>>> "ANTant" == ANTant <(E-Mail Removed)> writes:

ANTant> In comp.security.ssh Nico Kadel-Garcia <(E-Mail Removed)>
ANTant> wrote:
>> (E-Mail Removed) wrote: > I fell in love with this X forwarding
>> method with SSH between two > Linux boxes. I love being able to
>> access my home Linux box and from > my Linux machine (actually in a
>> VMware v5.5.1, but it works well).
>> >
>> > I did get a nasty two minutes lag. I thought I was going to lose

>> my > connection since I couldn't ping my home connection. If there
>> were to > be a disconnection, is it possible to resume the SSH X
>> forwarding > session I made earlier? Or do I have to make a new
>> session and reopen > all my programs again?


>> That's what VNC is for. It's not as well protected as an
>> SSH-forwarded X session, but the password handling at least is
>> encrypted.


ANTant> Hmm, I was reading about setting up SSH for VNC. I thought the
ANTant> whole connection was encrypted?

He's talking about plain VNC -- although I believe the commercial version
of VNC does have some kind of connection security.

--
Richard Silverman
(E-Mail Removed)

 
Reply With Quote
 
ANTant@zimage.com
Guest
Posts: n/a

 
      04-19-2006, 09:03 PM
How weird for today... Earlier, I was getting a lock up with a spinning icon in my remote
Mozilla session with this ssh X forwarding. NIC was blinking madly and I ran bwm-ng on my home
Debian box:

bwm-ng v0.5 (probing every 0.500s), press 'h' for help
input: /proc/net/dev type: rate
/ iface Rx Tx Total
================================================== =========================
lo: 0.00 KB/s 0.00 KB/s 0.00 KB/s
eth0: 2.28 KB/s 57.18 KB/s 59.46 KB/s
vmnet8: 0.00 KB/s 0.00 KB/s 0.00 KB/s
vmnet1: 0.00 KB/s 0.00 KB/s 0.00 KB/s
---------------------------------------------------------------------------
total: 2.28 KB/s 57.18 KB/s 59.46 KB/s


As you can see my upload pipe got busy. The Web page wasn't even animating or anything. I killed
Mozilla, and my pipe got quiet. Restarted Mozilla, and then it happened again. I tried
restarting my X session, but the problem was still there once I loaded up Mozilla.

Any ideas why this happened? Starting mozilla via a remote gnone-terminal (also frozen when the
problem occurs), /var/log/messages, and dmesg didn't show anything odd. CPU usage was low. I did
run strace mozilla in remote gnome-terminal showed this during stuckage time:

....
) = 1 (in [3])
read(3, "\1\2\3c\0\0\0\0\37\0\240\2\4\0\0\0\30\0\0\0\210M\ 21\0\20"..., 32) = 32
writev(3, [{"H\2\6@\340\t\300\2\370\0\300\2\0\1@\0\0\1@\4\0\3 0\300\2"..., 24},
{"\377\377\377\377\377\377\377\377\377\377\377\377 \377\377"..., 65536}], 2) = 65560
writev(3, [{"H\2\6@\340\t\300\2\370\0\300\2\0\1@\0\0\2@\4\0\3 0\300\2"..., 24},
{"\377\377\377\377\377\377\377\377\377\377\377\377 \377\377"..., 65536}], 2) = 65560
writev(3, [{"H\2\6\10\340\t\300\2\370\0\300\2 \0@\0\0\3@\4\0\30\300"..., 8240},
{"\377\377\377\377\377\377\377\377\377\377\377\377 \377\377"..., 65536}], 2) = 73776
writev(3, [{"H\2\6@\340\t\300\2\370\0\300\2\0\1@\0\0\1\200\4\ 0\30\300"..., 24},
{"\377\377\377\377\377\377\377\377\377\377\377\377 \377\377"..., 65536}], 2) = 65560
writev(3, [{"H\2\6@\340\t\300\2\370\0\300\2\0\1@\0\0\2\200\4\ 0\30\300"..., 24},
{"\377\377\377\377\377\377\377\377\377\377\377\377 \377\377"..., 65536}], 2) = 32816
writev(3, [{"\377\377\377\377\377\377\377\377\377\377\377\377 \377\377"..., 32744}], 1) = -1
EAGAIN (Resource temporarily unavailable)
select(4, [3], [3], NULL, NULL) = 1 (out [3])
writev(3, [{"\377\377\377\377\377\377\377\377\377\377\377\377 \377\377"..., 32744}], 1) = 32744
write(3, "H\2\6\10\340\t\300\2\370\0\300\2 \0@\0\0\3\200\4\0\30\300"..., 8220) = 8220
read(3, 0xbff79c70, 32) = -1 EAGAIN (Resource temporarily unavailable)
select(4, [3], NULL, NULL, NULL) = 1 (in [3])
read(3, "n\2\4c\3134E\0\1\4\4\0\0\0\0\0\0\0\0\4\4\4\4\4\0\ 0\3\37"..., 32) = 32
read(3, 0xbff79c70, 32) = -1 EAGAIN (Resource temporarily unavailable)
select(4, [3], NULL, NULL, NULL) = 1 (in [3])
read(3, "n\2\6c\2025E\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 0\3\37"..., 32) = 32
read(3, 0xbff79c70, 32) = -1 EAGAIN (Resource temporarily unavailable)
select(4, [3], NULL, NULL, NULL) = 1 (in [3])
read(3, "n\2\6c\0;E\0\1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\ 0 \1\4"..., 32) = 32
read(3, 0xbff79c70, 32) = -1 EAGAIN (Resource temporarily unavailable)
select(4, [3], NULL, NULL, NULL
....

This section seems to repeat itself over and over during the freeze.


In comp.os.linux.x (E-Mail Removed) wrote:
> I fell in love with this X forwarding method with SSH between two Linux boxes. I love being
> able to access my home Linux box and from my Linux machine (actually in a VMware v5.5.1, but
> it works well).


> I did get a nasty two minutes lag. I thought I was going to lose my connection since I
> couldn't ping my home connection. If there were to be a disconnection, is it possible to
> resume the SSH X forwarding session I made earlier? Or do I have to make a new session and
> reopen all my programs again?


> Also, is there a way to tweak the speed? My cable modem connection is limited in its upload
> speed (256 Kb/sec). Its download speed is 3 Mb/sec. I was wondering if I could tweak like
> don't transfer full colors, etc.

--
"The men of experiment are like the ant; they only collect and use. But the bee...gathers its materials from the flowers of the garden and of the field, but transforms and digests it by a power of its own." --Leonardo da Vinci
/\___/\
/ /\ /\ \ Phillip (Ant) @ http://antfarm.ma.cx (Personal Web Site)
| |o o| | Ant's Quality Foraged Links (AQFL): http://aqfl.net
\ _ / Please remove ANT if replying by e-mail.
( )
 
Reply With Quote
 
Andrew Gideon
Guest
Posts: n/a

 
      04-20-2006, 02:05 PM
On Wed, 19 Apr 2006 16:03:41 -0500, ANTant wrote:

> I tried restarting my X session, but the
> problem was still there once I loaded up Mozilla.


As others have written, X in general and browsers in particular can be
problematic over WAN links. Consider that "spinning icon" you mentioned.
It's pointless, yet it uses bandwidth. On a LAN, that's no big deal. But
where uplink bandwidth is limited (and perhaps even suffering from
significant latency, depending upon the various connections involved), the
"little wastes" can become significant.

If your primary goal is to browse via your home connection, and if you've
a browser on the "remote" machine (that from which you are SSHing), you
can take a different and more efficient approach. Configure Apache (or
some other software if that's easier for you) as an HTTP proxy on the
machine to which you're currently SSHing. Run the browser on your
"remote" machine, but have it use the "home" machine as a proxy.

The browser's graphical inefficiencies will no longer matter, but HTTP
requests will still come from your home machine.

If there's some reason why you must use SSH for this, then configure the
proxy as I described above but add an SSH connection that port forwards
some port (ie. 8080) on the "remote" machine to the proxy port (probably
port 80) on the "home" machine. Tell your browser on the "remote" machine
to use localhost:8080 as the proxy.

The browser will think the proxy is on that machine, but SSH's port
forwarding magic will pass the requests to your home proxy server.

- Andrew

 
Reply With Quote
 
Richard E. Silverman
Guest
Posts: n/a

 
      04-21-2006, 01:27 AM

> If there's some reason why you must use SSH for this, then configure the
> proxy as I described above but add an SSH connection that port forwards
> some port (ie. 8080) on the "remote" machine to the proxy port (probably
> port 80) on the "home" machine. Tell your browser on the "remote" machine
> to use localhost:8080 as the proxy.


If your browser supports a SOCKS proxy, you can accomplish without the
need for a remote HTTP proxy (e.g. Squid), by using OpenSSH "dynamic" port
forwarding:

$ ssh -D 1080 ...

and set your browser (running on the same machine) to use localhost:1080
as a SOCKS proxy.

--
Richard Silverman
(E-Mail Removed)

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NLA causing problems with standby / resume Anteaus Wireless Networks 0 04-13-2010 05:19 PM
Post your Resume Here ammu Broadband 0 08-12-2008 10:34 AM
How to resume partial torrent after errors? Michael Badt Linux Networking 1 03-05-2006 03:32 PM
Forwarding a login session? Captain Dondo Linux Networking 1 10-15-2005 08:16 PM
MN-710 does not connect after system resume Danno Ferrin Broadband Hardware 0 04-22-2004 06:48 AM



1 2 3 4 5 6 7 8 9 10 11