1.1.8. *old* Windows 10 beta (‘Bash on Ubuntu’): The essential system setup

Important notice

Here we describe installation and system setup for the (now out of date) beta “Creators Update” version of “Bash on Ubuntu” (BoUoW) for Windows 10. This version of Windows 10 is known officially as version 1703, released around April, 2017.

For instructions about installing the more up-to-date and supported “Fall Creators Update” version of WSL, please see the instructions HERE.

Warning

This version of Linux is no longer supported.

Here is more description from Microsoft about these updates, including the instructions to “remove and replace” the old Linux– note that this involves deleting files on the Linux side, so be sure to backup any files onto the Windows side, as they suggest HERE.

Notes

Some general background information information is provided in their ‘About’ page. The installed version of Ubuntu is 16.04.

Note

This capability is a very recent development on Windows systems, and we are just starting to really test out running AFNI and SUMA through it. Right now, most major functionality seems to work, though in some cases graphics can be slow. We would still recommend Linux or Mac systems for large-scale processing at this time.

At present, “copy+paste” functionality into the default command window works a bit awkwardly. One should be able to copy/paste by selecting tabs from a drop-down panel in the upper left of the window. (As part of the instructions here, a terminal with nicer interface will be installed.)

Other operating systems allow for either tcsh or bash shells to be run as default in the terminal. However, the Windows-Ubuntu presently does not appear to allow tcsh as default (perhaps as forewarned by its descriptive name…), and therefore we describe the system setup only for staying with bash.

Importantly, as with other installation instructions, you are required to have administrator privileges on your operating system.

Install prerequisite: “Bash on Windows”

  • Follow the instructions in the first paragraph HERE to get Windows PowerShell up and running.

  • Follow the instructions HERE to install “Bash on Windows” from Microsoft. (Requires Admin privileges.)

  • Install bash and Ubuntu on Windows: in the lower left of the Desktop, click on “Ask me anything” and type:

    cmd
    
  • In the command window that opens up, type:

    bash
    

    and the installation continues. Once installed, bash starts the Linux shell.

From this point, standard Linux system terminal commands should work (e.g., ls, cp, etc.).

To open up a terminal, you can go to the Search bar in the lower left (where it says “Type here to search”) and start typing “Bash on Ubuntu”– it will likely autocomplete while typing. Additionally, you can make a shortcut on your Windows desktop.

Install prerequisite: Xming X Server for Windows

Click on the following link to start automatic download:

Use default installation settings.

To set the DISPLAY properly, run:

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

Note

When you start up your BoUoW, you will need to double-click on the Xming icon in order to start the X Server. (Sorry, not our fault…)

Install prerequisite: AFNI and package dependencies

We assume your version of Ubuntu is 16.04, and so you should now follow the following setup instructions through “Make AFNI/SUMA profiles”:

Link to Ubuntu 16+ setup instructions for AFNI

… 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.

  • Then, copy+paste the following into the terminal:

    sudo sed -i 's/<listen>.*<\/listen>/<listen>tcp:host=localhost,port=0<\/listen>/' /etc/dbus-1/session.conf
    

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!)

  1. 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.

  2. Open up the AFNI and SUMA GUIs, juuuust to make sure all is well:

    afni
    suma
    

    Report any crashes!

  3. If the “system check” gives any errors, please:

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!)

  1. 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!

  2. 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.

../../_images/AFNI_on_Windows10_2ways.jpg