title: emacsclient to access remote emacs server
body: <p>I'm trying to open an emacsclient session from a remote host. I walked through the following steps on the <a href="https://www.gnu.org/software/tramp/#Frequently-Asked-Questions" rel="nofollow">tramp website</a> How can I use TRAMP to connect to a remote Emacs session?. </p>
  
  <p>I'll walk you through the step</p>
  
  <ol>
  <li><p>on the remote host put in .emacs file</p>
  
  <pre><code>(require 'server)
  (setq server-host "&lt;IP ADDRESS of remoteHost&gt;"
        server-use-tcp t)
  (server-start)
  </code></pre></li>
  <li><p>start emacs session on remote host</p></li>
  <li><p>copy the ~/emacs.d/server/server from remoteHost to localHost keep the same path. (localHost:~/emacs.d/server/server)</p></li>
  <li><p>on local host emacs shell </p>
  
  <p>emacsclient  /ssh:test@remoteHost:/tmp/test.py</p></li>
  </ol>
  
  <p>But got the following error on my localHost</p>
  
  <pre><code>;; 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)
  </code></pre>
  
  <p>So it seems to connect to remoteHost but cannot find a route. Similar questions have been ask on SO.  <a href="https://stackoverflow.com/questions/2231902/originate-edit-of-remote-file-using-emacs-tramp-from-ssh-session">Here</a> and <a href="https://stackoverflow.com/questions/12978424/replacing-sshscreeneditor-with-emacs">here</a>. There are also some nice code about copying directly the ~/.emacs.d/server/server from remoteHost to localHost <a href="http://blog.habnab.it/blog/2013/06/25/emacsclient-and-tramp/" rel="nofollow">here</a>. </p>
  
  <p>Any help will be greatly appreciated.</p>