1.1.7. Windows 10 (Windows Subsystem for Linux (WSL)): The essential system setup¶
- Install prerequisite: Getting Linux
- Install prerequisite: VcXsrv Windows X Server
- Install prerequisite: AFNI and package dependencies
- Useful setup tips (optional, but recommended)
- Make AFNI/SUMA profiles
- Prepare for Bootcamp
- Evaluate setup/system (important!)
- Niceify terminal (optional, but goood)
- Keep up-to-date (remember!)
Here we describe Linux installation and system setup for the “Fall Creators Update” (FCU) version of Windows 10, known as the Windows Subsystem for Linux (WSL). This FCU was released in Windows version 1709 around October, 2017.
More technical/background description of updates since the earlier
beta version of WSL can be found HERE on their “What’s New” page.
Mainly, the installation is a lot easier now, and one can even run
tcsh
shells. Yippee.
Importantly, as with other installation instructions, you are required to have administrator privileges on your operating system.
Install prerequisite: Getting Linux¶
Install prerequisite: VcXsrv Windows X Server¶
- Click on the following link to start automatic download:Use default installation settings.
First start the X Server, and then start Ubuntu.
Note
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!)
To enable copy+paste ability in Ubuntu terminal, right-click on the toolbar at the top of the Ubuntu terminal, and select “Properties”; in the Options tab, make sure the box next to “QuickEdit Mode” is selected.
You should then be able to paste into a terminal by either right-clicking or hitting the “Enter” key. (To “copy” text that is in the terminal, just highlight it, and then you should be able to right-click to paste; to “copy” text from outside the terminal, you probably need to highlight it and hit “Ctrl+c”.)
To set the DISPLAY properly, copy+paste the following into the terminal:
echo "export DISPLAY=:0.0" >> ~/.bashrc echo "setenv DISPLAY :0.0" >> ~/.cshrc
Install prerequisite: AFNI and package dependencies¶
… while noting the following:
The R package installation part might be slow, on the order of hours. Meditation is often a good thing, anyways.
Include the optional
gnome-terminal
installation in the first set of steps, and copy+paste this into the terminal:echo "export NO_AT_BRIDGE=1" >> ~/.bashrc echo "setenv NO_AT_BRIDGE 1" >> ~/.cshrc
Useful setup tips (optional, but recommended)¶
- Install Ubuntu terminal fonts as described HERE.
- Follow these
gnome-terminal
steps:- The default profile “use colors from system theme” shows an
all-black terminal. To fix this: go to the terminal’s menu bar,
select the
Edit
tab, thenProfile
, turn off “use colors …”, and just pick a scheme+palette that you like. - In gnome-terminal, everything is standard and similar to other linux implementations, and the middle button pastes whatever is selected in the WSL terminal or other gnome-terminal. Shift-Ctrl-c copies, and Shift-Ctrl-v also pastes.
- The default profile “use colors from system theme” shows an
all-black terminal. To fix this: go to the terminal’s menu bar,
select the
Make AFNI/SUMA profiles¶
Copy+paste the following:
cp $HOME/abin/AFNI.afnirc $HOME/.afnirc
suma -update_env
Purpose: As noted in the Technical notes, AFNI and SUMA have a lot of default settings, controlled using environment variables. The above initializes vanilla-mode profiles with default values for both AFNI and SUMA.
These files ($HOME/.afnirc
and $HOME/.sumarc
) can be edited to
the user’s heart’s content, setting up specific profile features you
want when using AFNI and SUMA (e.g., having left=left when viewing
axial slices, making default colorbars, etc.).
Prepare for Bootcamp¶
Copy+paste the following:
curl -O https://afni.nimh.nih.gov/pub/dist/edu/data/CD.tgz
tar xvzf CD.tgz
cd CD
tcsh s2.cp.files . ~
cd ..
Purpose: In order, these commands: get the tarred+zipped directory
that contains the class data (and is hence named “CD”), downloading it
to the current location in the terminal; untar/unzip it (=opens it
up); go into the newly opened directory; execute a script to copy the
files to $HOME/CD/
; and finally exit the directory.
At this point, if there have been no errors, you can delete/remove
the tarred/zipped package, using “rm CD.tgz
”. If you are
really confident, you can also deleted the CD tree in the present
location (but leaving it in $HOME/CD/
).
Note
If using Linux terminal commands is new to you, then do look over the handy Unix documentation/tutorial and practice a few of the basic commands on your own system (e.g., ls, cd, less, etc.). It will greatly enhance your bootcamp experience– we promise!
Evaluate setup/system (important!)¶
Copy+paste the following, and read the displayed “Please Fix” section at the end of the output (try the suggestions there!):
afni_system_check.py -check_all
… and, for extra help, copy+paste this:
afni_system_check.py -check_all > out.afni_system_check.txt
and email the file “out.afni_system_check.txt” to your local AFNI Guru for advice.
Open up the AFNI and SUMA GUIs, juuuust to make sure all is well:
afni suma
Report any crashes!
If the “system check” gives any errors, please:
- check the list of known setup issues;
- search on the Message Board, and/or put the error into google;
- post a question on the aforementioned Message Board.
Niceify terminal (optional, but goood)¶
To improve your life when using the terminal, copy+paste these:
echo 'set filec' >> ~/.cshrc
echo 'set autolist' >> ~/.cshrc
echo 'set nobeep' >> ~/.cshrc
echo 'alias ls ls --color=auto' >> ~/.cshrc
echo 'alias ll ls --color -l' >> ~/.cshrc
echo 'alias ls="ls --color"' >> ~/.bashrc
echo 'alias ll="ls --color -l"' >> ~/.bashrc
Purpose: The first commands set up tab
autocompletion for
tcsh
(which should already be enabled for bash
users by
default). The second set of commands make aliases so that different
types of files (“normal” files, zipped files, executables, et al.)
and directories are shown using different colors and boldness. It
makes it much easier to navigate on a terminal, IMHO.
Keep up-to-date (remember!)¶
To update your AFNI any time in the future, just run:
@update.afni.binaries -d
That’s it!!
Purpose: This will automatically download the correct, latest AFNI version to your computer, replacing your old binaries. It will also update the
apearch
help information. Update often!Check your AFNI version by typing:
afni -ver
Purpose: Report this useful info, whenever asking a question on the Message Board!
Note
The record of all changes (new options, new programs, bug fixes, et al.) in AFNI programs is maintained for all to see in the online AFNI History.
