close

Home

Windows 10

How to Install Ubuntu in Windows 10 with WSL 2

Author avatar - Russell Smith

Russell Smith

|

Windows Subsystem for Linux (WSL) is an optional feature in Windows 10 that allows developers and system administrators to run Linux shells and command-line applications without installing Linux in a virtual machine (VM). WSL provides developers with an integrated experience so they can develop and test Linux apps without ever leaving their Windows desktop. For example, you can open a Linux shell in Windows Terminal or use Visual Studio Code to build, debug, and run Linux code without installing Linux in a VM.

WSL 2 uses a new architecture to provide the benefits of WSL 1 but with better performance and compatibility. WSL 2 uses a full Linux kernel, which is kept up-to-date automatically by Microsoft, to provide full system call compatibility and fast disk performance. WSL 2 runs your chosen Linux distribution in a lightweight managed VM, which doesn’t require any configuration or management on your part.

For more information on how to run Linux GUI apps using WSL, check out How to Install Linux GUI Apps in Windows 10 and Windows 11 with WSL on Petri.

Microsoft recommends using WSL 2 unless your Linux project files must be stored in the Windows file system, or you need access to a serial port or USB device, or you need to restrict the memory usage of your Linux distribution on Windows. WSL 2 is available in Windows 10 version 1903 (build 18362) or higher (x64) or Windows for ARM version 2004 or higher (ARM64). It’s worth noting that at the time of writing, Windows Server doesn’t support WSL 2, you’ll need to use original WSL distributions.

Sponsored Content

Centralize, Manage and Secure Remote Connections

Centralized remote connection technologies, remote machine data, password management and access control on a platform that is secure, scalable and refreshingly simple to use.

Install Windows Subsystem for Linux 2

There’s a simplified WSL 2 install procedure coming to Windows 10 in the 21H2 update, which is due in the second half of 2021. But for now, you’ll need to perform several steps to get WSL 2 running in Windows 10.

  • Open the command prompt with administrator privileges. Type cmd in the search box in the bottom left of the taskbar. Make sure that Command Prompt is highlighted in the results and then click Run as administrator in the list of options in the panel on the right.
  • Give consent or enter an administrator username and password as prompted.
  • In the command prompt window, use DISM to install WSL and the Virtual Machine Platform feature.
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
  • Once the installation of both features is complete, restart your PC.
How to Install Ubuntu in Windows 10 with WSL 2 (Image Credit: Russell Smith)

Install the Linux kernel update package

Now that the WSL and Virtual Machine Platform features are installed, download and run the Linux kernel update package. Download the latest x64 version of the package here. ARM64 users can get the package here. Run the installer and follow through the simple steps to install it. You might be required to give consent or provide an administrator username and password to complete the setup process.

How to Install Ubuntu in Windows 10 with WSL 2 (Image Credit: Russell Smith)

Set WSL 2 as the default

Now set WSL 2 as the default version. This will ensure you are using WSL 2 when you install your first Linux distro.

  • Type cmd in the search box in the bottom left of the taskbar. Click Command Prompt in the list of results.
  • In the command prompt window, run the command below.
wsl --set-default-version 2
How to Install Ubuntu in Windows 10 with WSL 2 (Image Credit: Russell Smith)

Install Ubuntu in WSL 2

Now we’re set to install Ubuntu in WSL. You can install a Linux distribution using wsl.exe or from the Microsoft Store. Let’s check out how to install Ubuntu from the Store.

  • Type store in the search box in the bottom left of the taskbar. Click Microsoft Store in the list of results.
  • In the Store window, type ubuntu in the Search box in the top right corner and click Ubuntu in the list of results. Only select the LTS versions of Ubuntu if you want to install a distribution from the long-term servicing channel.
  • On the Ubuntu app page, click Install in the top left corner.
How to Install Ubuntu in Windows 10 with WSL 2 (Image Credit: Russell Smith)
  • Once Ubuntu has installed, click Launch in the top left corner of the Store window.
  • This will launch the Ubuntu command console. The first time Ubuntu launches, you’ll be required to enter and confirm a password for the first user. Type and confirm a password.
How to Install Ubuntu in Windows 10 with WSL 2 (Image Credit: Russell Smith)
  • Once the first account has been set up with a password, you get access to the Ubuntu prompt.
How to Install Ubuntu in Windows 10 with WSL 2 (Image Credit: Russell Smith)

If you need to launch the Ubuntu command console again, you’ll find Ubuntu in the list of apps on the Windows Start menu. You can also access the Ubuntu shell using Windows Terminal.

 

Article saved!

Access saved content from your profile page. View Saved