[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using tramp to connect to a remote emacs session

From: Suvayu Ali
Subject: Re: Using tramp to connect to a remote emacs session
Date: Thu, 03 Sep 2009 09:01:42 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3

Hi Michael,

On Thursday 03 September 2009 06:08 AM, Michael Albinus wrote:
Suvayu Ali<address@hidden>  writes:

Hi everyone,


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)

   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:address@hidden:/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:address@hidden:~/file
emacsclient: connect: Connection refused
emacsclient: connected to remote socket at
Waiting for Emacs...

*ERROR*: Process died

And on the remote machine I get the following in the *Messages* buffer,

Tramp: Opening connection for address@hidden using ssh...
Tramp: Waiting 60s for local shell to come up...
Tramp: Sending command `ssh -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, 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.


Open source is the future. It sets us free.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]