Ssh Connect to Existing Gvim Window

Ssh Connect to Existing Gvim Window

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.

1 Answer

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"
4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.