-: Install WSL on Windows 11 :-
One can access the power of both Windows and Linux at the same time on a Windows machine. The Windows Subsystem for Linux (WSL) lets developers install a Linux distribution (such as Ubuntu, OpenSUSE, Kali, Debian, Arch Linux, etc) and use Linux applications, utilities, and Bash command-line tools directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup.
Prerequisites
You must be running Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11 to use the commands below.
To setup Linux on Windows subsystem you must first Turn On below windows features from "Turn Windows Features on or off"
- Windows Subsystem for Linux
- Virtual Machine Platform
Install WSL command
You can now install everything you need to run WSL with a single command. Open command prompt or PowerShell in administrator mode by right-clicking and selecting "Run as administrator", enter the wsl --install command, then restart your machine.
Open PowerShell and run:
> wsl --install
You may be prompted to grant permission to continue the installation.
You may also need to reboot your machine before installing and running any Ubuntu distro.
Step-by-step Installation for your preferred Linux distribution
Open PowerShell Or Command Prompt as Administrator:
- Right-click the Start button and select Windows Terminal (Admin) or PowerShell (Admin)
Run the Installation Command:
Install specific versions of Ubuntu on WSL
There are multiple ways of installing Ubuntu distros on WSL. The best method depends on your specific requirements.
Method 1: Install Ubuntu from the terminal
In a PowerShell terminal, run wsl --list --online to see a list of all available distros and versions:
Install a specific Ubuntu distro using a NAME from the output:
> wsl --list --onlineThe following is a list of valid distributions that can be installed.
Install using 'wsl --install -d <Distro>'. NAME FRIENDLY NAME
AlmaLinux-8 AlmaLinux OS 8
... ...
Ubuntu Ubuntu Ubuntu-25.04 Ubuntu 25.04 LTS
Ubuntu-24.04 Ubuntu 24.04 LTS
archlinux Arch Linux
kali-linux Kali Linux Rolling
... ...
Ubuntu-18.04 Ubuntu 18.04 LTS
Ubuntu-20.04 Ubuntu 20.04 LTS
Ubuntu-22.04 Ubuntu 22.04 LTS
...
Install a specific Ubuntu distro using a NAME from the output:
> wsl --install -d Ubuntu-24.04Method 2: Download and install from the Ubuntu archive
Ubuntu images for WSL can be downloaded directly from releases.ubuntu.com.
To download Ubuntu 25.04 LTS https://releases.ubuntu.com/plucky/ubuntu-25.04-wsl-amd64.wsl
The image has a .wsl extension and can be installed in two ways:
Double-clicking the downloaded file
Running
wsl --install --from-file <image>.wslin the download directory
You do not need access to the Microsoft Store to use this installation method and the images can be self-hosted on an internal network.
Method 3: Install from the Microsoft Store
If you prefer a graphical method of installation, open the Microsoft Store on your Windows machine and search for “Ubuntu”.
Go to the page of an available Ubuntu distribution and click Get to start the installation.
Starting an Ubuntu instance
During installation of an Ubuntu distro on WSL, you are asked to create a username and password specific to that instance. This also starts an Ubuntu session and logs you in.
After installation, you can open Ubuntu instances by:
Running the
wsl -d <Distro>command in PowerShellOpening the dropdown in Windows Terminal
Searching for them in the Window’s search bar
At any point, you can list the Ubuntu distros that you can start with wsl -l -v.
Starting an instance in the right directory
By default, if you open Ubuntu using the Windows search bar or the Windows Terminal dropdown, the instance starts in the Ubuntu home directory.
When starting an instance from the terminal, the specific command that you run determines the starting directory.
Start Ubuntu in the current Windows directory from the terminal
When you open PowerShell, the working Windows directory is C:\Users\username.
Run wsl -d <Distro> to start an Ubuntu session in that directory. The prompt will indicate that the Windows C: drive is mounted to Ubuntu and that you are in the Windows home directory:
<ubuntu-username>@<hostname>:/mnt/c/Users/<windows-username>$
Start Ubuntu in the Ubuntu home directory from the terminal
When in a directory in the mounted C: drive, you can change to the Ubuntu home directory with:
$ cd ~
To skip this step, and start an instance from PowerShell with Ubuntu home as the working directory, run:
> wsl ~ -d UbuntuSome relevant miscellaneous topics:
- Open PowerShell as Administrator (right-click Start > Terminal (Admin) or PowerShell (Admin)).
- Type
wsl --updateand press Enter. - Allow the download and installation to complete.
- Restart your computer when prompted.
Run Below command to update and Upgrade Ubuntu on wsl
sudo apt update && sudo apt upgrade
Steps to Install Anaconda on Windows Ubuntu Terminal
Setup Anaconda on WSL (Ubuntu)
Thanks for Reading...
Md. Masud Rana
No comments:
Post a Comment