University of Alberta

Login Sign up

Windows Subsystem for Linux (WSL)

Modified on: Mon, 14 Jul 2025 8:25 AM

Introduction


This KB will explain the basics of Windows Subsystem for Linux (WSL) on a Windows machine. 





Applicability


This article applies to anyone installing or supporting WSL on a Windows device. This is meant to be an introductory guide on some of the basics surrounding WSL.





Details


Table of Contents

About WSL

Installing WSL

Uninstalling a WSL instance

Launching WSL

Using WSL Command Line

Using Linux Apps

Setting up a Desktop Environment (GUI)





About WSL



What is Windows Subsystem for Linux (WSL)?


WSL is essentially a virtualization layer in Windows that allows you to run a variety of different Linux Distributions in a window. This virtualization layer makes it easy to seamlessly run Linux alongside Windows, without the need for messy solutions like dual booting or creating a dedicated VM. WSL comes in two versions.



What are the differences between WSL1 and WSL2?


Version 1 which was the first iteration of WSL, and version 2 which is generally the most common version available as of 2025. Generally version 2 has better compatibility with local resources, and is faster than version 1. However, should your workload require features only found in version 1, that is out of scope for this KB, and the focus will be on WSL version 2.  Please see this link from Microsoft describing the differences. It should be possible to convert a WSL instance from one version to another should there be a requirement to do so.


What are the system requirements for WSL v2?


  • Windows 11
  • Windows 10 at least version version 1903
  • Virtualization Support enabled in the system BIOS/UEFI
  • Administrative privileges on the system
    • Administrative privileges aren't necessary for ALL functions of WSL, however some features/functions will require elevated permissions such as:
      • Running an OpenSSH server
      • modifying system settings
      • installing updates
    • For IST managed devices, EPM should be leveraged with the "High Flex" profile applied.


What Distributions are available?

As of May 2025, the following are available through Microsoft:

  • AlmaLinux-8
  • AlmaLinux-9
  • AlmaLinus-Kitten-10
  • Debian
  • FedoraLinux-42
  • SUSE-Linux-Enterprise-15-SP5
  • SUSE-Linux-Enterprise-15-SP6
  • Ubuntu
  • Ubuntu-24.04
  • archlinux
  • kali-linux
  • openSUSE-Tumbleweed
  • openSUSE-Leap-15.6
  • Ubuntu-18.04
  • Ubuntu-20.04
  • Ubuntu-22.04
  • OracleLinux_7_9
  • OracleLinux_8_7
  • OracleLinux_9_1

**It is possible to provide your own distribution to WSL, but that is out of scope for this KB.


What are the advantages/disadvantages of WSL?


Advantages:

  • Simplified installation
  • Shares system resources with Windows, no need to carve out dedicated resources as you would with a VM.
  • Seamless integration with Windows, allowing to access files between Windows and Linux.
  • Can out perform a VM in a lot of cases.
  • Great for machine learning


Disadvantages:

  • Windows still at the core if you need/want a full Linux environment
  • Not quite as fast as Linux on bare metal.
  • While a Desktop Environment (GUI) is technically available on WSL, it isn't accessed natively, but rather through an RDP session to the WSL instance. Reliability has been inconsistent.



What are some nuances to Linux compared to Windows?

  • Linux commands & Files/Folders are case sensitive
  • Pretty much all settings in Linux are stored in text files
  • Instead of C: for the OS, the root of Linux is /
  • Best practice is any user generated files be stored under the home folder (Example:  /home/JohnDoe/YourFilesGoHere)


Installing WSL



To install WSL, open up Terminal in Windows 11, or Powershell in Windows 10, the following commands will be run within Terminal.


To view available distributions available:

wsl --list --online
Generic


To install WSL with the default Ubuntu distro:

wsl --install
Generic


To install WSL with a specified distribution:

wsl --install --distribution <nameofdistro>

Example:
wsl --install --distribution archlinux
Generic


 Upon installing, you'll see something like the screen below where it should ask for a user account and password.


