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

My top 8 commands and tools for debugging applications running on Kubernetes

Kubernetes: open source production-grade container orchestration management

Endless Battlefield Public Whitelisting Result

What is Debugging! How to do it ?

Part 2 IT/Tech Conferences: The №1 Tech Events Guide in 2022 (January-March)

CS 373 Fall 2021: Blog #12

Improving Kubernetes Resiliency with Chaos Engineering

Meet Hypermedia’s Hype Man: A Conversation with Michael Hibay

Hackers & Painters

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

Working with dynamically created USB devices in Docker

Setup AWS resources using Ansible Modules

Run Docker Inside Docker

Docker Deep Dive — Part 2