Installing Linux on Windows 10 and few other cool stuff. Read this to the end.
Basic setup
Enable Virtualization on your machine (usually set in BIOS see this YT video for reference)
Enable WSL in “Windows Features” and Virtualization. Click on Windows icon and type “Turn Windows Features”. Check features like in the image below:
Install WSL and Ubuntu at once.
Run PowerShell as Admin
and run:
wsl.exe --install -d ubuntu
* or install Ubuntu distro using Windows Store (see few sections down)
Setup default WSL
Open PowerShell as Admin and type
wsl --set-version Ubuntu 2
wsl --set-default-version 2
* see the difference between WSL v1 and WSL v2 here.
To see available distro list, run:
wsl -l -v
To change default distro to distro of your choice (I selected ubuntu-22-04) run:
wsl --setdefault Ubuntu-22.04
To log in to Linux, type in PowerShell wsl
.
Then check if you spin the right distro. While in Linux check distro version typing:
lsb_release -a
Remove WSL Linux password
If you like to remove Linux user password set during installation, see the section bellow.
To disable password (Optional, not recommended)
# Open sudo nano /etc/sudoers.d/YOUR_USERNAME # Example YOUR_USERNAME ALL=(ALL) NOPASSWD:ALL
* Just remember to replace YOUR_USERNAME with current Linux username.
If you wish to Install git, docker, npm and other tools read more here
Update and Linux system
sudo apt update
sudo apt upgrade
sudo do-release-upgrade -d
You can also install git, docker, yarn, npm and many more. See this gist for reference:
https://gist.github.com/TadejPolajnar/9708401ef13e443c95cea0ece2a215f0
Access Linux WSL in Windows Network Tab
Type in file explorer this path: \\wsl$
This allows you to connect to Ubuntu via Windows Explorer File Manager.
Install Ubuntu using Windows Store
Install Windows Terminal
Install Windows Terminal using Windows Store (a nice touch when working with CLI)
Install PowerShell
Install a new version of PowerShell using Windows Store.
[link here]
Enable WSL Distro on docker
Go to Settings > [Resources] > [WSL INTEGRATION] and enable Linux distro of your choice.
Download Cool Font: Cascadia fonts with glyphs
Font preview: https://www.programmingfonts.org/#cascadia-code
Font download: https://www.nerdfonts.com/font-downloads
Edit default VsCode font Consolas, 'Courier New', monospace
and set is as CaskaydiaCove NF
.Also make sure to enable Ligatures, by setting "editor.fontLigatures": true
See Windows Terminal Video Tutorial:
https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-10#2-install-wsl
https://ubuntu.com/blog/ubuntu-on-wsl-2-is-generally-available
https://gist.github.com/TadejPolajnar/9708401ef13e443c95cea0ece2a215f0
https://docs.docker.com/desktop/windows/wsl/