I've been trying to get xpra to run on OS X for the last few days to connect to my Ubuntu server. Note that there's a GUI for it called shifter, but that (at least on OS X) is still far too buggy.

For those who don't know what xpra is, if you know what screen is, it's like screen for GUI X Windows apps tunneled over ssh. You can render a remote X app locally so it's faster than sending a series of compresses screen shots (like VNC), but with xpra you can disconnect and reconnect on different computers. To get the basic functionality you can just type "ssh -X server.location" and any GUI app you open from the command line will open locally.

I've been able to get xpra to build by doing the following:

  1. Download pari-all-0.0.6.tar.gz from the xpra site listed under upstream and untar it.
  2. Issue the following Mac Ports command (Dependencies thanks to RogBlog): sudo port install python25 python26 py26-pyrex py26-gtk xorg-libXtst py25-gobject py25-gtk py25-nose py26-nose xorg-libXdamage xorg-libXcomposite xorg-libXtst xorg-libXfixes
  3. In the upstream list of v0.0.06 patches (NOT 0.0.8pre!) on the xpra site listed above, download mswindows-conditional-pyrex.patch.
  4. Open the patch with your favorite text editor and change the single occurrence of "win" in it to "darwin".
  5. Apply the patch to setup.py.
  6. Run do-build in the command line.

Now where I'm stumped: how do I run xpra? The build produces a sub directory called install/bin in which xpra is located, but when I try to run it I get the following error:

Traceback (most recent call last):
  File "./xpra", line 4, in <module>
    import xpra.scripts.main
ImportError: No module named xpra.scripts.main

There is a file called main.py under xpra/scripts, but I don't know any python and I'm not sure if this is what it's looking for, and what to do with it even if it is.

My goal is to set up xpra so I can install it into /usr/bin (or some other common path for executables) and execute it whenever I please. What do I do next?


Now (as of March 2016) available via 'brew install Caskroom/cask/xpra'

  • 2
    Quick note that this version doesn't include the server, just the client. – Andy Nov 2 '17 at 19:44

The most usable version on OSX is via gtk-osx, you can follow the build instructions for winswitch (aka shifter) here but skip some steps if you want:

  • Requirements: yes, you need that
  • jhbuild: yes, that's what will install gtk-osx
  • gtk-osx: the OSX native GTK port
  • GStreamer: skip this (not used by Xpra)
  • ige-mac-bundler: skip this (not going to build an installer)
  • Python dependencies: skip this - not needed by Xpra
  • Build Protocol Support: Yes, just follow the xpra instructions

After that, your "jhbuild shell" will contain an xpra installation ready to use: the python scripts it has created should be on your PATH.

Alternatively, you can try with the version of Python shipped with OSX, but I don't know how well that works, if at all... The page linked above also has a link to the macports build version (you may skip the unnecessary steps which will be similar to the ones above)

Edit: the latest version also includes a PKG installer.


You can use Homebrew with a user-supplied tap:

$ brew tap victor-ono/homebrew-xpra
$ brew install xpra

Your Answer

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

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