cisTEM detaching and re-attaching sessions¶
In cisTEM when you close the main window, all running jobs are terminated. Xpra is a window server that saves the state of graphical applications so that you can detach from your cisTEM session and have it run in the background.
https://xpra.org/ “Xpra is an open-source multi-platform persistent remote display server and client for forwarding applications and desktop screens. … it allows you to run programs, usually on a remote host, direct their display to your local machine, and then to disconnect from these programs and reconnect from the same or another machine, without losing any state.”
Installing Xpra on Linux¶
1. Download the Xpra repository information into your system’s package manager folder.
For our Centos 7 system,
sudo bash -c "curl https://xpra.org/repos/CentOS/xpra.repo > /etc/yum.repos.d/xpra.repo"
Xpra also supports Fedora, Debian, and Ubuntu. For Debian and Ubuntu, the package manager folder is /etc/apt/sources.list.d
For Centos and Fedora,
sudo yum install xpra
For Debian and Ubuntu,
sudo apt install xpra
Log into the cisTEM computer from your remote computer. You will need less strict X forwarding with the -Y option.
ssh -Y username@ipaddress
Start a cisTEM process using xpra. You will need to choose a sessionID number. I arbitrarily chose 100.
xpra start :100 --start-child=cisTEM
Hit enter one more time, and now the session has been created in the background. You will have to attach to it.
Attach to the session. From the cisTEM computer,
xpra attach :100
and the cisTEM window should open. If there is only one session, you don’t need the :100
4. Detach from the session. From the command line, hit Ctrl-C and the window will disappear.
when re-attaching: Usually remote connections from outside the local network are laggy. Fortunately, Xpra has compressions to lessen the amount of bandwidth. To enable compression when reattaching, do
xpra attach --encoding=rgb --compress=1
This is the recommended way from Xpra.org.