Error in FLUKA/Flair installation on WSL

I have run the following cmd to install fluka/flair

Started PowerShell as Administrator and run the following command:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Then installed Ubuntu 20.04 LTS and Xming. Then floowing cmd were run in ubuntu after setting UNIX username and passward.

cp /mnt/c/ ./
sudo ./

gfortran --version

cp /mnt/c/fluka_4-0.1.Linux-gfor7_amd64.deb ./
sudo dpkg -i fluka_4-0.1.Linux-gfor7_amd64.deb

But still can not run flair as following error occurred

nadeera_2020@LAPTOP-IDGQKFD1:~$ flair
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused

( Gdk-CRITICAL **: 14:13:43.148: gdk_cursor_new_for_display: assertion ‘GDK_IS_DISPLAY (display)’ failed
no display name and no $DISPLAY environment variable

then following cmd run: export DISPLAY=:0

but when open flair,

it displays an error ’ Cannot find fluka executable ‘fluka’ please set the correct Fluka directory in preference’

and following error occurs:

I am new user to fluka/flair. I would be very thankful, if anyone can help to solve this.

i tried gfor9 as well. same error occured.

Dear Nadeera,

  1. For Ubuntu 20.04 the gfor9 package should be installed.

  2. The DISPLAY environment variable should be automatically set, you need to restart Ubuntu after running the setup script.

  3. Similarly the directory of the FLUKA installation is added to PATH automatically, after restarting Ubuntu.

If after restarting Ubuntu the problem still persists, please let us know.


Dear David,

Thank you very much for the instructions. I was able to install it successfully.
But still have error with plotting.

I tried one of the tutorial in CERN website (n_TOF). when the run button pressed, ‘finish with errors’ appears and in the plot section followings error occurs: as shown in the sceenshot

‘incompatible gfortan version’. Do I need to install another gfortan version?

Dear Nadeera,

you need to install the correct FLUKA package. For gfortran 8 you need to use the gfor9 package of FLUKA.


Dear David,
Many thanks for the guidelines.