1.1.10. old Windows 10: Bash on Ubuntu (beta)¶
The essential system setup
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.
These setup instructions are 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 for the more modern and supported “Fall Creators Update” version of WSL, please see the instructions HERE.
Some general background information information is provided in their ‘About’ page. The installed version of Ubuntu is 16.04.
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
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
Importantly, as with other installation instructions, you are required to have administrator privileges on your operating system.
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.)
bashand Ubuntu on Windows: in the lower left of the Desktop, click on “Ask me anything” and type:
In the command window that opens up, type:
and the installation continues. Once installed,
bashstarts the Linux shell.
From this point, standard Linux system terminal commands should
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.
Use default installation settings.
To set the DISPLAY properly, run:
echo "export DISPLAY=:0.0" >> ~/.bashrc
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…)
We assume your version of Ubuntu is 16.04, and so you should now follow the following setup instructions through “Make AFNI/SUMA profiles”:
… 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-terminalinstallation 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
Install Ubuntu terminal fonts as described HERE.
The default profile “use colors from system theme” shows an all-black terminal. To fix this: select the
Profile, turn off “use colors …”, and finally simply 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 BoUoW terminal or other gnome-terminal. Shift-Ctrl-c copies, and Shift-Ctrl-v also pastes.
Like most Linux systems, some things have to be done with
sudopermissions. The username and password may have nothing to do with their Windows login. To reset the password for user
USER_X, follow these instructions:
From the default command window, type
A. You can change the default user to root:
lxrun /setdefaultuser root
Now BoUoW logs you in as root without asking password. To change the user password:
Change the default user back to your normal user in Windows command prompt:
lxrun /setdefaultuser USER_X
cp $HOME/abin/AFNI.afnirc $HOME/.afnirc suma -update_env
Purpose: Set up vanilla-mode environment variables for AFNI and SUMA. To see how you can bend these to your will later, read the Technical notes.
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: Download the Bootcamp class data; untar+unzip it (= open it up); move into the newly opened directory; execute a script to copy the files to
If no errors occur in the above, and your
afni_system_check.pysays things are OK, you can delete/remove the tarred/zipped package, using “
rm CD.tgz”. If you are really confident, you can also deleted the CD/ directory in the present location.
!Pro tip!: Bring a computer mouse to use at the Bootcamp. It is muuuuch easier to follow the demos that way.
Read+practice with the handy Unix documentation/tutorial.
Purpose: give you a quick lesson/refresher on using basic Linux shell commands (e.g., ls, cd, less, etc.). It will greatly enhance your bootcamp experience– we promise!
Read the “Please Fix” section at the end. If there are no suggestions, then rejoice! Otherwise, try the suggestion(s) there.
Open up the AFNI and SUMA GUIs, juuuust to make sure all is well:
Report any crashes!
If stuck, then …
… put any error message into an online search, and/or post a question on the Message Board
… copy+paste this:
afni_system_check.py -check_all > out.afni_system_check.txt
... and email the file “out.afni_system_check.txt” to an AFNI Guru for advice.
To improve your life when using the terminal, copy+paste:
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 ltr ls --color -ltr' >> ~/.cshrc echo 'alias ls="ls --color"' >> ~/.bashrc echo 'alias ll="ls --color -l"' >> ~/.bashrc echo 'alias ltr="ls --color -ltr"' >> ~/.bashrc
Purpose: The first commands set up
tcsh(which should already be enabled for
bash, 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.
To update your AFNI sometime, copy+paste:
Purpose: This will automatically download the correct, latest AFNI version to your computer, replacing your old binaries. It will also update the
apearchhelp information. Update often!
To check your AFNI version, copy+paste:
Purpose: Report this useful info whenever asking a question on the Message Board!
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.