WSL Start: Open a Linux Distribution on Windows

WSL Start: Open a Linux Distribution on Windows

Opening a Linux shell on Windows starts with knowing whether a Linux distribution is already installed. WSL lets Windows run a Linux distribution, a packaged Linux environment such as Ubuntu, alongside Windows applications.

This article shows how to check for an installed distribution and start the default one or choose a named distribution.

TL;DR

If no distribution is installed, install WSL first with wsl --install from an elevated PowerShell window and restart Windows.

  • Run wsl --list --verbose to see installed distributions and their state.
  • Use the Start menu or Windows Terminal when you prefer a separate tab or window.

What Is WSL?

Windows Subsystem for Linux (WSL) lets Windows run a Linux distribution and its command-line tools alongside Windows applications. A distribution, often called a distro, is a packaged Linux environment such as Ubuntu or Debian, with its own files, installed packages and Linux user account.

WSL 1 translates Linux system calls, while WSL 2 runs a Linux kernel in a lightweight virtual machine. The verbose distribution list shows which version each installed distro uses.

Run WSL management commands from the Windows side, such as PowerShell, Command Prompt or Windows Terminal. From a Linux shell, Microsoft’s reference uses the executable name wsl.exe for calls back to the Windows launcher. This distinction matters when a command guide is written for one shell but you are working in another.

How to Start WSL and a Linux Distribution

Use the Windows command line to install WSL once, then start the distro whenever you need a Linux shell. These steps cover a fresh setup and the common case where WSL is already installed.

Step 1: Check Windows and install WSL if needed

The current one-command installation route requires Windows 10 version 2004, build 19041 or later, or Windows 11. Open PowerShell as an administrator only for installation, then enter:

wsl --install

The command enables the required Windows components and installs Ubuntu by default. Restart Windows when prompted. When installation is complete, continue to the launch steps below.

Step 2: Choose another Linux distribution when installing

To see the distribution names available through WSL, run this in PowerShell or Command Prompt:

wsl --list --online

Install one by supplying its exact listed name. For example, this command selects Debian instead of the default Ubuntu:

wsl --install --distribution Debian

Use the name shown by the online list rather than guessing a spelling. Restart if Windows requests it. Then continue with the launch steps below.

Step 3: Start the default distribution

Open Windows Terminal, PowerShell or Command Prompt and run:

wsl

WSL opens the default registered distribution in that terminal session. When you want to begin in the Linux home directory rather than the current Windows directory mapping, use:

wsl ~

The tilde is the Linux home-directory shortcut. It is useful when you want a consistent starting directory regardless of which folder PowerShell currently uses.

Step 4: Start a named distribution

When more than one distro is installed, choose one explicitly with the name reported by the installed-distribution list. For example:

wsl --distribution Ubuntu

You can shorten the option to -d, as in wsl -d Debian.

Step 5: Set the default distro you use often

If a particular distro should open whenever you type just wsl, set it as the default from PowerShell or Command Prompt:

wsl --set-default Debian

Replace Debian with the exact installed name. This changes which distribution a bare wsl command opens.

Step 6: Finish the first launch and verify the state

Ubuntu’s first launch may take longer while its files are unpacked. The terminal prompts you to create a Linux username and password, separate from your Windows sign-in.

After setup, close the distro with exit if you want to return to PowerShell. To inspect installed distributions and their state, run:

wsl --list --verbose

The state column distinguishes a running distro from a stopped one. Running wsl or naming a distro starts it as needed.

Step 7: Update WSL when a command is unavailable

Options vary across older WSL installations. Check the installed WSL version and general configuration before changing it:

wsl --version
wsl --status

If these commands are supported and the installed WSL package needs an update, Microsoft documents the following command. The optional web-download flag uses a download route outside Microsoft Store delivery.

wsl --update
wsl --update --web-download

Choose one route at a time. The first requests the normal update channel. The alternate route is useful if the normal store download stalls.

Step 8: Run a Linux command without opening a shell

WSL can run a single Linux command from PowerShell or Command Prompt, which suits a quick check or script invocation. For example, these commands print the current Linux directory and username:

wsl pwd
wsl --distribution Debian whoami

The first form uses the default distribution. The second selects Debian for that command. When the Linux command finishes, control returns to the Windows shell instead of leaving an interactive Linux prompt open.

Step 9: Back up or move a distribution

Before moving a distro or preserving a copy, export it to a tar archive from PowerShell. Choose a destination with sufficient free space and a filename you can identify later:

wsl --export Ubuntu C:\Users\YourName\ubuntu-backup.tar

