2

I'm trying to connect to a remote Emacs server. I created the server with server-use-tcp set to t so a connection file was created. I inspected the connection file and found out that it contains the IP and address socket port, the PID and an auth token

127.0.0.1:41507 6843   
<SECRET>

and then I

  1. copied (via scp) the connection file to my local pc
  2. forwarded the server port vie ssh -L ssh -L 41507:127.0.0.1:41507 remote

and now when I do

emacsclient  -f ~/.emacs.d/server/server test-buffer

The buffer is really opened in the remote server process.

However, I cannot find a way to make emacsclient create a frame. If I use -c I get

Waiting for Emacs...
*ERROR*: Display :0 can't be opened

and with -t it just hangs, does not even print Waiting for Emacs.

I know similar questions have been asked, but I'm trying to do this without TRAMP, because I'm mostly interested in the fast access time and processing resources on the remote server.

  • 3
    Possible duplicate of [How do I use emacsclient to connect to a remote emacs instance?](http://emacs.stackexchange.com/questions/371/how-do-i-use-emacsclient-to-connect-to-a-remote-emacs-instance) –  Jan 01 '16 at 13:20
  • 2
    Not really, because this question is about making emacsclient open a new remote frame, the other question is more general and does not explain why this won't work. – Ondřej Grover Jan 01 '16 at 16:47

1 Answers1

6

You cannot useemacsclient this way. The Emacs Server does not create frames on the client side; it always creates them on the server-side X11 display or TTY, but the remote server doesn't have access to your local client side TTYs or X11 displays.

The TCP connection of Emacs server is not intended for remote access, it's just a work around for the lack of local sockets in some operating systems (i.e. Windows).

  • Thank you for confirming my suspicion. Oh well, too bad. Guess I'll just have to use X2Go or NX. – Ondřej Grover Jan 01 '16 at 13:20
  • This is a pity. Using emacsclient this way sounded so much more tempting than doing SSH display forwarding and then starting `emacsclient -c` remotely on my local display. – Axel Beckert Apr 11 '18 at 14:59