------------------------------------------------------ Installing WSL (Windows Subsystem for Linux) * These instructions tested on 5 December 2020 on a computer running Windows 10 Home edition (64 bit) with a high-speed internet connection NOTE: Windows Subsystem for Linux is a way to run a command-line-only Linux operating system as a virtual machine while simultaneously running Microsoft Windows as your main operating system. (1) Start up PowerShell (right-click and select "Run as Administrator" because this installation requires elevated privileges) (2) Go to https://microsoft.com and look up instructions on installing WSL (3) POWERSHELL COMMAND to enable WSL on your Microsoft Windows operating system: dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart (4) POWERSHELL COMMAND to enable the virtual machine feature of Microsoft Windows: dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart (5) Re-start Microsoft Windows (6) Re-start PowerShell (right-click and select "Run as Administrator" because this installation requires elevated privileges) (7) Download the WSL2 Linux kernel package from the link given on the Microsoft docs webpage; Double-click to run -- you will be prompted for elevated permissions, select ‘yes’ to approve this installation (8) POWERSHELL COMMAND to set the default version of WSL to version 2: wsl --set-default-version 2 (9) Open the Microsoft Store application (aka.ms/wslstore) and select the Debian Linux distribution; click "Get" to begin downloading, then click "Launch" to begin installation (10) A "Debian" window will open, prompting you to enter a username and password (which need not match your Windows name/password); after you enter these credentials you will be presented with a Linux prompt where you may enter text commands, much like PowerShell. (11) WSL COMMANDS to update your Debian Linux distribution to the latest version (you may repeat this at any time in the future): sudo apt update sudo apt dist-upgrade (12) WSL COMMAND to install the "gcc" C language compiler and the "g++" C++ language compiler as well as other software development packages necessary to do C and C++ programming within WSL, required for later installing the "tshoot" circuit troubleshooting application: sudo apt install build-essential (13) WSL COMMAND to test that "gcc" is indeed installed; if installed you will get a "fatal error" message saying no input files were found: gcc (14) WSL COMMAND to install the Python (version 3) programming language: sudo apt install python3 (15) WSL COMMAND to test that "python3" is indeed installed python3 (16) PYTHON COMMAND to exit the python interpreter: quit() ------------------------------------------------------ Using WSL (Windows Subsystem for Linux) This is a "command-line" interface for the Linux operating system, requiring that you enter typed commands and press after each one. This is the most basic mode of interacting with Linux, and although it may seem clumsy at first, it is actually quite powerful! (1) Type "WSL" in the Windows search tool field and then click on the WSL icon (2) A WSL window will open up (feel free to "pin" this to the Taskbar on Windows for convenient starting in the future) (3) When first starting, the default directory seems to be /mnt/c/Windows/system32 which is not where I would recommend doing your WSL work; enter this WSL COMMAND to enter /home/username which is the more "natural" location on the computer to place all your WSL work: cd (4) Right-click on the penguin logo in the upper-left corner of the WSL window and select "Properties" to customize the look and feel of the environment, including font size (5) To quit WSL, either click on the "X" window button or type "logout" at the command line ------------------------------------------------------ Installing the "tshoot" circuit troubleshooting application This will require entering several typed commands into the WSL command-line, and pressing after each one. This is the most basic mode of interacting with Linux, and although it may seem clumsy at first, it is actually quite powerful! (1) Start up WSL and navigate to your home directory with this command: cd (2) Create a new directory for all the tshoot files to reside: mkdir tshoot (3) Use Windows to create a folder on your Desktop called "tshoot" to also store these files in a location that's easy to access with regular Windows apps (e.g. Adobe Reader to view the PDF schematic diagrams for each circuit) (4) Copy the latest ".tar" file from your instructor to this "tshoot" folder on your computer's Desktop (5) From WSL navigate to that Desktop folder (in place of "username" you would actually type your real Windows user name): cd /mnt/c/Users/username/Desktop/tshoot (6) Verify that the tshoot ".tar" file is indeed there: ls -l (7) Unpack that archive file, ignoring any error messages: tar xvf tshoot*tar (8) Navigate back to the "tshoot" directory under your WSL "home" directory: cd ~/tshoot (9) Use WSL to copy the same "tshoot" archive file to the WSL tshoot/ directory: cp -vi /mnt/c/Users/username/Desktop/tshoot/tshoot*tar . (10) Verify that the tshoot ".tar" file was copied successfully: ls -l (11) Unpack that archive file: tar xvf tshoot*tar (12) Build the executable file: make (13) Start up "tshoot" to test that it works: ./tshoot ------------------------------------------------------ Using "tshoot" from WSL (1) Start up WSL and navigate to the "tshoot" directory with this command: cd ~/tshoot (2) Start up the "tshoot" executable: ./tshoot (3) Open the "tshoot" folder on your Desktop and double-click on the appropriate PDF file for the circuit you'll be troubleshooting (4) Arrange the WSL and PDF-viewer windows so that you can view both at the same time Happy troubleshooting! ------------------------------------------------------ Using Python from WSL (1) Start up WSL and navigate to your home directory with this command: cd (2) Start up Python version 3 with this command: python3 (3) A triple-chevron prompt will appear, where you may now enter Python commands (4) To exit, type: quit() Happy programming! ------------------------------------------------------ Navigating directories (folders) using WSL * "cd" places you in your home directory (/home/username) * "ls" lists all the files and sub-directories within your current directory * "ls -l" shows a "long listing" of all the files and sub-directories within your current directory, including file size and other details not otherwise shown with just "ls" * "cd /mnt/c" places you in the main directory of your C: hard drive where you may then navigate to other locations and manipulate files