Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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


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
#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 '14 at 5:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .