Table of contents
  1. WSL
    1. Ubuntu for windows
  2. Install
    1. enable
    2. install linux distro
      1. Go to a folder where you would like to download the distro
      2. Download Ubuntu 20.04
      3. install downloaded *.appx file
      4. restart
    3. Points of Interest
      1. Path from windows file system
        1. shell exe, (can point ide to this to use ubuntu in terminal)
      2. distribution Ubuntu




WSL

Ubuntu for windows

Install

enable

ps script enable and install

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile Ubuntu.appx -UseBasicParsing
Add-AppxPackage .\Ubuntu.appx

or

ps steps

# enable
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

# enable virtual machine
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

# use wsl2
wsl --set-default-version 2

or

  • use run and enable windows subsystem for linux in windows features

hit win + R

then input optionalfeatures.exe

install linux distro

available distros

Go to a folder where you would like to download the distro

cd <somefolder>

Download Ubuntu 20.04

Invoke-WebRequest -Uri https://aka.ms/wslubuntu2004 -OutFile Ubuntu.appx -UseBasicParsing

install downloaded *.appx file

Add-AppxPackage .\Ubuntu.appx

execute in cmd prompt

PS E:\distro\ubunu> ubuntu2004.exe
wsl --list --verbos
wsl --list --all

convert ubuntu on wsl 1 to wsl 2

wsl --set-version Ubuntu-20.04 2

restart

Restart-Service LxssManager

or

wsl --terminate [YourDistroName]
wsl --shutdown

Points of Interest

Path from windows file system

relative path: \wsl$\Ubuntu\home\bpaxton

Absolute Path: C:\Users\bpaxton\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs

shell exe, (can point ide to this to use ubuntu in terminal)

Use in JetBrains ides
C:\Users\bpaxton\AppData\Local\Microsoft\WindowsApps\ubuntu.exe

distribution Ubuntu

wsl.exe