X forwarding from a remote server to local machine#

Forwarding X from a remote server to your local machine is a very useful tool. It allows you to run graphical applications on a remote server and have them displayed on your local machine. This is useful when you want to run a graphical application on a remote server that you don’t have access to, or when you want to run a graphical application on a remote server that is not running a graphical desktop environment.

The command to forward X from a remote server to your local machine is:

ssh -X sunbird

This assigns a display number to the remote server and forwards the X11 protocol over the ssh connection.

[s.1915438@sl1(sunbird) ~]$ echo $DISPLAY
10.212.32.51:13.0

Now we load any graphical application like matlab.

[s.1915438@sl1(sunbird) ~]$ module load matlab/2022a
[s.1915438@sl1(sunbird) ~]$ matlab
MATLAB is selecting SOFTWARE OPENGL rendering.
Gtk-Message: 16:10:15.417: Failed to load module "canberra-gtk-module"

The application will be displayed on your local machine.

image-2.png

However, if the application strictly depends on gtk libraries, you might not be able to run it. Here, I attempted to run anaconda-navigator but it failed.

[s.1915438@sl2(sunbird) ~]$ module load anaconda/2023.09
[s.1915438@sl2(sunbird) ~]$ anaconda-navigator
2024-05-27 16:27:09,654 - WARNING linux_scaling.get_scaling_factor_using_dbus:32
An exception occurred during fetching list of system display settings.

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, minimal, minimalegl, offscreen, vnc, webgl, xcb.

Aborted

it might also not work if the 3d rendering libraries are too old.

[s.1915438@sl2(sunbird) ~]$ module load comsol/6.0
[s.1915438@sl2(sunbird) ~]$ comsol
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007feba1e51a7d, pid=12650, tid=12810
#
# JRE version: OpenJDK Runtime Environment Temurin-11.0.13+8 (11.0.13+8) (build 11.0.13+8)
# Java VM: OpenJDK 64-Bit Server VM Temurin-11.0.13+8 (11.0.13+8, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# C  [libcs3d_ogl.so+0x7a7d]
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /lustrehome/home/s.1915438/hs_err_pid12650.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/adoptium/adoptium-support/issues
#
/apps/local/tools/comsol/6.0/comsol60/multiphysics/bin/comsol: line 1951: 12650 Aborted                 ${MPICMD} ${FLROOT}/bin/${ARCH}/comsollauncher --launcher.ini ${LAUNCHERINIFILE} ${VMARGS} ${LAUNCHERARGS} ${MPILAUNCHERARGS} 2> >(grep -Ev "Gtk-WARNING|Gtk-CRITICAL|^$" >&2)
[s.1915438@sl2(sunbird) ~]$