Slicer on headless server

Copy tgz from slicer3d.org. The link in browser works, but doesn't get renamed with wget, so do it manually afterwards.

wget https://slicer-packages.kitware.com/api/v1/item/60add706ae4540bf6a89bf98/download
mv download Slicer-4.11.20210226-linux-amd64.tar.gz

From webpage, the revision number of the download was 29738. Typically, Slicer will first complain of missing libraries.

sudo apt-get install libglu1-mesa libpulse-mainloop-glib0

But later, an error like the following may be seen

Could not load the Qt platform plugin "xcb" in "" even though it was found

This is in fact the same error as above, save that it is a bit harder to decipher the missing libraries. Following suggestion re-run with QT_DEBUG_PLUGINS flag set:

export QT_DEBUG_PLUGINS=1
~/software/install/Slicer/Slicer

In my case, libxcb-icccm is missing:

Cannot load library /home/studen/software/install/Slicer-4.11.20210226-linux-amd64/lib/QtPlugins/platforms/libqxcb.so: 
  (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)

Install the missing libraries:

sudo apt-get install libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 
  libxcb-render-util0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0

XPRA, an X emulator

To run Slicer, an X11 incarnation is required. By default, processing PCs have no X11 interface, and an alternative is required.

sudo apt-get install xpra

XPRA has many interesting characteristics which makes it excellent to use as a dummy X server. See more in documentation. Usage examples:

  • Start slicer remotely. Connect via terminal to vangogh and start xpra first:
xpra start :210
~studen/software/install/Slicer/Slicer

Now use attach method below to connect to this session

  • Linux: start a new session from your laptop: xpra start ssh://vangogh/210 --start-child=/home/studen/software/install/Slicer/Slicer. Detach with Ctrl-C or using the system tray menu.
  • Linux: connect to running session from your laptop: xpra attach ssh://vangogh/210. This works for sessions started remotely or from your laptop.
  • Windows from laptop: Download installer and install. Run XPRA, select Connect and fill as shown below, username is your vangogh username:
ModeSSH
Serverusername @ 172.16.21.37:22
Display210
Command/home/studen/software/install/Slicer/Slicer

See [screenshot][image].

I used 210 to be consistent with *nx setup, but display should be unique. No password - rubens is configured to use ssh keys. Disconnect is hidden in system tray - right click on XPRA system tray icon reveals it. Disconnecting leaves the process running on vangogh and later the same session can be joined via Connect button - make sure you remember your display id

Notes on running xpra on Windows (developers)

For developers. A remote username must be configured and Slicer should be started in that remote unit to isolate it from other users. The remote unit must contain user credentials to access LabKey. Such credentials must be copied (once?) from local machine. This must be done using complicated tools like WinSCP, scp from command window or similar, that require coarse knowledge of *nix that might exceed users interest. Other data (images, etc.) are then loaded via LabKey. Ideal workflow - User starts xpra using the instructions above and gets an operating Slicer window which is in the background already connected to LabKey. Solution: the user directory comes with preloaded zip file, which is then imported via LabKey.

[image]: 'Screenshot at 2021-11-15 09-25-56.png'

  Attached Files  
   
 Screenshot at 2021-11-15 09-25-56.png

Discussion