Bundle file creation

Dear Slicer users,

I use Slicer CLI modules as pilar of a pipeline executed in a Ubuntu server from a web page located in an Apache Tomcat hosted by that server.

I would like to create a mrb file containing the scene to be used but when I invoke Slicer for this purpose I’m having a "SlicerApp-real: cannot connect to X server " message.

Is it possible to do this task without opening the GUI?

Thanks in advance.

PS: This is the sentence that I use:
Slicer --no-splash --python-script composeScene.py -i file1.nii … -i fileN.nii -o output.mrb >> scriptPython.log. The script just loads all the input files and set a few details about the window location which are not essential.

Try with adding --no-main-window parameter. You can also configure a dummy x server.

Thank you @lassoan for your fast reply.

–no-main-window returns the same message. I’ll try to learn how to set up that dummy x server.

Thank you again, I’ll keep you informed about the result.


This is a good place to start:


Here’s a docker container that sets it up the server as an example:

Thank you @ihnorton and @pieper for your kind replies.

I solved the problem installing xvfb package. I just need to run Slicer this way:
xvfb-run -s “-screen 0 1024x768x24” Slicer …

xvfb-run sets the dummy X server, redirects the graphical output to it and closes it when slicer is close.

Thanks for your support.

Hi Felix

i have the same pb with google clooud
did you just intall xvfb
whats the whole command used to run slicer
xvfb-run -s “-screen 0 1024x768x24” Slicer