[slime-devel] remote connection difficulties

Helmut Eller heller at common-lisp.net
Wed Dec 29 08:17:42 UTC 2010


* Philippe Sismondi [2010-12-29 06:09] writes:

> Greetings. I am attempting to connect from aquamacs emacs + slime on my Mac
> to a remote lisp on Ubuntu 10.10. These machines are both on my LAN.
>
> On the Mac I am using ccl 1.6 64-bit, with the slime/swank provided by
> aquamacs as of yesterday. This is described on the aquamacs site as
> Aquamacs-slime-2010-12-28.pkg.tgz.
>
> On Ubuntu 10.10 I am using ccl 1.7 32-bit, with yesterday's FAIRLY-STABLE
> slime/swank.

Some day I have to update the FAIRLY-STABLE tag.  Please use HEAD in the
meantime.

> I followed the instructions in the slime manual to connect locally on both
> machines. That is, I can start ccl in a terminal, fire up a swank server, and
> then connect from emacs/aquamacs by means of M-x slime-connect to the server
> on the same machine.
>
> On Ubuntu, I have an ssh server running. I can log in from the Mac to Ubuntu
> over ssh with no problems.
>
> In a terminal on my Mac I do the incantation suggested in the slime manual
> p.26, i.e.
>
>   ssh -L4005:127.0.0.1:4005 david at 10.0.1.6
>
> The result of keying in the above is that I get a prompt for a password, and
> an apparently successful connection to the Ubuntu machine. It does open up a
> "visible" ssh session, i.e. I see an ubuntu prompt in my Mac terminal. It
> looks just like a regular ssh login; I don't know if that is what is
> expected.

Yes, this is expected.  You can see a little more what's going with the
-v flag:  ssh -v -L4005:127.0.0.1:4005 david at 10.0.1.6 

Also typing "~#" resp. "~?" is useful for debugging.

> However, when I then do M-x slime-connect in aquamacs and connect to
> 127.0.0.1 port 4005 I get this message in aquamacs:
>
>   Lisp connection closed unexpectedly: connection broken by remote peer.
>
> And in the ssh terminal session on the Mac to Ubuntu I see this:
>
>   channel 3: open failed: connect failed: Connection refused

This usually means that Swank is not listening on the remote
machine (Ubuntu).  

On Linux, the command: netstat -tlp 
will list the open ports and there should be a line like:

 Proto Recv-Q Send-Q Local Address   Foreign Address State  PID/Program name
 tcp        0      0 localhost:4005  *:*             LISTEN 12522/ccl       


If netstat is not available you can also use: telnet 127.0.0.1 4005
to see if you can connect.

>
> I know *nothing* about ssh, or for that matter networking generally. For
> example, I have no idea why we need to "fool" emacs into thinking it is
> talking to 127.0.0.1. 

This is just a security measure. Swank only listens for connections from
the local machine an not from the whole internet.  You could change that
but the ssh approach works pretty well usually. 

> However, this appears to me to be an ssh problem, as a
> wild guess.
>
> Any suggestions? Does the failure to connect have anything to do with ccl/
> swank/slime, or do I have some ssh pondering to do?

More likely an ssh problem.

> If I should be attaching some kind of log or other info that I do not know
> about, please let me know.

If you can't figure out the problem, show us the output of ssh -v and
netstat.

Helmut





More information about the slime-devel mailing list