Headless installation does not work

Thank you very much for your reply.

Today I tried some time more, so I would like to avoid installing other things on the server so I went with two moethods, one is trying to use jupyter notebooks, like specified here: Using MNE with 3D visualization on a headless server - :speech_balloon: Support & Discussions - MNE Forum which kled me here: Little tour of MNE features with the ipyvtk backend (github.com). I adjusted my code according to what is described in this file (added these imports)

import mne
from mne.io import read_raw_egi
from pathlib import Path

%matplotlib inline
mne.viz.set_3d_backend('notebook')  # set the 3d backend

And performed the required steps to connect.

With this it simpy crashes, the last line printed is: Using qt as 2D backend.

The log is:

11:29:53.118 [info] Started session for kernel startUsingPythonInterpreter:.jvsc74a57bd066a4a0c7835b3b395ee935744816daaccaca5621985777d7a7ca94a222dfad18./home/~/miniconda3/envs/mne/python./home/~/miniconda3/envs/mne/python.-m#ipykernel_launcher
11:29:53.350 [info] Process Execution: ~/miniconda3/envs/mne/bin/python /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.4.0-linux-x64/pythonFiles/printJupyterDataDir.py
11:30:01.626 [error] Error in waiting for cell to complete [Error: Canceled future for execute_request message before replies were done
	at Qr.dispose (/home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.4.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:22379)
	at /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.4.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:41058
	at Map.forEach (<anonymous>)
	at n._clearKernelState (/home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.4.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:41044)
	at /home/~/.vscode-server/extensions/ms-toolsai.jupyter-2024.4.0-linux-x64/dist/node_modules/@jupyterlab/services.js:11:43455
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)]
11:30:01.627 [warn] Cell completed with errors {
  message: 'Canceled future for execute_request message before replies were done'
}

The other method is using X- forwarding. With theis method I keep getting the same error described in the post.

Would it be possible for you to elaborate on how I can connect to it using the -X option when using ssh? Or do you have any Idea on why the jupyter kernel crashes?

Thank you very much in advance,