Replace the example user path with a writable Windows location. The archive contains the distribution filesystem. Protect it like any backup that may contain source code, configuration or credentials.

To register an exported archive as a separate distro, provide a new name, an installation directory and the archive path. Use an empty destination folder:

wsl --import UbuntuCopy C:\WSL\UbuntuCopy C:\Users\YourName\ubuntu-backup.tar

After import, list distributions and start the new registration by its name. Importing creates a separate registration and leaves the original in place. Keep the archive until you have confirmed the imported files and programs are present.

Step 10: Find the WSL 2 address for a network task

When a network setup needs a WSL 2 guest address, Microsoft documents this Linux-side query:

wsl hostname -I

The uppercase I requests the distribution address. Follow the service’s networking instructions when using that address.

WSL Start Problems and Fixes

Common launch failures point to one of three conditions: no distro is registered, the Windows build is too old for the one-command install, or a required Windows feature or virtualization setting is unavailable.

SymptomWhat to checkNext action
No installed distributionsRun wsl --list --verboseInstall a distro with wsl --install -d Ubuntu, then launch it once.
Unknown distro nameCompare spelling with the installed listUse the exact name after -d or --distribution.
wsl --install shows helpWSL may already be present or Windows may use an older buildRun wsl --list --online. install a named distro, or follow Microsoft’s manual installation guide for older Windows.
Error 0x8007019eThe WSL optional component may not be enabledUse the supported install flow or Microsoft’s manual setup instructions. restart if Windows requests it.
Error 0x80370102WSL 2 virtualization requirements may not be metCheck that virtualization is enabled in firmware and that the Virtual Machine Platform feature is available. Follow the device maker’s instructions.

WSL registrations belong to the Windows user account that installed them. If an elevated shell shows no distro, reopen the terminal under that same Windows account and check the list again.

If installation stays at zero percent, Microsoft documents wsl --install --web-download -d Ubuntu as an alternate download route. Substitute your distro name.

To stop a single distro cleanly, run wsl --terminate Ubuntu from Windows, using its registered name. To stop all running distros and the WSL 2 utility virtual machine, use wsl --shutdown.

Windows drives are mounted under /mnt. The C: drive path is /mnt/c, which lets Linux tools open Windows-side files.

When a distribution is no longer needed, first export any files you want to keep. The unregister command permanently removes the distro registration and its data, so check the exact name before using it:

wsl --unregister Ubuntu

This is a destructive operation. It removes the selected Linux filesystem, applications and configuration. Unregister a disposable copy only after verifying that the name refers to the copy rather than your working distro.

External storage and physical disks need a separate mount workflow. Check Microsoft’s disk-mount documentation for the supported procedure on your Windows version. Unmount a disk cleanly before disconnecting hardware.

If the purpose is to move an environment, export and import are more suitable than copying a distro’s internal virtual disk files by hand. Confirm the archive and imported distribution before removing the original. An export is also useful before experimenting with settings that could affect an existing environment.

Available distribution names can change as Microsoft updates its catalog, so use the names returned by the current online list when installing.

Each distro maintains its own packages and Linux users. Identify the active environment before installing software, especially when you use separate distros to test different configurations.

For help with a command option, run wsl --help in the Windows shell. The help output reflects the options supported by the installed WSL version. If an option documented online is missing, update WSL or consult Microsoft’s manual installation guidance for the Windows build in use.

Files inside the Linux filesystem follow Linux ownership and permission behavior. Files on a mounted Windows drive follow Windows filesystem behavior, which can affect permissions, case sensitivity and tool expectations. Choose a project location based on which system’s development tools will work with those files.

Conclusion: Open the Distribution You Need

Choose a launch method that matches the terminal workflow you prefer.

For the next task, see the Ubuntu on WSL installation guide, the openSUSE on WSL guide, and the Windows Terminal guide for WSL. Microsoft’s WSL basic commands reference lists additional launch and management options.

FAQ

These answers cover common questions about opening a WSL distribution after installation.

How do I start WSL from PowerShell?

Run wsl to open the default distribution, or use wsl -d Ubuntu to open Ubuntu by name.

How do I start Ubuntu in WSL?

Run wsl –distribution Ubuntu from PowerShell, Command Prompt or Windows Terminal. Ubuntu must already be installed.

Does WSL start automatically?

A distro starts when you launch it from the Start menu, Windows Terminal or a WSL command. Use wsl –list –verbose to check its current state.

What if WSL says there are no installed distributions?

Install one with wsl –install -d Ubuntu, restart if prompted, then open Ubuntu once to finish its initial setup.