From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Suvayu Ali Newsgroups: gmane.emacs.help Subject: Re: Using tramp to connect to a remote emacs session Date: Thu, 03 Sep 2009 09:01:42 -0700 Message-ID: <4A9FE866.8040805@gmail.com> References: <4A9EFA5A.1030002@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1251994319 17726 80.91.229.12 (3 Sep 2009 16:11:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Sep 2009 16:11:59 +0000 (UTC) Cc: Emacs mailing list To: Michael Albinus Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 03 18:11:52 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MjEuV-0001SK-41 for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Sep 2009 18:11:44 +0200 Original-Received: from localhost ([127.0.0.1]:37250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjEuU-0006Fm-8g for geh-help-gnu-emacs@m.gmane.org; Thu, 03 Sep 2009 12:11:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjEkz-0002WC-C3 for help-gnu-emacs@gnu.org; Thu, 03 Sep 2009 12:01:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MjEkt-0002Re-Cf for help-gnu-emacs@gnu.org; Thu, 03 Sep 2009 12:01:52 -0400 Original-Received: from [199.232.76.173] (port=43323 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjEkt-0002RQ-7z for help-gnu-emacs@gnu.org; Thu, 03 Sep 2009 12:01:47 -0400 Original-Received: from mail-pz0-f175.google.com ([209.85.222.175]:59913) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjEks-00009H-Jd for help-gnu-emacs@gnu.org; Thu, 03 Sep 2009 12:01:46 -0400 Original-Received: by pzk5 with SMTP id 5so29584pzk.10 for ; Thu, 03 Sep 2009 09:01:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=+e5ePz9l6xqPyPqOWu7lRauMq9CfpNGA0ouVjlFECNc=; b=bqrHVXqep2rdDKc3/jwWCFE+MLYfdRm0cpy27OfTTGEtvdDzM1YZPdmOfSf/bz/4UH /MKhebnkLtBa4Cb+Hd2f+oxG4LTQB0thGFRWa4uKD1GroXNgCSKU8z2UF8Ewp70DDxEf MMnCFYzdhICHihEkWkKtvHFPYdV6L/mjiKOpI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=lDQFY0WBLx7Hu2hDdXsEH0UejBiHrkPnAg6+gnfgWsai7rkQpS4y0h8SzTYfBI3/xd Fut2UtzVW6hz195lAV7brsIeuQJPu18iQcOUijoGoIpECt10bxjJFEcTfgxr43j4LIye tI0u6b1mW63KwPnidcljjyLskD2PMbkSjYrtU= Original-Received: by 10.114.162.38 with SMTP id k38mr8458743wae.138.1251993705311; Thu, 03 Sep 2009 09:01:45 -0700 (PDT) Original-Received: from bhishma.kuru (d66-183-43-146.bchsia.telus.net [66.183.43.146]) by mx.google.com with ESMTPS id 23sm25696pzk.4.2009.09.03.09.01.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 03 Sep 2009 09:01:44 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3 In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:67805 Archived-At: Hi Michael, On Thursday 03 September 2009 06:08 AM, Michael Albinus wrote: > Suvayu Ali writes: > >> Hi everyone, > > Hi, > >> I usually have to connect to my lab using tramp (tramp-default-method is >> ssh) when I am working from home. Since I go back and forth a lot, I >> have to start a session every time. Is it possible for me to run >> emacs-server on my lab machine and connect to that using tramp from my >> home? That would save me a lot of time (mostly annoyance though ;) ) in >> starting a new session. > > Since you are not the first one who has asked, I've just added the > following to the Tramp manual (Frequently Asked Questions): > I think I went through that section but could not figure out how to get the server file. That became clear as soon I saw your little code snippet. :) > --- > * How can I use TRAMP to connect to a remote GNU Emacs session? > > You can configure Emacs Client doing this. On the remote host, > you start the Emacs Server: > > (require 'server) > (setq server-host (system-name) > server-use-tcp t) > (server-start) > > Make sure, that the result of `(system-name)' can be resolved on > your local host; otherwise you might use a hard coded IP address. > > The resulting file `~/.emacs.d/server/server' must be copied to > your local host, at the same location. You can call then the > Emacs Client from the command line: > > emacsclient /ssh:user@host:/file/to/edit > > `user' and `host' shall be related to your local host. Correct me if I go wrong, when I issue that command emacsclient tells the remote server to connect with the localhost over tramp. It determines where the remote server is from the server file. My problem is my ISP at the local machine doesn't allow me to login to it from outside. In other words I probably don't have a static ip. So when I issue the command I get, > $ emacsclient /ssh:user@local.host:~/file > emacsclient: connect: Connection refused > emacsclient: connected to remote socket at xxx.xx.xxx.xx > Waiting for Emacs... > > *ERROR*: Process died And on the remote machine I get the following in the *Messages* buffer, > Tramp: Opening connection for user@local.host using ssh... > Tramp: Waiting 60s for local shell to come up... > Tramp: Sending command `ssh local.host -l user -q -e none && exit || exit' > Tramp: Waiting for prompts from remote shell > File error: Process died So to summarize my problem is I can only connect one way, local.host to remote machine, and hence tramp fails to work. Does this mean the only way I will get this working is to get my ISP to give me a static ip? Thanks for the help so far Michael. Much appreciated. -- Suvayu Open source is the future. It sets us free.