From what I understand, gvim is an X-window application, so it's possible to start the application remotely and be connected to the window via SSH. Is it possible to connect to an existing gvim window when you ssh into a machine running the gvim process?

I am trying to connect to my gvim session on an Ubuntu machine from my OSX laptop.

link|improve this question

73% accept rate
feedback

1 Answer

up vote 3 down vote accepted

You cannot connect to an existing X11 display with plain ssh. To move the window to a different X11 display, you will have to use xpra. (gVim must be started inside xpra for it to work.)

Ubuntu:

xpra start :100
DISPLAY=:100 gvim

Mac (if it has xpra installed too):

xpra attach ssh:ubuntubox:100

Mac (if it doesn't have xpra):

ssh -Y ubuntubox "xpra attach :100"
link|improve this answer
Thanks, works great! – vonhogen Nov 8 '11 at 2:35
Is there any performance difference between the 1st and 2nd option (i.e. having xpra or not on the mac)? – vonhogen Nov 8 '11 at 2:48
Possibly. #2 uses raw X11 over SSH, which is somewhat slow. #1 is supposed to use xpra's optimized protocol over SSH. – grawity Nov 8 '11 at 7:45
feedback

Your Answer

 
or
required, but never shown

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