Professional Documents
Culture Documents
Install and Remove The WSL Ubuntu-22.04 Distribution
Install and Remove The WSL Ubuntu-22.04 Distribution
04 Distribution
This post shows how to Install and Remove the WSL Ubuntu-22.04 Distribution. It also lists the
output of wsl --help.
Prerequisites
Run Get WSL
Computer Configuration
wsl --status
# Default Distribution: docker-desktop-data
# Default Version: 2
wsl -v
# WSL version: 1.2.5.0
# Kernel version: 5.15.90.1
# WSLg version: 1.0.51
# MSRDC version: 1.2.3770
# Direct3D version: 1.608.2-61064218
# DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
# Windows version: 10.0.19045.2846
$env:WSL_UTF8=1
wsl --help | more
https://www.centennialsoftwaresolutions.com/post/install-and-remove-the-wsl-ubuntu-22-04-distribution 1/12
4/26/24, 9:46 AM Install and Remove the WSL Ubuntu-22.04 Distribution
# Output
# Output:
https://www.centennialsoftwaresolutions.com/post/install-and-remove-the-wsl-ubuntu-22-04-distribution 2/12
4/26/24, 9:46 AM Install and Remove the WSL Ubuntu-22.04 Distribution
# Get the Window's path to HOME, run this at the distributions prompt:
explorer.exe .
https://www.centennialsoftwaresolutions.com/post/install-and-remove-the-wsl-ubuntu-22-04-distribution 3/12
4/26/24, 9:46 AM Install and Remove the WSL Ubuntu-22.04 Distribution
# \\wsl.localhost\Ubuntu-22.04\home\username
exit
wsl -l
# Output
# Output
wsl -l
# Output
wsl
https://www.centennialsoftwaresolutions.com/post/install-and-remove-the-wsl-ubuntu-22-04-distribution 4/12
4/26/24, 9:46 AM Install and Remove the WSL Ubuntu-22.04 Distribution
# Output
# Run to test
exit
wsl
exit
# Output
# Unregistering.
# The operation completed successfully.
wsl --help
Copyright (c) Microsoft Corporation. All rights reserved.
For privacy information about this product please visit
https://aka.ms/privacy.
https://www.centennialsoftwaresolutions.com/post/install-and-remove-the-wsl-ubuntu-22-04-distribution 5/12
4/26/24, 9:46 AM Install and Remove the WSL Ubuntu-22.04 Distribution
shell.
--exec, -e <CommandLine>
Execute the specified command without using the default
Linux shell.
--shell-type <Type>
Execute the specified command with the provided shell
type.
Types:
standard
Execute the specified command using the default
Linux shell.
login
Execute the specified command using the default
Linux shell as a login shell.
none
Execute the specified command without using the
default Linux shell.
--
Pass the remaining command line as-is.
Options:
--cd <Directory>
Sets the specified directory as the current working
directory.
If ~ is used the Linux user's home path will be used. If
the path begins
with a / character, it will be interpreted as an absolute
Linux path.
https://www.centennialsoftwaresolutions.com/post/install-and-remove-the-wsl-ubuntu-22-04-distribution 6/12
4/26/24, 9:46 AM Install and Remove the WSL Ubuntu-22.04 Distribution
--distribution, -d <Distro>
Run the specified distribution.
--user, -u <UserName>
Run as the specified user.
--system
Launches a shell for the system distribution.
--help
Display usage information.
--debug-shell
Open a WSL2 debug shell for diagnostics purposes.
--event-viewer
Opens the application view of the Windows Event Viewer.
Options:
--no-launch, -n
Do not launch the distribution after install.
--web-download
Download the distribution from the internet
instead of the Microsoft Store.
https://www.centennialsoftwaresolutions.com/post/install-and-remove-the-wsl-ubuntu-22-04-distribution 7/12
4/26/24, 9:46 AM Install and Remove the WSL Ubuntu-22.04 Distribution
--mount <Disk>
Attaches and mounts a physical or virtual disk in all WSL
2 distributions.
Options:
--vhd
Specifies that <Disk> refers to a virtual hard
disk.
--bare
Attach the disk to WSL2, but don't mount it.
--name <Name>
Mount the disk using a custom name for the
mountpoint.
--type <Type>
Filesystem to use when mounting a disk, if not
specified defaults to ext4.
--options <Options>
Additional mount options.
--partition <Index>
Index of the partition to mount, if not specified
defaults to the whole disk.
--release-notes
Opens a web browser to view the WSL release notes page.
--set-default-version <Version>
Changes the default install version for new distributions.
https://www.centennialsoftwaresolutions.com/post/install-and-remove-the-wsl-ubuntu-22-04-distribution 8/12
4/26/24, 9:46 AM Install and Remove the WSL Ubuntu-22.04 Distribution
--shutdown
Immediately terminates all running distributions and the
WSL 2
lightweight utility virtual machine.
--status
Show the status of Windows Subsystem for Linux.
--unmount [Disk]
Unmounts and detaches a disk from all WSL2 distributions.
Unmounts and detaches all disks if called without
argument.
--update
Update the Windows Subsystem for Linux package.
Options:
--web-download
Download the update from the internet instead of
the Microsoft Store.
--pre-release
Download a pre-release version if available.
Implies --web-download.
--version, -v
Display version information.
Options:
--vhd
Specifies that the distribution should be exported
as a .vhdx file.
Options:
--version <Version>
Specifies the version to use for the new
distribution.
--vhd
Specifies that the provided file is a .vhdx file,
not a tar file.
This operation makes a copy of the .vhdx file at
the specified install location.
--list, -l [Options]
Lists distributions.
Options:
--all
List all distributions, including distributions
that are
currently being installed or uninstalled.
https://www.centennialsoftwaresolutions.com/post/install-and-remove-the-wsl-ubuntu-22-04-distribution 10/12
4/26/24, 9:46 AM Install and Remove the WSL Ubuntu-22.04 Distribution
--running
List only distributions that are currently
running.
--quiet, -q
Only show distribution names.
--verbose, -v
Show detailed information about all distributions.
--online, -o
Displays a list of available distributions for
install with 'wsl.exe --install'.
--set-default, -s <Distro>
Sets the distribution as the default.
--terminate, -t <Distro>
Terminates the specified distribution.
--unregister <Distro>
Unregisters the distribution and deletes the root
filesystem.
References
Windows 10 Logo
https://commons.wikimedia.org/wiki/File:Windows_logo_-_2012_%28dark_blue%29.svg
Tux Logo
Tux (mascot). (2023, April 10). In Wikipedia. https://en.wikipedia.org/wiki/Tux_(mascot)
https://www.centennialsoftwaresolutions.com/post/install-and-remove-the-wsl-ubuntu-22-04-distribution 11/12
4/26/24, 9:46 AM Install and Remove the WSL Ubuntu-22.04 Distribution
https://en.wikipedia.org/wiki/Tux_%28mascot%29#/media/File:Tux.png
https://www.centennialsoftwaresolutions.com/post/install-and-remove-the-wsl-ubuntu-22-04-distribution 12/12