Alternatively, you can also install it from the Microsoft Store, as shown below.


Uninstalling a WSL instance



To list the installed WSL instances

wsl -l
Generic



To remove, run wsl with the unregister parameter 

wsl --unregister <DistroName>

Example:
wsl --unregister Ubuntu
Generic


Alternatively, you can also remove it from the Add/Remove programs list in Windows





Launching WSL



There are a couple ways to launch WSL


1. From the Start menu:


2. From within Terminal:

Note: If you don't see it in the Terminal menu, close Terminal, then re-launch Terminal, and it should now show up.



Using WSL Command Line



This is not a comprehensive list, but maybe a couple things to help get started. Please note some of these commands will be specific to Debian based distributions such as Ubuntu



Elevate permissions using the sudo command (similar to Run As Administrator in Windows). Stands for "Super User Do".

sudo <command>
Generic


To change directory

cd <folder you want to change to>

Examples:
cd /               (changes to the root>
cd /mnt         (changes to the /mnt directory)
cd Desktop   (assuming your in the /home/JohnDoe folder already, this moves you into the Desktop subfolder)
Generic


Search the package manager for installable apps

apt search <appname>

Example:
apt search neofetch
Generic


Install app from package manager

sudo apt install <appname>

Example:
sudo apt install neofetch
Generic


Browse the C: of your Windows OS within WSL  (change C to your desired Windows drive letter)

cd /mnt/c
ls or dir (to list directory contents)
Generic


You can also view the WSL filesystem from within Windows File Explorer


To list running processes

top
Generic


To get a nicer looking version of top

sudo apt install htop

then run:

htop
Generic


To make a directory/folder

mkdir <folderName>

Example:
mkdir MyNewFolder
Generic


To copy a file

cp <filename> <destinationpath>

Example:
cp myfile /home/JohnDoe
Generic


To move a file

mv <filename> <destination>

Example:
mv MyFile /home/JohnDoe
Generic


To remove a file

rm <filename>

Example:
rm MyFile
Generic


To create a blank file

touch <filename>

Example:
touch mynewfile
Generic


To display contents of file without opening it

cat <filename>

Example:
cat FileToShow
Generic


To open a file within a text editor

nano <filename>

Example:
nano MyFile
Generic




Using Linux Apps



As long as you have the appropriate video drivers for Windows installed onto your system, and are using a version 2 distro (most should be by default as of May 2025), you should be able to open most Linux apps that have a graphical user interface.

**Note, depending on the app, there may be some performance limitations, and some apps make take a little bit to open.


In the example shown below, after installing Audacity, typing in Audacity will launch the program, which can then be moved around like any other Windows app.



Alternatively, you can also choose to launch the app from the Windows Start menu. In this case, a search of the Start menu brings it up.




Setting up a Desktop Environment (GUI)



***Your mileage may vary with setting up a Desktop Environment, as it requires using Remote Desktop to connect into the GUI, which does not offer a native GUI experience.***

It is recommended to use a VM or install directly on your computer if a GUI is required, as this option has shown to not be reliable.


Start by checking for new updates for installed packages for the WSL instance

sudo apt update
Generic


Then install the updates

sudo apt upgrade -y
Generic


Then install a tool called TaskSel

sudo apt install tasksel -y
Generic


Run TaskSel

sudo tasksel
Generic


Select the Desktop Environment you want to install (KDE Plasma, and Cinnamon tend to have a Windows like feel, where as Gnome will have more of  a Mac feel to it)

It all comes down to personal preference. Use the arrow keys move the cursor, and space bar to select/unselect the Desktop Environment (DE) you want to use. **While you can install multiple DEs, it is recommended to only use one.**


Next install XRDP package

sudo apt install xrdp -y
Generic


Now you'll need to find the IP address of your WSL instance

ip a
Generic


Most of the time you'll be looking for the eth0 interface, and then the IP address (which is probably going to be a private IP)


From Windows, open Remote Desktop, and enter the IP address

Enter your WSL username and password, 

Was this answer helpful?