Skip to content

Instantly share code, notes, and snippets.

@xaviermerino
Last active August 4, 2021 06:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xaviermerino/5bb83e0b471e67beaea6d5eeb80daf8c to your computer and use it in GitHub Desktop.
Save xaviermerino/5bb83e0b471e67beaea6d5eeb80daf8c to your computer and use it in GitHub Desktop.
Instructions to install xpra from source on a Raspberry Pi 2/3

Installing Xpra on a Raspberry Pi from Source

These are the steps to install xpra from source on a Raspberry Pi 2/3. I am assuming you are running Raspbian. I am running Raspbian Stretch with Desktop with kernel version 4.9.

In order to build Xpra we need to install some dependencies first:

sudo apt-get install -y libx11-dev libxtst-dev libxcomposite-dev \
libxdamage-dev libxkbfile-dev python-all-dev python-gobject-dev \
python-gtk2-dev cython xauth x11-xkb-utils xserver-xorg-video-dummy \
libx264-dev libvpx-dev python-lz4 python-lzo python-cryptography \
ethtool node-uglify yui-compressor

sudo pip install pyopengl pyopengl-accelerate rencode pyyaml \
netifaces websocket-client websockify pillow

Select a version of xpra you would like to compile from https://xpra.org/src/. I chose xpra-2.2.5.tar.xz.

wget https://xpra.org/src/xpra-2.2.5.tar.xz
tar xf xpra-2.2.5.tar.xz
rm xpra-2.2.5.tar.xz
cd xpra-2.2.5/
sudo python2 ./setup.py install

We now check where our Xorg is:

which Xorg

Mine was located at /usr/bin/Xorg. Now let's check which Xorg is xpra attempting to use. We will go do the following:

cat /usr/local/etc/xpra/conf.d/55_server_x11.conf | tail -n1

You should see an output like this:

xvfb = /usr/lib/xorg/Xorg -noreset -novtswitch -nolisten tcp +extension GLX +extension RANDR +extension RENDER -auth $XAUTHORITY -logfile ${XPRA_LOG_DIR}/Xorg.${DISPLAY}.log -configdir ${XDG_RUNTIME_DIR}/xpra/xorg.conf.d/$PID -config /usr/local/etc/xpra/xorg.conf

If that xvfb command is not invoking the right Xorg you must modify the file to point to the result of which Xorg. In my case, I had to modify it to say:

xvfb = /usr/bin/Xorg -noreset -novtswitch -nolisten tcp +extension GLX +extension RANDR +extension RENDER -auth $XAUTHORITY -logfile ${XPRA_LOG_DIR}/Xorg.${DISPLAY}.log -configdir ${XDG_RUNTIME_DIR}/xpra/xorg.conf.d/$PID -config /usr/local/etc/xpra/xorg.conf

Also, because of the Raspberry Pi's limited resources, getting an answer from displayfd might take more than the ten seconds specified as the standard timeout. In order to change this, you can start xpra like this:

XPRA_DISPLAY_FD_TIMEOUT=30 xpra start ...

Note that this is Raspbian specific although it might work in other distributions.

For more information visit this thread on the xpra tickets page.

@AdamWelch1
Copy link

Hey, I found your discussion here (https://www.xpra.org/trac/ticket/1777) after running into some issues getting Xpra to work properly on an RPi. The solution for my issue wasn't exactly the same as what you describe here, but it was pretty similar and your gist here gave me the nudge in the right direction to figure it out. So, I just wanted to thank you for taking the time to put this together. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment