Skip to content

Remote access with SSH

mviereck edited this page Sep 18, 2018 · 12 revisions

SSH X forwarding

You can run x11docker on remote servers with ssh -X like a regular X application.

SSH with xpra

SSH setup with xpra allows detaching and reattaching to a remote session.

Example for an SSH setup with xpra:

  • Server setup:
# run invisible Xvfb X server with display number :30.
# catch X environment with 'read < <(...)' construct.
# docker container runs on invisible new display.
read Xenv < <(x11docker --xvfb --display=30 --showenv x11docker/lxde pcmanfm)

# start xpra server with new environment variables.
# (replace "start" with "start-desktop" to forward a desktop environment)
env $Xenv xpra start :30 --use-display --start-via-proxy=no
  • Client setup:
# Attach xpra client over SSH to xpra server
xpra attach ssh:HOSTNAME:30     # replace HOSTNAME with IP or host name of ssh server

You can detach the SSH connection and attach later again without terminating the container application:

xpra detach ssh:HOSTNAME:30

You can stop xpra server without terminating x11docker:

xpra stop ssh:HOSTNAME:30

Warning: don't try this on localhost due to an xpra memory bug. On localhost, use xpra attach :30 instead.

Clone this wiki locally