Skip to main content
Fix dead link to Gmane (it permanently went down, redirecting to the mailman archives)
Source Link
suvayu
  • 1.7k
  • 11
  • 17

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 threadthis thread from 2009. Eventually, back then I did get it to work, but now I do see the same as the OP. This is what I tried:

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. Eventually, back then I did get it to work, but now I do see the same as the OP. This is what I tried:

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. Eventually, back then I did get it to work, but now I do see the same as the OP. This is what I tried:

Bounty Ended with 50 reputation awarded by Gilles 'SO- stop being evil'
added 1619 characters in body
Source Link
suvayu
  • 1.7k
  • 11
  • 17

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.

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, this is how I got it to work:

(require 'server)

(setq server-name "sx-test"       ; name of the server
      server-host "192.168.2.198" ; only ip resolution works at home
      server-use-tcp t)

(server-start)                    ; comment out when using --daemon

Now on the remote machine, copy the cookie as instructed in the FAQ, and start your client like this:

$ emacsclient /ssh:[email protected].198:/path/to/foo

Voilà!

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. Eventually, back then I did 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" ; server ip
      server-use-tcp t)

(server-start)                    ; comment out when using --daemon

Now on the remote machine, I copied the cookie as instructed in the FAQ, and attempted to start the client like this:

$ emacsclient -f ~/.emacs.d/server/sx-test /ssh:[email protected].200:/path/to/foo

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.

remove strikethrough
Source Link
suvayu
  • 1.7k
  • 11
  • 17

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, this is how I got it to work:

(require 'server)

(setq server-name "sx-test"       ; name of the server
      server-host "192.168.2.198" ; only ip resolution works at home
      server-use-tcp t)

(server-start)                    ; comment out when using --daemon

I started the server like this:

$ emacs -Q -l setup.el

This will give you an Emacs window though. If you do not want that, comment out the (server-start) line, and start Emacs like this:

$ emacs -Q -l setup.el --daemon

Now on the remote machine, copy the cookie as instructed in the FAQ, and start your client like this:

$ emacsclient /ssh:[email protected]:/path/to/foo

WallahVoilà Voilà!

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, this is how I got it to work:

(require 'server)

(setq server-name "sx-test"       ; name of the server
      server-host "192.168.2.198" ; only ip resolution works at home
      server-use-tcp t)

(server-start)                    ; comment out when using --daemon

I started the server like this:

$ emacs -Q -l setup.el

This will give you an Emacs window though. If you do not want that, comment out the (server-start) line, and start Emacs like this:

$ emacs -Q -l setup.el --daemon

Now on the remote machine, copy the cookie as instructed in the FAQ, and start your client like this:

$ emacsclient /ssh:[email protected]:/path/to/foo

WallahVoilà!

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, this is how I got it to work:

(require 'server)

(setq server-name "sx-test"       ; name of the server
      server-host "192.168.2.198" ; only ip resolution works at home
      server-use-tcp t)

(server-start)                    ; comment out when using --daemon

I started the server like this:

$ emacs -Q -l setup.el

This will give you an Emacs window though. If you do not want that, comment out the (server-start) line, and start Emacs like this:

$ emacs -Q -l setup.el --daemon

Now on the remote machine, copy the cookie as instructed in the FAQ, and start your client like this:

$ emacsclient /ssh:[email protected]:/path/to/foo

Voilà!

Correct concluding remark
Source Link
suvayu
  • 1.7k
  • 11
  • 17
Loading
added 181 characters in body; edited body
Source Link
suvayu
  • 1.7k
  • 11
  • 17
Loading
Source Link
suvayu
  • 1.7k
  • 11
  • 17
Loading