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
on the remote host put in .emacs file
(require 'server) (setq server-host "<IP ADDRESS of remoteHost>" server-use-tcp t) (server-start)
start emacs session on remote host
copy the ~/emacs.d/server/server from remoteHost to localHost keep the same path. (localHost:~/emacs.d/server/server)
on local host emacs shell
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:
;; --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.
Update I have gathered some more information about the matter. It's seem that a number of people have attempted this task and some seems to have succeeded but I could find any solution to my specific problem. Using Emacs server and emacsclient on other machines as other users
Similar questions have also been ask on emacs.stack.exchange like how-do-i-use-emacsclient-to-connect-to-a-remote-emacs-instance
There is an interesting post here forwarding graphics with ssh. It's easy to implement and works pretty well if your connection is good enough but it does not make use of tramp.