DEV Community

Cover image for WSL 2.0 - Linux On Windows 10
Vikas Prabhu
Vikas Prabhu

Posted on

2

WSL 2.0 - Linux On Windows 10


Have kept this article simple and to the point , please share you feedback and love <3

Run all commands in Windows PowerShell with admin rights

  • Enabling the Virtual Machine Platform
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Enter fullscreen mode Exit fullscreen mode
  • Enabling the Windows Subsystem for Linux
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Enter fullscreen mode Exit fullscreen mode
  • Restart the machine even if it was mentioned /norestart

  • After restart reopen powershell with admin rights

  • Set default WSL version to 2.0

wsl --set-default-version 2
Enter fullscreen mode Exit fullscreen mode
  • It will give you upgrade message like this
WSL 2 requires an update to its kernel component. For information please visit https://aka.ms/wsl2kernel
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Enter fullscreen mode Exit fullscreen mode
  • Download the standalone update from this site

  • Install the update by double click

  • Search for Ubuntu 20 LTS from app store

  • After installation you should be able to see ubuntu in the start menu

  • Clicking it will open a bash shell

  • All your windows drives will be under /mnt/

  • Search for Windows Terminal from app store for better terminal experience

  • Upgrade your shell to ZSH (not mandatory but just for the love of ZSH)

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

Top comments (0)

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay