From mboxrd@z Thu Jan 1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: Peter Oliver
Newsgroups: gmane.emacs.devel
Subject: Re: Remote TCP server through ssh tunnel
Date: Mon, 25 Oct 2010 18:28:27 +0100 (BST)
Message-ID:
References:
<87k4l7mta3.fsf_-_@fulla.xlab.taz>
<878w1m5tdw.fsf@ginnungagap.bsc.es>
NNTP-Posting-Host: lo.gmane.org
Mime-Version: 1.0
Content-Type: MULTIPART/MIXED;
BOUNDARY="-1463811583-218422156-1288027707=:3752"
X-Trace: dough.gmane.org 1288027752 15821 80.91.229.12 (25 Oct 2010 17:29:12 GMT)
X-Complaints-To: usenet@dough.gmane.org
NNTP-Posting-Date: Mon, 25 Oct 2010 17:29:12 +0000 (UTC)
Cc: Ken Raeburn , Emacs Developers
To: =?ISO-8859-15?Q?Llu=EDs?=
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 25 19:29:10 2010
Return-path:
Envelope-to: ged-emacs-devel@m.gmane.org
Original-Received: from lists.gnu.org ([199.232.76.165])
by lo.gmane.org with esmtp (Exim 4.69)
(envelope-from )
id 1PAQqu-0000Rc-D9
for ged-emacs-devel@m.gmane.org; Mon, 25 Oct 2010 19:29:10 +0200
Original-Received: from localhost ([127.0.0.1]:47516 helo=lists.gnu.org)
by lists.gnu.org with esmtp (Exim 4.43)
id 1PAQqq-0005ap-9g
for ged-emacs-devel@m.gmane.org; Mon, 25 Oct 2010 13:28:52 -0400
Original-Received: from [140.186.70.92] (port=55602 helo=eggs.gnu.org)
by lists.gnu.org with esmtp (Exim 4.43) id 1PAQqh-0005Y2-Ht
for emacs-devel@gnu.org; Mon, 25 Oct 2010 13:28:46 -0400
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
(envelope-from ) id 1PAQqb-0003SF-S7
for emacs-devel@gnu.org; Mon, 25 Oct 2010 13:28:39 -0400
Original-Received: from smtp-out3.blueyonder.co.uk ([195.188.213.6]:53325)
by eggs.gnu.org with esmtp (Exim 4.71)
(envelope-from ) id 1PAQqb-0003S7-GM
for emacs-devel@gnu.org; Mon, 25 Oct 2010 13:28:37 -0400
Original-Received: from [172.23.170.136] (helo=anti-virus01-07)
by smtp-out3.blueyonder.co.uk with smtp (Exim 4.52)
id 1PAQqW-0000MG-J4; Mon, 25 Oct 2010 18:28:32 +0100
Original-Received: from [77.102.154.60] (helo=froglet.home.mavit.org.uk)
by asmtp-out5.blueyonder.co.uk with esmtp (Exim 4.52)
id 1PAQqS-0000Cd-KG; Mon, 25 Oct 2010 18:28:28 +0100
Original-Received: from froglet.home.mavit.org.uk (localhost [127.0.0.1])
by froglet.home.mavit.org.uk (8.14.4/8.14.4) with ESMTP id
o9PHSSdC012211; Mon, 25 Oct 2010 18:28:28 +0100
Original-Received: from localhost (mavit@localhost)
by froglet.home.mavit.org.uk (8.14.4/8.14.4/Submit) with ESMTP id
o9PHSRFf012206; Mon, 25 Oct 2010 18:28:27 +0100
X-Authentication-Warning: froglet.home.mavit.org.uk: mavit owned process doing
-bs
In-Reply-To: <878w1m5tdw.fsf@ginnungagap.bsc.es>
User-Agent: Alpine 2.00 (LFD 1167 2008-08-23)
X-No-Archive: yes
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
4)
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Emacs development discussions."
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
X-Gmane-Expiry: 2010-11-08
Xref: news.gmane.org gmane.emacs.devel:132100
Archived-At:
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
---1463811583-218422156-1288027707=:3752
Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE
On Mon, 25 Oct 2010, Llu=C3=ADs wrote:
> Ken Raeburn writes:
>
>> On Oct 24, 2010, at 12:48, Llu=C3=ADs wrote:
>>> I've tried with this:
>>>
>>> server$ emacs --daemon --eval '(setq server-use-tcp t server-host "0.0.=
0.0")'
>>> server$ netstat -nap | grep emacs
>>> tcp 0 0 0.0.0.0:13501 0.0.0.0:* LIS=
TEN 12078/emacs
>>> server$ ssh -R 13502:localhost:13501 firewall
>>> client$ ssh -L 13501:localhost:13502 vilanova@gso.ac.upc.edu
>>> # I already have an existing tunnel for ssh connections to server
>>> client$ scp server:.emacs.d/server/server /tmp/server
>>> client$ sed -i -e s/0.0.0.0/127.0.0.1/ /tmp/server
>>> client$ emacsclient -f /tmp/server -c
>>> Waiting for Emacs...
>>> *ERROR*: Display :0.0 can't be opened
>>> [Exit 1 ]
>>
>> If your SSH path through is forwarding X11 as well as TCP connections,
>> you need to find the server-side name for that forwarded "display" and
>> give it to emacsclient to pass through. I think that'll work; I
>> haven't tried it.
I've tried it, and can confirm that it does work.
> That's what I do, but is not comfortable for high delay network
> connections. As I said, I expected to run locally "as much as possible",
> but modify everything remotely.
I think you misunderstand. The suggestion here isn't that you should=20
run emacs over X11. The other person is pointing out that SSH arranges=20
this for you in a way that confuses emacsclient. All this talk of=20
"servers" is rather confusing when your X11 server is at the opposite=20
end of the connection to your SSH server :-)
Try the following:
server$ echo $DISPLAY
# Confirm that you can connect to this display by running, e.g.,
server$ xdpyinfo
# Then:
client$ export DISPLAY=3D""
Anyway, as people have mentioned, I think you should look into Tramp.
I call emacsclient with a simple shell wrapper that prefixes=20
"/ssh:login@host:" to the file name. Emacs then fetches the=20
file for me for local editing.
If you re-use your existing SSH connections by adding, e.g.,
=09ControlMaster auto
=09ControlPath ~/.ssh/mux/%r@%h:%p
to your ~/.ssh/config, this is all perfectly speedy.
--=20
Peter Oliver
---1463811583-218422156-1288027707=:3752--