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 6843   

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: 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.


1 Answer 1


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. Commented Jan 1, 2016 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. Commented Apr 11, 2018 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.