Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

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"
share|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
1  
#2 is an order of magnitude slower, bordering on unusable - don't bother, mac builds are available –  totaam Oct 16 '13 at 3:34
    
btw, in recent versions, you can do it all in one command: "xpra start ssh:HOST:DISPLAY --start-child=gvim" –  totaam Dec 10 at 5:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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