Problem installing/opening AFNI

First of all, I would like to thank everyone for even reading this topic.
I am an university student trying to install and learn to use AFNI. I have done everything exactly as the Ubuntu version 22.04 installation instructions say and can run sudo ls.
The version I am using is AFNI_25.1.00.
Whenever I try to use afni, I get a message like

Precompiled binary linux_ubuntu_16_64: Apr  6 2025 (Version AFNI_25.1.00 'Maximinus')
** Version check disabled: AFNI_VERSION_CHECK forbids
Thanks go to M Huerta for much encouragement
Initializing: X11Error: Can't open display: :0.0 
++ AFNI is detached from terminal.   

The full log when I do a system check is as follows:

-------------------------------- general ---------------------------------
architecture:         64bit ELF
cpu type:             x86_64
system:               Linux
release:              5.10.16.3-microsoft-standard-WSL2
version:              #1 SMP Fri Apr 2 22:23:49 UTC 2021
distribution:         ubuntu 22.04 Jammy Jellyfish
number of CPUs:       8
user:                 jan_czarnecki
apparent login shell: bash
shell RC file:        .bashrc (exists)

--------------------- AFNI and related program tests ---------------------
which afni           : /home/jan_czarnecki/abin/afni
afni version         : Precompiled binary linux_ubuntu_16_64: Apr  6 2025
                     : AFNI_25.1.00 'Maximinus'
AFNI_version.txt     : AFNI_25.1.00, linux_ubuntu_16_64, Apr 06 2025, official
which python         : /usr/bin/python
python version       : 3.10.12
which R              : /usr/bin/R
R version            : R version 4.4.3 (x86_64-pc-linux-gnu)

instances of various programs found in PATH:
    afni    : 1   (/home/jan_czarnecki/abin/afni)
    R       : 1   (/usr/bin/R)
    python  : 1   (/usr/bin/python3.10)
    python2 : 0
    python3 : 1   (/usr/bin/python3.10)

testing ability to start various programs...
    afni                 : success
    suma                 : success
    3dSkullStrip         : success
    3dAllineate          : success
    3dRSFC               : success
    SurfMesh             : success
    3dClustSim           : success
    build_afni.py        : success
    uber_subject.py      : success
    3dMVM                : success
    rPkgsInstall         : success

------------------------ dependent program tests -------------------------
checking for dependent programs...

which tcsh           : /usr/bin/tcsh
tcsh version         : 6.21.00
which Xvfb           : /usr/bin/Xvfb

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

R RHOME : /usr/lib/R

------------------------------ python libs -------------------------------

++ module loaded: matplotlib.pyplot
   module file : /usr/lib/python3/dist-packages/matplotlib/pyplot.py
   matplotlib version : 3.5.1

++ module loaded: flask
   module file : /usr/lib/python3/dist-packages/flask/__init__.py
   flask version : 2.0.1

++ module loaded: flask_cors
   module file : /usr/lib/python3/dist-packages/flask_cors/__init__.py
   flask_cors version : 3.0.9

-------------------------------- env vars --------------------------------
PATH                       = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/wsl/lib:/mnt/c/Program Files/WindowsApps/CanonicalGroupLimited.Ubuntu22.04LTS_2204.5.10021.0_x64__79rhkp1fndgsc:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/java8path:/mnt/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/mnt/c/Windows/system32:/mnt/c/Windows:/mnt/c/Windows/System32/Wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0/:/mnt/c/Windows/System32/OpenSSH/:/mnt/c/Users/pilec/AppData/Local/Programs/Python/Python39/Scripts/:/mnt/c/Users/pilec/AppData/Local/Programs/Python/Python39/:/mnt/c/Users/pilec/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/pilec/AppData/Local/atom/bin:/mnt/c/Program Files/PsychoPy:/mnt/c/Program Files/PsychoPy/DLLs:/snap/bin:/home/jan_czarnecki/abin

PYTHONPATH                 =
R_LIBS                     = /home/jan_czarnecki/R
LD_LIBRARY_PATH            =
DYLD_LIBRARY_PATH          =
DYLD_FALLBACK_LIBRARY_PATH =
CONDA_SHLVL                =
CONDA_DEFAULT_ENV          =
CC                         =
HOMEBREW_PREFIX            =

