Skip to content
Search

Windows Subsystem for Linux

lastmod 2026-10-01created 2019-04-1025 edits

A feature supported since Windows 10 that lets you install Linux on Windows.

Categories

  • wslconfig - location of the ~/.wslconfig file.

Check

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Installation

Check that Vitualization Technology is enabled in the BIOS settings, and

in Turn Windows features on or off, check "Windows Subsystem for Linux" and "Virtual Machine Platform".

Or run the following from the command line:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Rebooting the computer is required.

At this point, proceed with #Installing a distribution.

If it still doesn't work, try enabling the Hyper-V feature:

dism.exe /online /enable-feature /featurename:Microsoft-Hyper-V-All /all /norestart

Rebooting the computer is required.

Installing with wsl.exe

If you just type wsl:

zer0@DESKTOP-11F854J C:\Users\zer0>wsl
Linux용 Windows 하위 시스템 설치되어 있지 않습니다. 'wsl.exe --install'을 실행하여 설치할 수 있습니다.
자세한 내용은 https://aka.ms/wslinstall
 참조하세요.
Linux용 Windows 하위 시스템 설치하려면 아무 키나 누르세요.
CTRL-C 누르거나 이 창을 닫아 취소하세요.
이 프롬프트는 60초 후 시간이 초과됩니다.
작업이 중단되었습니다.

If you type wsl --install:

zer0@DESKTOP-11F854J C:\Users\zer0>wsl --install
다운로드 중: Linux용 Windows 하위 시스템 2.6.2
설치 중: Linux용 Windows 하위 시스템 2.6.2
Linux용 Windows 하위 시스템 2.6.2이(가) 설치되었습니다.
Windows 선택적 구성 요소 설치 중: VirtualMachinePlatform

배포 이미지 서비스 및 관리 도구
버전: 10.0.26100.5074

이미지 버전: 10.0.26200.7462

기능을 사용하도록 설정하는 중
[==========================100.0%==========================]
작업을 완료했습니다.
요청한 작업이 잘 실행되었습니다. 시스템을 다시 시작하면 변경 사항이 적용됩니다.

Since Korean: 배포 이미지 서비스 및 관리 도구 (Deployment Image Servicing and Management) is printed partway through, it seems to run dism.exe as a subprocess.

Now restart the system.

Installing a distribution

This command enables the features needed to run WSL and install a Linux distribution such as Ubuntu.

wsl --install -d <배포 이름>

To install Ubuntu 24.04:

wsl --install -d Ubuntu-24.04

Listing distributions

wsl -l -o
## 또는
wsl --list --option

Connecting to a specific distribution

Connect to WSL2 Ubuntu:

wsl -d Ubuntu-24.04

Setting WSL2 as the default version

Set the default version to 2:

wsl --set-default-version 2

How to check the version assigned to each distribution:

wsl --list --verbose

Set a specific distribution to version 2:

wsl --set-version Ubuntu-24.04 2

Shutting down WSL

wsl --shutdown

Root directory

When installing ubuntu, check the path below.

C:\Users\<username>\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState

Going open source

Microsoft announced that it has made all of WSL open source, which is also an answer to "Will this be open source?", the very first issue in the Microsoft/WSL repository

  • You can download the source from Microsoft/WSL on GitHub and build it yourself, add features, or fix bugs
  • The released code covers the command-line tools, the service, the Linux daemons, and even the Plan9-based file sharing server
  • WSL consists of a Windows-side executable part and several components running inside a Linux virtual machine (VM)
    • CLI tools: wsl.exe, wslconfig.exe, wslg.exe
    • WSL service: wslservice.exe, responsible for booting the VM, running distributions, file sharing, etc.
    • Linux daemons: init, gns, localhost, etc., handling networking and port forwarding
    • Plan9 server: handles file sharing between Windows and Linux
  • Components that were already open source
    • WSLg: graphics environment components supporting Wayland and X servers
    • WSL2-Linux-Kernel: Linux kernel source
  • Components not yet open
    • Lxcore.sys: the core driver of WSL1
    • P9rdr.sys, p9np.dll: the file redirection system that supports the \wsl.localhost path in Windows

Background of the open-source move and history of WSL

  • WSL was first announced at BUILD in 2016 and shipped in the Windows 10 Anniversary Update
  • WSL1 was built on lxcore.sys, which handled Linux syscalls inside the Windows kernel
  • WSL2 was first announced in 2019 and improved compatibility and features by using a real Linux kernel
  • It then grew with added features such as GPU support, running GUI apps (wslg), and systemd support
  • Since 2021 it has been delivered through the Microsoft Store as a standalone package separate from Windows
    • The first release was 0.47.1 (preview); later, 1.0.0 in 2022 extended support to Windows 10
  • From Windows 11 24H2, the old built-in WSL was replaced by the new package-based WSL
    • wsl.exe was kept to support the transition for users

WSL2

  • Isn't WSL2 just a VM? | GeekNews
  • The Windows NT subsystem architecture has long consisted of API call translation layers for running programs built for other operating systems
  • WSL1 continued this tradition, working as a lightweight translation layer that converts Linux calls into Windows kernel calls
  • To solve performance problems, WSL2 switched to a full Linux VM based on Hyper-V that runs a real Linux kernel
  • WSL2 offers tighter integration than an ordinary VM, through dynamic memory management, mounting Windows drives, and GUI integration via WSLg
  • It has limitations such as inconvenient file management and dependence on disk images, but the flexibility to choose between the pros and cons of WSL1 and WSL2 matters

Troubleshooting

WslRegisterDistribution failed with error: 0x800701bc

WslRegisterDistribution failed with error: 0x800701bc
Error: 0x800701bc WSL 2? ?? ?? ????? ?????. ??? ??? https://aka.ms/wsl2kernel? ????? .

Downloading the linux kernel update package fixes the problem. Go here, download the update, and install it.

Then set WSL 2 as the default version

wsl --set-default-version 2

WslRegisterDistribution failed with error: 0x80370102

Installing, this may take a few minutes...
WslRegisterDistribution failed with error: 0x80370102
Please enable the Virtual Machine Platform Windows feature and ensure virtualization is enabled in the BIOS.
For information please visit https://aka.ms/enablevirtualization
Press any key to continue...

Check that Vitualization Technology is enabled in the BIOS settings.

If you use Virtual Box, also check the "Nested Virtualization" items:

  • Enable VT-x/AMD-V
  • Enable Nested Paging

Check that hypervisor launch is enabled in the boot configuration. You can verify this by running powershell with administrator privileges.

bcdedit /enum | findstr -i hypervisorlaunchtype

If you see "hypervisorlaunchtype Off", the hypervisor is disabled. To enable it, run the following in powershell with administrator privileges.

bcdedit /set hypervisorlaunchtype Auto

See also

  • Windows
  • dism - Deployment Image Servicing and Management
  • bcdedit - Boot Configuration Data store editor
  • NSL - WSL for Linux

Favorite site

author Zer0 sitemap