the windows subsystem for linux runs an integrated, fast, and small version of gnu/linux alongside windows 10.

understanding this tutorial

wsl v1

the original implementation. it lacks certain system calls, but has better performance with the normal windows filesystem. windows files can be found in /mnt/c. it’s recommended to soft link to your regularly used folders, e.g

ln -s "/mnt/c/Users/<win10-username>/OneDrive" ~/onedrive

wsl v2

a new architecture that uses virtualisation and a full linux kernel to fully support system calls and other parts of the environment (without the speed loss that might be expected). this is recommended for all situations except for when win10 files need to be accessed, e.g. on a laptop with a small amount of storage space that shares files between systems. wsl drives can be accessed in explorer by going to \\\\wsl$.

<aside> 💡 for a more detailed comparison, read https://docs.microsoft.com/en-us/windows/wsl/compare-versions

</aside>


installing wsl

<aside> 🪟 windows 11: open powershell and run wsl --install, then restart your computer and skip to step #5.

</aside>

  1. open powershell as admin and run:

    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    
  2. optional: enable wsl v2 (this will require SVM to be enabled in the BIOS/UEFI).

  3. reboot computer.

  4. download ubuntu from the microsoft store.

    Get Ubuntu - Microsoft Store en-AU

  5. open the ubuntu app. it will complete installation of itself, and prompt you to create a user & password. (this password is what you will need to put in when running a command with sudo).

  6. to ensure everything is as up-to-date as possible, run:

    sudo apt update -y && sudo apt upgrade -y
    
  7. install missing packages commonly used:

    sudo apt install -y build-essential software-properties-common unzip pwgen git