----------------------------- eval dot files -----------------------------

----------- AFNI $HOME files -----------

    .afnirc                   : found
    .sumarc                   : found
    .afni/help/all_progs.COMP : found

--------- shell startup files ----------

   -- good: .tcshrc seems to contain 'source .cshrc'
   -- considered operations: path, apsearch

   -- note: followers should not need edits, so edit flags should be 0
      (have 1 follower(s), which can be ignored)

   dot file test : want 1 modifications across 3 files:

      file             path  flatdir  apsearch        follower
      ---------------  ----  -------  --------        --------
      .cshrc           0     0        1               0
      .tcshrc          0     0        0               1
      .bashrc          0     0        0               0

------------------------------ data checks -------------------------------
data dir : found AFNI_data6   under $HOME (257007M Avail)
           top history: 22 Jan 2025 [rickr]: add AV2_aud_AM2.txt
data dir : found AFNI_demos   under $HOME
           top history: ...aylorp]: remove gzip from FATCAT_DEMO/Do_1[34]*.tcsh
data dir : found suma_demo    under $HOME
           top history: ...s_New/data/Build_tmp on Mon Mar  4 11:56:45 EST 2013
data dir : found afni_handouts under $HOME
atlas    : found TT_N27+tlrc  under /home/jan_czarnecki/abin

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

which git            : /usr/bin/git
git version          : git version 2.34.1
which gcc            : /usr/bin/gcc
gcc version          : gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

have Ubuntu system: ubuntu 22.04 Jammy Jellyfish
have Ubuntu afni  : Precompiled binary linux_ubuntu_16_64: Apr  6 2025

=========================  summary, please fix:  =========================
*  just be aware: login shell 'bash', but our code examples use 'tcsh'
*  dot file test : want 1 modifications across 3 files:

Unfortunately, when I attempt to open one of the files to modify it, I get:

(gedit:21438): Gtk-WARNING **: 04:12:20.134: cannot open display: :0.0 

Which does not provide much explanation.
I am running the Linux Subsystem for Windows as an administrator, but to no avail. I am somehow unable to use AFNI.
I would greatly appreciate any help with my problems above. I thank you for any advice in advance.

Howdy-

It looks like you are installing AFNI on Windows Subsystem Linux (WSL).

The instructions for that are here. Note this requires installing a separate X-server on the WIndows system to be able to display the graphics popups from the WSL part. Instructions for that are on that same instructions page, here. Please make sure you have done those steps, and started an X-server (like VcXsrv) before starting your Ubuntu terminal.

From that message, it is possible the $DISPLAY variables set, or perhaps have not sourced the ~/.bashrc settings file. First, check if the variable is set. What is the output of:

grep DISPLAY ~/.bashrc

? If nothing is output, then please make sure to run all the steps under the X-server install section. Note also that the X-server needs to be started before the Ubuntu terminal is started (sigh, I wish Windows made this easier...).

Another possible issue is that you are using WSL-2 (see line 5 of the system check output, release: 5.10.16.3-microsoft-standard-WSL2). Under the section where it says to start installing linux, we strongly suggest installing WSL-1:

Click here to install WSL 1 (noooot WSL 2), and probably select a modern Ubuntu (like “Ubuntu 22.04”, at time of writing here) as your desired flavor of Linux

For some reason the graphics and other aspects are more difficult on WSL-2, and that might be the ultimate issue here. So, it might be a bit of a pain, but that might be main issue here.

--pt

I have, in fact, done everything involving the X-server. However, inspecting the text, I have founf out that I'm indeed using WSL 2 instead of 1. I'm not sure how I missed this, but I have installed it a significant amount of time before trying to use AFNI. I'm not going to mark this thread as solved until I get AFNI running, but until that time, switching to the intended WSL version seems to be the solution.
Thanks a lot for your advice. You have probably just set me on a much better path.

OK, sorry that it likely involves the hassle of reinstalling WSL. I don't know why it took a step backward with WSL-2, which was pretty disappointing to see. Maybe WSL-3 will be better some day...

Please let us know how it goes, and if there are any other things to troubleshoot.

--pt