# WSL2 - Windows subsystem for Linux

Official Docs (opens new window)

Nodejs (opens new window)

Get-started-with-windows-subsystem-for-linux (opens new window)

  • Runs on very fast, light & optimized virtual machine.

  • cmd start/stop - wsl/ wsl --shutdown

  • config - C:\Users\<yourUserName>\.wslconfig

  • Runs on lightweight virtual machine(Vmmem process)

    • Uses VirtualHardDisk (.vhdx file) with dynamic size.(Max 256GB EXT4)
  • Browser access - localhost

  • Uses full linux kernel (forked by Microsoft from kernel.org)

    • Updates automatically via windows updates (not linux upgrade)
  • Explore

    • \\wsl$\Ubuntu-18.04\home\<user name>\Project
    • / = linux & \ = windows
    • From linux - /mnt/c/
    • Data corruption - Never use windows explorer or other app to edit files/folders.
    • (EXT4 != NTFS)
  • Vscode

    • Use remote-wsl extension to use windows/linux as client/server
    • code . - opens current folder in vscode works in wsl
  • Docker Desktop

    • Can use virtual machine for linux containers
    • Runs both windows & linux containers since both kernels are available
    • Virtual machines types
      1. WSL2 (better performance)
      2. Hyper V

# Wsl - Ubuntu setup

#!bin/bash

# Wsl Ubuntu - setup script
sudo apt update && sudo apt upgrade
sudo apt install wget ca-certificates git -y


# zsh & ohmyzsh
sudo apt install zsh
chsh -s $(which zsh)
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

# Powerlevel theme
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

# github cli
sudo apt install gh
# Copy .aliases .zshrc .ssh

# Optional - Micro editor
# curl https://getmic.ro | bash
# md ~/bin/
# mv micro ~/bin/

Last Updated: 11/18/2021, 7:23:03 PM