I think one of the things unclear from the FAQ is the necessity that both server and client be resolveable from each other. You can see this thread from 2009. That said Eventually, this is howback then I gotdid get it to work, but now I do see the same as the OP. This is what I tried:
setup.el:
(require 'server)
(setq server-name "sx-test" ; name of the server
server-host "192.168.2.198" ; onlyserver ip resolution works at home
server-use-tcp t)
(server-start) ; comment out when using --daemon
Now on the remote machine, copyI copied the cookie as instructed in the FAQ, and attempted to start yourthe client like this:
$ emacsclient -f ~/.emacs.d/server/sx-test /ssh:[email protected].198200:/path/to/foo
Voilà!192.168.2.200 is the ip of the remote client. This is why both-way name resolution is necessary. Essentially, /ssh:[email protected]:/path/to/foo
is the tramp path you would give to server to edit remotely.
I see a failure just like the OP. I ran emacsclient
under gdb, and traced back the problem to a failure in connecting to the socket.
from emacsclient.c:
/* Set up the socket. */
if (connect (s, (struct sockaddr *) &server, sizeof server) < 0) /* <-- fails here */
{
#ifdef WINDOWSNT
if(!(w32_window_app () && alternate_editor))
#endif
sock_err_message ("connect");
return INVALID_SOCKET;
}
I then ran it under strace
, and see the following:
write(1, "emacsclient: connected to remote"..., 57emacsclient: connected to remote socket at 192.168.2.198
) = 57
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
connect(3, {sa_family=AF_INET, sin_port=htons(40266), sin_addr=inet_addr("192.168.2.198")}, 16) = -1 EHOSTUNREACH (No route to host)
write(2, "emacsclient: connect: No route t"..., 39emacsclient: connect: No route to host
) = 39
write(2, "emacsclient: error accessing ser"..., 80emacsclient: error accessing server file "/home/jallad/.emacs.d/server/sx-test"
) = 80
exit_group(1) = ?
+++ exited with 1 +++
At this point I'm not sure what is going wrong, as I can ping and ssh into the server.