Setting Up WSL 2 in Windows 10

Table of Contents

What is WSL?

How is it different than Virtual Box?

Why will you need WSL?

Prerequisites for WSL 2

Windows 10 information with OS Version and Build

Setting Up Ubuntu as WSL

Step 1: Enable features on Windows 10

Searching for “Turn Windows features on or off” in search bar

Step 2: Installing Ubuntu 20.04

your_username@desktop_name:~$
your_username@desktop_name:~$ pwdOUTPUT:/home/your_username

Step 3: Update and set up WSL 2

PS C:\WINDOWS\system32> wsl -l -v
PS C:\WINDOWS\system32> wsl -l -vOUTPUT:
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> wsl -l -vOUTPUT:
NAME STATE VERSION
* Ubuntu-20.04 Running 1
PS C:\WINDOWS\system32>
PS C:\WINDOWS\system32> wsl --set-default-version 2
PS C:\WINDOWS\system32> wsl --set-version Ubuntu-20.04 2OUTPUT:
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.

Step 4: Update and Upgrade Ubuntu version

your_username@desktop_name:/$ sudo apt-get update
[sudo] password for your_username:
OUTPUT:A list of packages and PPAs that need an update will be fetched
Reading package lists... Done
your_username@desktop_name:/$ sudo apt-get upgrade
[sudo] password for your_username:

Step 5: Check for mounted drives and tools

your_username@desktop_name:~$ ls /mnt/OUTPUT:
c d e f g
your_username@desktop_name:~$ cd /mnt/cOUTPUT:your_username@desktop_name:/mnt/c$
hiren@DESKTOP-MKBJJID:/mnt/c$ python3OUTPUT:
Python 3.8.5 (default, May 27 2021, 13:30:53)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Congratulations! You have successfully installed WSL on Windows 10")
OUTPUT:
Congratulations! You have successfully installed WSL on Windows 10
>>>

What’s next?

--

--

--

One of India’s leading institutions providing world-class Data Science & AI programs for working professionals with a mission to groom Data leaders of tomorrow!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Elemental Chat Public Test: Success & Learnings

Raise your hand if you want to quit drinking coffee. Why, though???

Roadmap to Toonworld

Introduction to Streaming Big Data

Two steps to builder a .NET Trimmer application

Just In Case. Laravel, create custom pagination views (example with bulma)

Chaos Engineering Automation with Drone and Gremlin

CloudFormation macros; roundhouse kick Tags as Chuck would

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
INSAID

INSAID

One of India’s leading institutions providing world-class Data Science & AI programs for working professionals with a mission to groom Data leaders of tomorrow!

More from Medium

Build ns-3 on Docker Ubuntu image on Windows 10/11

Use Linux as your default OS. Here’s why!

What is a dynamic library compared to a static library?

Elasticity Task