AFNI Windows Installation

Dear AFNI experts,

I am installing AFNI on Windows for AFNI bootcamp nextweek and everything installed fine but when opening AFNI, it keeps showing the error below and GUI is not opening (Xming is on).

Initializing: X11Error: Can’t open display:
** glob error: No such file or directory
** You may need to ‘setenv AFNI_SHELL_GLOB YES’
** In particular, if you are trying to access an NFS (network file
** system) mounted drive, you might be running into the situation
** where the NFS ‘cookie’ length on the remote system does not
** match the cookie length on your local system – this is the only
** situation in which we have ever seen this error. In that case,
** you can either set the environment variable as described above,
** or fix the cookie length mismatch by changing the way the NFS
** drive is exported.
** The following information from Graham Wideman of UCSD might also
** be helpful if you are reading this ‘glob error’ message:
** I’ve changed the NFS export settings on our Mac OS X 10.5 server
** to include the ‘-32bitclients’ option, and can confirm that
** this does cause AFNI to be able to see files that it could not
** see without this option. So this appears to be the more general
** way to fix the problem.
** For others in the same boat who may stumble on this message:
** It’s not at all obvious how to actually set this option,
** as OS X 10.5’s Server Admin NFS settings panels don’t have
** any way to do it.
** The short story is:
** You have to edit the /etc/exports file, as per usual in Unix,
** but decidedly not in line with all other SharePoint related
** settings in 10.5. But first, in order to have the edits not
** conflict with Server Admin management of those settings, you
** have to uncheck Server Admin’s ‘NFS Enabled’ checkbox for the
** relevant shares. Then, when editing the exports file, move
** the relevant lines outside the ‘Server Admin managed’ brackets,
** and add your options. In general, such options have to go in
** the middle section of a line; for example, after the path.
** Example:
** /Somedir -32bitclients -maproot=nobody -sec=sys -network -mask
++ AFNI is detached from terminal.

Also, below is the xterm result.
xterm: Xt error: Can’t open display:
xterm: DISPLAY is not set

Below is the result of -check_all result.

-------------------------------- general ---------------------------------
architecture: 64bit
system: Linux
release: 4.4.0-17134-Microsoft
version: #345-Microsoft Wed Sep 19 17:47:00 PST 2018
distribution: Ubuntu 18.04 bionic
number of CPUs: 4
apparent login shell: tcsh
shell RC file: .cshrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni : /home/won25/abin/afni
afni version : Precompiled binary linux_ubuntu_16_64: Sep 27 2018
: AFNI_18.2.19
AFNI_version.txt : AFNI_18.2.19, linux_ubuntu_16_64, Sep 27 2018
which python : /usr/bin/python
python version : 2.7.15rc1
which R : /usr/bin/R
R version : R version 3.4.4 (2018-03-15) – “Someone to Lean On”
which tcsh : /usr/bin/tcsh

instances of various programs found in PATH:
afni : 1 (/home/won25/abin/afni)
R : 1 (/usr/bin/R)
python : 1 (/usr/bin/python2.7)
python2 : 1 (/usr/bin/python2.7)
python3 : 1 (/usr/bin/python3.6)

testing ability to start various programs…
afni : success
suma : success
3dSkullStrip : success : success
3dAllineate : success
3dRSFC : success
SurfMesh : success
3dClustSim : success

checking for R packages…
rPkgsInstall -pkgs ALL -check : success

checking for $HOME files…
.afnirc : found
.sumarc : found
.afni/help/all_progs.COMP : found

------------------------------ python libs -------------------------------
++ module ‘PyQt4’ found at /usr/lib/python2.7/dist-packages/PyQt4
++ module loaded: PyQt4

-------------------------------- env vars --------------------------------
PATH = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Program:Files:(x86)/NVIDIA:Corporation/PhysX/Common:/mnt/c/Program:Files:(x86)/Intel/iCLS:Client:/mnt/c/Program:Files/Intel/iCLS:Client:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Program:Files/Hewlett-Packard/SimplePass:/mnt/c/Program:Files/Intel/Intel(R):Management:Engine:Components/DAL:/mnt/c/Program:Files:(x86)/Intel/Intel(R):Management:Engine:Components/DAL:/mnt/c/Program:Files/Intel/Intel(R):Management:Engine:Components/IPT:/mnt/c/Program:Files:(x86)/Intel/Intel(R):Management:Engine:Components/IPT:/mnt/c/Program:Files/Intel/WiFi/bin:/mnt/c/Program:Files/Common:Files/Intel/WirelessCommon:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Users/user-pc/AppData/Local/Microsoft/WindowsApps:/home/won25/abin

R_LIBS = /home/won25/R


------------------------------ data checks -------------------------------
data dir : missing AFNI_data6
data dir : missing AFNI_demos
data dir : missing suma_demo
data dir : missing afni_handouts
atlas : found TT_N27+tlrc under /home/won25/abin

------------------------------ OS specific -------------------------------
which apt-get : /usr/bin/apt-get
apt-get version : apt 1.6.3 (amd64)

have Ubuntu system: Ubuntu 18.04 bionic
have Ubuntu afni : Precompiled binary linux_ubuntu_16_64: Sep 27 2018

========================= summary, please fix: =========================

  • insufficient data for AFNI bootcamp

Could you please advise on this?


Hi, Jun-

Did you install the Xserver as described here:

and, importantly, do you following this note when starting Ubuntu from Windows:

From here on out, whenever you start up your WSL Ubuntu, you will need to double-click on the VcXsrv icon on your Desktop in order to start the X Server. (Sorry, not our design!)


Finally, what is the output when you enter this in your terminal:




Hi pt,

Thanks for the quick reply. Yes, Xserver is on when starting Ubuntu, but it is not still working. Below is the output of echo $DISPLAY.

JunyeonWon:~> echo $DISPLAY
DISPLAY: Undefined variable.

Thank you,

Hm, that is odd. Please redo these copy+paste commands from the instructions:

echo "export DISPLAY=:0.0" >> ~/.bashrc
echo "setenv DISPLAY :0.0" >> ~/.cshrc

and then type

source ~/.cshrc

to source your RC file (it appears tcsh is your default shell).

THen please try:




Thanks again for the response. The output looks like the below.

JunyeonWon:~> echo “export DISPLAY=:0.0” >> ~/.bashrc
JunyeonWon:~> echo “setenv DISPLAY :0.0” >> ~/.cshrc
JunyeonWon:~> source ~/.cshrc
JunyeonWon:~> echo $DISPLAY

After trying this I opened AFNI, it works. Thank you so much!


Just to point out that the Xming server software has some problems with a couple parts of the AFNI interface like the whereami menu. We recommend using VcXsrv as your X11 server on your Windows PC instead.