It's super-easy. I run Emacs in daemon mode (start "emacs --daemon") but this isn't required; if you don't do that you need to start the Emacs server yourself in your ~/.emacs file, or run M-x start-server by hand.
Then if your system running Emacs is named "server", just run:
ssh -X server emacsclient -c
The -c tells Emacs to create a new graphical frame, and since you're using ssh it will forward the display securely back to your local desktop.
Posted Feb 15, 2013 14:16 UTC (Fri) by hummassa (subscriber, #307)
[Link]
This is actually a nice and useful tip. Thanks and kudos!
Remote desktop vs. remote display
Posted Feb 15, 2013 23:39 UTC (Fri) by jimparis (subscriber, #38647)
[Link]
Typo: the command is M-x server-start
Remote desktop vs. remote display
Posted Feb 17, 2013 6:14 UTC (Sun) by daglwn (subscriber, #65432)
[Link]
Well, almost:
Waiting for Emacs...X11 connection rejected because of wrong authentication.
*ERROR*: Display localhost:30.0 can't be opened
Any ideas?
Remote desktop vs. remote display
Posted Feb 18, 2013 16:15 UTC (Mon) by madscientist (subscriber, #16861)
[Link]
I'm not sure LWN comments are the best place for a support conversation :-), but can you run other remote X operations (for example, can you run "ssh -X server xterm" and have the xterm show up locally)?
Remote desktop vs. remote display
Posted Feb 18, 2013 21:01 UTC (Mon) by daglwn (subscriber, #65432)
[Link]
Yep, xterm works fine remotely.
Remote desktop vs. remote display
Posted Feb 18, 2013 21:03 UTC (Mon) by daglwn (subscriber, #65432)
[Link]
Posted Feb 19, 2013 13:26 UTC (Tue) by madscientist (subscriber, #16861)
[Link]
Hm. The original problem definitely sounded exactly like yours. However following the links to the recommended solution, I don't see how tramp is related. Anyway this looks way more complex; I certainly have never needed to copy a file like ~/.emacs.d/server/server to my local host. Things Just Work, with no extra help. If xterm works then it's probably not an issues with Xauthority etc. It seems bizarre to me but I suppose it could be a hostname thing. If on the server you say "ping server" does it work and give you a real IP address (not 127.0.0.1)? If on your client you say "ping server" does that work and give back the same IP address?
Have you tried starting Emacs in --daemon mode rather than using start-server? What version of Emacs do you have?