Skip to content

Installing Linux onto Windows with WSL

Steps for installing WSL, installing Linux, uninstalling Linux, and looking at your versions.

2 min read

Table of Contents

I’m starting to play around with other developer languages, like Ruby, and wanted to set up a development environment on my  Windows machine, which I typically only use for gaming. The first step was to set up WSL (Windows Subsystem for Linux) which allows me to run Linux CLI on Windows. 

WSL

WSL (Windows Subsystem for Linux) allows you to run Linux directly on your Windows machine. This is useful for development, for example, when you need to use Linux but don’t want to switch to a separate Linux machine or VM.

Installing WSL

To install WSL on Windows, you need to use PowerShell. You’ll run a command to enable the feature. Restart your computer (got to love Windows) and then update WSL and then you’ll be ready to install Linux.

  • Open the Windows PowerShell in the Terminal with administrator privileges.
  • Run the command Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux.
  • When prompted to restart the computer, select Yes.
  • Return to the Terminal and ensure WSL is updated by running the command wsl.exe --update to ensure everything is up to date.
  • When finished, restart your computer, again. 

Installing Linux

You can choose which version of Linux to install and run a few commands to get it started.

  • Run the command wsl --list --online to see the available Linux distributions that can be installed.
  • Install the latest Ubuntu LTS version using the command wsl --install Ubuntu-24.04.
  • When the installation finishes successfully, you will be prompted for a username and password. Enter then and save them in your favorite password manager.

Checking your version of Linux

  • Open the Windows PowerShell in the Terminal with administrator privileges.
  • Run the command wsl -l -v.

Running Linux

When you install Linux, a profile is automatically created in your  terminal. You can select it in a new tab.

Uninstall a version of Linux

If you want to uninstall a version of Linux. 

  • Open the Windows PowerShell in the Terminal with administrator privileges.
  • Run the command wsl --uninstall Ubuntu-24.04.

Reference

Development

Related Posts

Document your work!

Documentation is vital for software developers. It boosts understanding, ensures thoroughness, improves collaboration, and saves future time and effort.

Thoughts about code comments

Argues for comments that explain code's purpose to other developers, serving as a guide and documentation extension rather than code repetition. It also stresses deleting commented-out code and relying on source control.