<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: spmahapatra</title>
    <description>The latest articles on DEV Community by spmahapatra (@spmahapatra).</description>
    <link>https://dev.to/spmahapatra</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2935765%2F32fa9f16-f43d-48ea-8148-249dd19c2b24.png</url>
      <title>DEV Community: spmahapatra</title>
      <link>https://dev.to/spmahapatra</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/spmahapatra"/>
    <language>en</language>
    <item>
      <title>How to Set Up WSL2 on Windows 11</title>
      <dc:creator>spmahapatra</dc:creator>
      <pubDate>Sat, 25 Apr 2026 23:14:06 +0000</pubDate>
      <link>https://dev.to/spmahapatra/how-to-set-up-wsl2-on-windows-11-53oi</link>
      <guid>https://dev.to/spmahapatra/how-to-set-up-wsl2-on-windows-11-53oi</guid>
      <description>&lt;p&gt;Windows 11 ships with WSL2 support built in — no manual kernel updates, no legacy workarounds. This is the cleanest path to a Linux environment on Windows I've seen so far.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Windows 11 (any edition — Home, Pro, Enterprise)&lt;/li&gt;
&lt;li&gt;A user account with &lt;strong&gt;Administrator&lt;/strong&gt; privileges&lt;/li&gt;
&lt;li&gt;Internet connection for downloading the distro&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Step 1 — Open PowerShell as Administrator
&lt;/h2&gt;

&lt;p&gt;Right-click the Start button → &lt;strong&gt;Terminal (Admin)&lt;/strong&gt; or search for &lt;strong&gt;PowerShell&lt;/strong&gt;, right-click → &lt;strong&gt;Run as administrator&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;You'll need this for the install command to work.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 2 — Install WSL2
&lt;/h2&gt;

&lt;p&gt;One command does everything — enables the WSL feature, sets version 2 as default, and installs Ubuntu as the default distro:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;wsl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--install&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output you'll see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Installing: Virtual Machine Platform
Virtual Machine Platform has been installed.
Installing: Windows Subsystem for Linux
Windows Subsystem for Linux has been installed.
Downloading: WSL Kernel
Installing: WSL Kernel
WSL Kernel has been installed.
Downloading: Ubuntu
The requested operation is successful.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;If you want a specific distro instead of Ubuntu, use &lt;code&gt;wsl --install -d &amp;lt;DistroName&amp;gt;&lt;/code&gt;. Run &lt;code&gt;wsl --list --online&lt;/code&gt; to see what's available.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Step 3 — Restart Your Machine
&lt;/h2&gt;

&lt;p&gt;WSL2 requires a reboot to finish the setup. Save anything open and restart.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Restart-Computer&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or just restart manually from the Start menu.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 4 — Finish the Linux Setup
&lt;/h2&gt;

&lt;p&gt;After reboot, Ubuntu (or whichever distro you picked) will launch automatically and ask you to create a user account:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;Enter new UNIX username: localadmin
New password:
Retype new password:
passwd: password updated successfully
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pick a username and a password. The password won't show as you type — that's normal.&lt;/p&gt;

&lt;p&gt;Once done you'll land at the shell prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;localadmin@MACHINE-NAME:~$&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You're in.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 5 — Verify WSL2 is Running
&lt;/h2&gt;

&lt;p&gt;Open a new PowerShell window and check:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;wsl&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-l&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-v&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expected output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;  NAME      STATE           VERSION
* Ubuntu    Running         2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;VERSION 2&lt;/code&gt; confirms you're on WSL2, not the older WSL1. The &lt;code&gt;*&lt;/code&gt; marks your default distro.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 6 — Update the Distro
&lt;/h2&gt;

&lt;p&gt;First thing after a fresh install — update the package list:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt upgrade &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Takes a minute or two. Do it now and you won't have to think about it again for a while.&lt;/p&gt;




&lt;h2&gt;
  
  
  Step 7 — Install Windows Terminal (if you haven't already)
&lt;/h2&gt;

&lt;p&gt;WSL2 works fine in the default console but Windows Terminal is significantly better — tabs, split panes, profiles per distro, proper font rendering.&lt;/p&gt;

&lt;p&gt;Install it from the Microsoft Store or:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;winget&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;install&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;Microsoft.WindowsTerminal&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once installed, open it and your Linux distro will already be listed as a profile in the &lt;code&gt;+&lt;/code&gt; dropdown.&lt;/p&gt;




&lt;h2&gt;
  
  
  Useful Commands to Know
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wsl --install&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Install WSL2 with default distro (Ubuntu)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wsl --install -d Debian&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Install a specific distro&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wsl --list --online&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;See all available distros&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wsl -l -v&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;List installed distros with version and state&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wsl --set-default-version 2&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Force WSL2 for all future instros&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wsl --shutdown&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stop all running WSL instances&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wsl --update&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Update the WSL kernel&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;wsl -d Ubuntu&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Launch a specific distro&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Accessing Files Between Windows and Linux
&lt;/h2&gt;

&lt;p&gt;From inside WSL2, your Windows drives are mounted under &lt;code&gt;/mnt/&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt; /mnt/c/Users/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From Windows Explorer, type this in the address bar to browse your Linux filesystem:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;\\wsl$&lt;/span&gt;&lt;span class="se"&gt;\U&lt;/span&gt;buntu
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or just run &lt;code&gt;explorer.exe .&lt;/code&gt; from inside your WSL2 terminal to open the current folder in Explorer.&lt;/p&gt;




&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;wsl --install&lt;/code&gt; says WSL is already installed but nothing works&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run &lt;code&gt;wsl --update&lt;/code&gt; to make sure the kernel is current&lt;/li&gt;
&lt;li&gt;Then &lt;code&gt;wsl --shutdown&lt;/code&gt; and try again&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Stuck on "Installing" after reboot&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the Microsoft Store and check for pending updates — the Ubuntu app sometimes needs to finish installing from there&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;Error: 0x80370102&lt;/code&gt; — virtualization not enabled&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reboot into BIOS/UEFI and enable &lt;strong&gt;Intel VT-x&lt;/strong&gt; or &lt;strong&gt;AMD-V&lt;/strong&gt; (virtualization)&lt;/li&gt;
&lt;li&gt;On most machines it's under Advanced → CPU Configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;WSL1 instead of WSL2 showing in &lt;code&gt;wsl -l -v&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set the default version: &lt;code&gt;wsl --set-default-version 2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Convert an existing distro: &lt;code&gt;wsl --set-version Ubuntu 2&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="//./2%20-%20provision-debian-wsl2.md"&gt;Install a Debian instance alongside Ubuntu&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="//3%20-%20git-ssh-setup.md"&gt;Set up Git with SSH keys in WSL2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;Tested on Windows 11 23H2. If something looks different on your machine, the WSL docs at &lt;a href="https://aka.ms/wsl" rel="noopener noreferrer"&gt;aka.ms/wsl&lt;/a&gt; are actually pretty good.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>wls2</category>
      <category>devops</category>
      <category>windows</category>
    </item>
  </channel>
</rss>
