3

I'm trying to open an emacsclient session from a remote host. I walked through the following steps on the tramp website How can I use TRAMP to connect to a remote Emacs session?.

I'll walk you through the step

  1. on the remote host put in .emacs file

    (require 'server)
    (setq server-host "<IP ADDRESS of remoteHost>"
          server-use-tcp t)
    (server-start)
    
  2. start emacs session on remote host

  3. copy the ~/emacs.d/server/server from remoteHost to localHost keep the same path. (localHost:~/emacs.d/server/server)

  4. on local host emacs shell

    emacsclient /ssh:test@remoteHost:/tmp/test.py

But got the following error on my localHost

;; emacsclient: can't find socket; have you started the server?
;; To start the server in Emacs, type "M-x server-start".
;; emacsclient: connected to remote socket at `Remotehost`
;; emacsclient: connect: No route to host
;; emacsclient: No socket or alternate editor.  Please use:

    ;; --socket-name
    ;; --server-file      (or environment variable EMACS_SERVER_FILE)
    ;; --alternate-editor (or environment variable ALTERNATE_EDITOR)

So it seems to connect to remoteHost but cannot find a route. Similar questions have been ask on SO. Here and here. There are also some nice code about copying directly the ~/.emacs.d/server/server from remoteHost to localHost here.

Any help will be greatly appreciated.

DJJ
  • 2,481
  • 2
  • 28
  • 53

0 Answers0