Window Subsystem for Linux (wsl) installation and configuration
Windows Subsystem for Linux (WSL) is a feature of Windows that allows you to run a Linux environment on your Windows Machine, without the need for a separate Virtual machine or dual booting. WSL is designed to provide a seamless and productive experience for developers who want to use both Windows and Linux at the same time.
Install
WSL and the default Ubuntu distribution of Linux. You can also use this command
to install additional Linux distributions by running
C:\Users\Admin>wsl
--install
Check
WSL Version:
Verify
that WSL is properly installed and configured by running:
C:\Users\Admin>wsl
--version
WSL
version: 2.3.26.0
Kernel
version: 5.15.167.4-1
WSLg
version: 1.0.65
MSRDC
version: 1.2.5620
Direct3D
version: 1.611.1-81528511
DXCore
version: 10.0.26100.1-240331-1435.ge-release
Windows
version: 10.0.19045.5371
If
it shows an outdated version, update WSL using:
C:\Users\Admin>wsl
--update
Checking
for updates.
The
most recent version of Windows Subsystem for Linux is already installed.
List
Available Distributions:
Run the following command
to view the Linux distributions available for installation:
Choose
a distribution (e.g., Ubuntu) from the list and install it:
C:\Users\Admin>wsl
--install -d <DistroName>
Example:
C:\Users\Admin>wsl
--install -d Ubuntu-24.04
Once
installed, launch the distribution to complete the setup:
C:\Users\Admin>wsl
To
run a command as administrator (user "root"), use "sudo
<command>".
See
"man sudo_root" for details.
sandip@DESKTOP-TQ3HT64:/mnt/c/Users/Admin$
Set
Default User to Root:
If
you want to use the root user by default, edit the distribution settings:
C:\Users\Admin>wsl
-d <DistroName> -u root
Example:
C:\Users\Admin>wsl
-d Ubuntu-24.04 -u root
root@DESKTOP-TQ3HT64:/mnt/c/Users/Admin#
OR
C:\Users\Admin>wsl
-u root
root@DESKTOP-TQ3HT64:/mnt/c/Users/Admin#
Check
Installed Distributions:
Verify
that the distribution is installed
C:\Users\Admin>wsl
--list --verbose
NAME STATE VERSION
*
Ubuntu-24.04 Stopped 2
C:\Users\Admin>
Resources:





Comments
Post a Comment