These tips are based on using the Ubuntu version of WSL which is currently at version 18.04 LTS. Before installing Ubuntu from the Microsoft Store, open Powershell as administrator and run this command
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Windows drives (usually called C and D) are available in /mnt
and you can work in these drives from the Linux command line. An important point to remember: never edit a file under Linux using a Windows program. The best approach is to save all your work files in C or D drive and never under Linux. For example, you can create directories in D drive and make symlinks from your home directory under Linux
cd $HOME mkdir /mnt/d/Work ln -s /mnt/d/Work Work mkdir /mnt/d/Tex ln -s /mnt/d/Tex Tex
In addition, you can create symlinks to some useful Windows folders (replace USERNAME with your Windows user name)
cd $HOME ln -s /mnt/c/Users/USERNAME/Desktop Desktop ln -s /mnt/c/Users/USERNAME/Documents Documents ln -s /mnt/c/Users/USERNAME/Downloads Downloads
In Ubuntu, we install some important programs using apt
sudo apt install gcc gfortran sudo apt install python (required by spack) sudo apt install python3-numpy sudo apt install python3-scipy sudo apt install python3-sympy sudo apt install python3-matplotlib sudo apt install jupyter sudo apt install gnuplot (install xming) sudo apt install gv sudo apt install xpdf
and the rest we install using Spack. Other applications can be installed on Windows side, e.g., FileZilla, FireFox, gVim, VisIt, VLC, gmsh, SourceTree, MikTex and VS Code. We can run these Windows programs from the Linux command line by defining some aliases, see sample bashrc file here which you can add at the end of your $HOME/.bashrc
file.
$HOME/.inputrc
and add the lines
set bell-style none set completion-ignore-case on set show-all-if-ambiguous on
/mnt/c/Users/USERNAME/.gvimrc
set guifont=Consolas:h11
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope