Windows WSL
Windows WSL
Windows Subsystem for Linux (WSL) lets developers run a GNU/Linux environment --
including most command-line tools, utilities, and applications -- directly on Windows,
unmodified, without the overhead of a traditional virtual machine or dual-boot setup.
Install WSL
Learn more
What is the Windows Subsystem for Linux (WSL)?
What's new with WSL 2?
Comparing WSL 1 and WSL 2
Frequently Asked Questions
Get started
Install WSL
Install Linux on Windows Server
Manual install steps
Best practices for setting up a WSL development environment
Provide feedback
GitHub issue tracker: WSL
GitHub issue tracker: WSL documentation
Related videos
WSL BASICS
1. What is the Windows Subsystem for Linux (WSL)? | One Dev Question (0:40)
2. I'm a Windows developer. Why should I use WSL? | One Dev Question (0:58)
3. I'm a Linux developer. Why should I use WSL? | One Dev Question (1:04)
4. What is Linux? | One Dev Question (1:31)
5. What is a Linux distro? | One Dev Question (1:04)
6. How is WSL different than a virtual machine or dual booting? | One Dev
Question
7. Why was the Windows Subsystem for Linux created? | One Dev Question (1:14)
8. How do I access files on my computer in WSL? | One Dev Question (1:41)
9. How is WSL integrated with Windows? | One Dev Question (1:34)
10. How do I configure a WSL distro to launch in the home directory in Terminal? |
One Dev Question (0:47)
11. Can I use WSL for scripting? | One Dev Question (1:04)
12. Why would I want to use Linux tools on Windows? | One Dev Question (1:20)
13. In WSL, can I use distros other than the ones in the Microsoft Store? | One Dev
Question (1:03)
WSL DEMOS
1. WSL2: Code faster on the Windows Subsystem for Linux! | Tabs vs Spaces (13:42)
2. WSL: Run Linux GUI Apps | Tabs vs Spaces (17:16)
3. WSL 2: Connect USB devices | Tabs vs Spaces (10:08)
4. GPU Accelerated Machine Learning with WSL 2 | Tabs vs Spaces (16:28)
5. Visual Studio Code: Remote Dev with SSH, VMs, and WSL | Tabs vs Spaces (29:33)
6. Windows Dev Tool Updates: WSL, Terminal, Package Manager, and more | Tabs
vs Spaces (20:46)
7. Build Node.JS apps with WSL | Highlight (3:15)
8. New memory reclaim feature in WSL 2 | Demo (6:01)
9. Web development on Windows (in 2019) | Demo (10:39)
The Windows Subsystem for Linux lets developers run a GNU/Linux environment --
including most command-line tools, utilities, and applications -- directly on Windows,
unmodified, without the overhead of a traditional virtual machine or dualboot setup.
You can:
Install WSL
https://www.youtube-nocookie.com/embed/48k317kOxqg
What is WSL 2?
WSL 2 is a new version of the Windows Subsystem for Linux architecture that powers
the Windows Subsystem for Linux to run ELF64 Linux binaries on Windows. Its primary
goals are to increase file system performance, as well as adding full system call
compatibility.
This new architecture changes how these Linux binaries interact with Windows and your
computer's hardware, but still provides the same user experience as in WSL 1 (the
current widely available version).
Individual Linux distributions can be run with either the WSL 1 or WSL 2 architecture.
Each distribution can be upgraded or downgraded at any time and you can run WSL 1
and WSL 2 distributions side by side. WSL 2 uses an entirely new architecture that
benefits from running a real Linux kernel.
https://www.youtube-nocookie.com/embed/MrZolfGm8Zk
Comparing WSL Versions
Article • 03/20/2023
Learn more about different WSL versions, including why WSL 2 is now the default and
the specific scenarios or exceptions that may warrant switching your installed Linux
distribution to the earlier WSL 1 architecture.
Comparing features
Managed VM ❌ ✅
As you can tell from the comparison table above, the WSL 2 architecture outperforms
WSL 1 in several ways, with the exception of performance across OS file systems, which
can be addressed by storing your project files on the same operating system as the
tools you are running to work on the project.
WSL 2 is only available in Windows 11 or Windows 10, Version 1903, Build 18362 or
later. Check your Windows version by selecting the Windows logo key + R, type winver,
select OK. (Or enter the ver command in Windows Command Prompt). You may need
to update to the latest Windows version. For builds lower than 14393, WSL is not
supported at all.
7 Note
WSL 2 will work with VMware 15.5.5+ and VirtualBox 6+ . Learn more in our
FAQs.
WSL 2 architecture
A traditional VM experience can be slow to boot up, is isolated, consumes a lot of
resources, and requires your time to manage it. WSL 2 does not have these attributes.
WSL 2 provides the benefits of WSL 1, including seamless integration between Windows
and Linux, fast boot times, a small resource footprint, and requires no VM configuration
or management. While WSL 2 does use a VM, it is managed and run behind the scenes,
leaving you with the same user experience as WSL 1.
Learn more in the Release Notes for Windows Subsystem for Linux kernel.
The actual speed increase will depend on which app you're running and how it is
interacting with the file system. Initial versions of WSL 2 run up to 20x faster compared
to WSL 1 when unpacking a zipped tarball, and around 2-5x faster when using git
clone, npm install and cmake on various projects.
A whole new set of apps that you can run inside of WSL, such as Docker and more.
Any updates to the Linux kernel are immediately ready for use. (You don't have to
wait for the WSL team to implement updates and add the changes).
Your project files must be stored in the Windows file system. WSL 1 offers faster
access to files mounted from Windows.
If you will be using your WSL Linux distribution to access project files on the
Windows file system, and these files cannot be stored on the Linux file system,
you will achieve faster performance across the OS files systems by using WSL 1.
A project which requires cross-compilation using both Windows and Linux tools on
the same files.
File performance across the Windows and Linux operating systems is faster in
WSL 1 than WSL 2, so if you are using Windows applications to access Linux
files, you will currently achieve faster performance with WSL 1.
Your project needs access to a serial port or USB device. However, USB device
support is now available for WSL 2 via the USBIPD-WIN project. See Connect USB
devices for set up steps.
WSL 2 does not include support for accessing serial ports. Learn more in the FAQs
or in WSL GitHub repo issue on serial support .
You have strict memory requirements
WSL 2's memory usage grows and shrinks as you use it. When a process frees
memory this is automatically returned to Windows. However, as of right now
WSL 2 does not yet release cached pages in memory back to Windows until the
WSL instance is shut down. If you have long running WSL sessions, or access a
very large amount of files, this cache can take up memory on Windows. We are
tracking the work to improve this experience on the WSL GitHub repository
issue 4166 .
For those using VirtualBox, you may need to consider the version that you are
running and whether it is compatible with WSL 2. (See WSL GitHub repository issue
798 for the full discussion. It appears that VirtualBox v6.1.16 works well with WSL
2, but that other versions may experience issues.)
If you rely on a Linux distribution to have an IP address in the same network as
your host machine, you may need to set up a workaround in order to run WSL 2.
WSL 2 is running as a hyper-v virtual machine. This is a change from the bridged
network adapter used in WSL 1, meaning that WSL 2 uses a Network Address
Translation (NAT) service for its virtual network, instead of making it bridged to the
host Network Interface Card (NIC) resulting in a unique IP address that will change
on restart. To learn more about the issue and workaround that forwards TCP ports
of WSL 2 services to the host OS, see WSL GitHub repository issue 4150, NIC
Bridge mode (TCP Workaround) .
7 Note
Consider trying the VS Code Remote WSL Extension to enable you to store your
project files on the Linux file system, using Linux command line tools, but also using
VS Code on Windows to author, edit, debug, or run your project in an internet
browser without any of the performance slow-downs associated with working
across the Linux and Windows file systems. Learn more.
The WSL commands below are listed in a format supported by PowerShell or Windows
Command Prompt. To run these commands from a Bash / Linux distribution command
line, you must replace wsl with wsl.exe . For a full list of commands, run wsl --help .
Install
PowerShell
wsl --install
Install WSL and the default Ubuntu distribution of Linux. Learn more. You can also use
this command to install additional Linux distributions by running wsl --install
<Distribution Name> . For a valid list of distribution names, run wsl --list --online .
Options include:
--distribution : Specify the Linux distribution to install. You can find available
--web-download : Install from an online source rather than using the Microsoft
Store.
--inbox : Installs WSL using the Windows component instead of using the
Microsoft Store. (WSL updates will be received via Windows updates, rather than
pushed out as-available via the store).
--enable-wsl1 : Enables WSL 1 during the install of the Microsoft Store version of
WSL by also enabling the "Windows Subsystem for Linux" optional component.
--no-distribution : Do not install a distribution when installing WSL.
7 Note
If you running WSL on Windows 10 or an older version, you may need to include
the -d flag with the --install command to specify a distribution: wsl --install -
d <distribution name> .
List available Linux distributions
PowerShell
See a list of the Linux distributions available through the online store. This command
can also be entered as: wsl -l -o .
See a list of the Linux distributions installed on your Windows machine, including the
state (whether the distribution is running or stopped) and the version of WSL running
the distribution (WSL 1 or WSL 2). Comparing WSL 1 and WSL 2. This command can also
be entered as: wsl -l -v . Additional options that can be used with the list command
include: --all to list all distributions, --running to list only distributions that are
currently running, or --quiet to only show distribution names.
To designate the version of WSL (1 or 2) that a Linux distribution is running on, replace
<distribution name> with the name of the distribution and replace <versionNumber>
To set the default Linux distribution that WSL commands will use to run, replace
<Distribution Name> with the name of your preferred Linux distribution.
wsl ~
The ~ can be used with wsl to start in the user's home directory. To jump from any
directory back to home from within a WSL command prompt, you can use the
command: cd ~ .
To run a specific Linux distribution with a specific user, replace <Distribution Name> with
the name of your preferred Linux distribution (ie. Debian) and <User Name> with the
name of an existing user (ie. root). If the user doesn't exist in the WSL distribution, you
will receive an error. To print the current user name, use the command whoami .
Update WSL
PowerShell
wsl --update
--web-download : Download the latest update from the GitHub rather than the
Microsoft Store.
wsl --status
See general information about your WSL configuration, such as default distribution type,
default distribution, and kernel version.
wsl --version
Help command
PowerShell
wsl --help
Change the default user for your distribution log-in. The user has to already exist inside
the distribution in order to become the default user.
For example: ubuntu config --default-user johndoe would change the default user for
the Ubuntu distribution to the "johndoe" user.
7 Note
If you are having trouble figuring out the name of your distribution, use the
command wsl -l .
2 Warning
This command will not work for imported distributions, because these distributions
do not have an executable launcher. You can instead change the default user for
imported distributions using the /etc/wsl.conf file. See the Automount options in
the Advanced Settings Configuration doc.
Shutdown
PowerShell
wsl --shutdown
Immediately terminates all running distributions and the WSL 2 lightweight utility virtual
machine. This command may be necessary in instances that require you to restart the
WSL 2 virtual machine environment, such as changing memory usage limits or making a
change to your .wslconfig file.
Terminate
PowerShell
Identify IP address
wsl hostname -i for the IP address of your Linux distribution installed via WSL 2
PowerShell
Imports and exports the specified tar file as a new distribution. The filename can be - for
standard input. Options include:
tar file
--version : For import only, specifies whether to import the distribution as a WSL 1
or WSL 2 distribution
PowerShell
Replacing <DistributionName> with the name of your targeted Linux distribution will
unregister that distribution from WSL so it can be reinstalled or cleaned up. Caution:
Once unregistered, all data, settings, and software associated with that distribution will
be permanently lost. Reinstalling from the store will install a clean copy of the
distribution. For example, wsl --unregister Ubuntu would remove Ubuntu from the
distributions available in WSL. Running wsl --list will reveal that it is no longer listed.
You can also uninstall the Linux distribution app on your Windows machine just like any
other store application. To reinstall, find the distribution in the Microsoft Store and
select "Launch".
Attach and mount a physical disk in all WSL2 distributions by replacing <DiskPath> with
the directory\file path where the disk is located. See Mount a Linux disk in WSL 2.
Options include:
--type <Filesystem> : Filesystem type to use when mounting a disk, if not specified
defaults to ext4. This command can also be entered as: wsl --mount -t
<Filesystem> .You can detect the filesystem type using the command: blkid
<BlockDevice> , for example: blkid <dev/sdb1> .
included when mounting a disk. For example, ext4 mount options like: wsl --
mount -o "data-ordered" or wsl --mount -o "data=writeback . However, only
7 Note
If you're running a 32-bit process in order to access wsl.exe (a 64-bit tool), you may
need to run the command in the following manner: C:\Windows\Sysnative\wsl.exe
--command .
Unmount disks
PowerShell
Unmount a disk given at the disk path, if no disk path is given then this command will
unmount and detach ALL mounted disks.
PowerShell
bash [Options]
PowerShell
lxrun /[Argument]
These commands were the original wsl syntax for configuring Linux distributions
installed with WSL, but have been replaced with the wsl or wsl.exe command syntax.
How to install Linux on Windows with
WSL
Article • 08/28/2023
Developers can access the power of both Windows and Linux at the same time on a
Windows machine. The Windows Subsystem for Linux (WSL) lets developers install a
Linux distribution (such as Ubuntu, OpenSUSE, Kali, Debian, Arch Linux, etc) and use
Linux applications, utilities, and Bash command-line tools directly on Windows,
unmodified, without the overhead of a traditional virtual machine or dualboot setup.
Prerequisites
You must be running Windows 10 version 2004 and higher (Build 19041 and higher) or
Windows 11 to use the commands below. If you are on earlier versions please see the
manual install page.
PowerShell
wsl --install
This command will enable the features necessary to run WSL and install the Ubuntu
distribution of Linux. (This default distribution can be changed).
If you're running an older build, or just prefer not to use the install command and would
like step-by-step directions, see WSL manual installation steps for older versions.
The first time you launch a newly installed Linux distribution, a console window will open
and you'll be asked to wait for files to de-compress and be stored on your machine. All
future launches should take less than a second.
7 Note
The above command only works if WSL is not installed at all, if you run wsl --
install and see the WSL help text, please try running wsl --list --online to see a
list of available distros and run wsl --install -d <DistroName> to install a distro. To
uninstall WSL, see Uninstall legacy version of WSL or unregister or uninstall a
Linux distribution.
Tip
If you run into an issue during the install process, check the installation section of the
troubleshooting guide.
To install a Linux distribution that is not listed as available, you can import any Linux
distribution using a TAR file. Or in some cases, as with Arch Linux , you can install using
an .appx file. You can also create your own custom Linux distribution to use with WSL.
To set the default version to WSL 1 or WSL 2 when a new Linux distribution is installed,
use the command: wsl --set-default-version <Version#> , replacing <Version#> with
either 1 or 2.
To set the default Linux distribution used with the wsl command, enter: wsl -s
<DistributionName> or wsl --setdefault <DistributionName> , replacing
<DistributionName> with the name of the Linux distribution you would like to use. For
example, from PowerShell/CMD, enter: wsl -s Debian to set the default distribution to
Debian. Now running wsl npm init from Powershell will run the npm init command in
Debian.
To run a specific wsl distribution from within PowerShell or Windows Command Prompt
without changing your default distribution, use the command: wsl -d
<DistributionName> , replacing <DistributionName> with the name of the distribution you
want to use.
The wsl --set-version command can be used to downgrade from WSL 2 to WSL 1 or to
update previously installed Linux distributions from WSL 1 to WSL 2.
To see whether your Linux distribution is set to WSL 1 or WSL 2, use the command: wsl
-l -v .
To change versions, use the command: wsl --set-version <distro name> 2 replacing
<distro name> with the name of the Linux distribution that you want to update. For
example, wsl --set-version Ubuntu-20.04 2 will set your Ubuntu 20.04 distribution to
use WSL 2.
If you manually installed WSL prior to the wsl --install command being available, you
may also need to enable the virtual machine optional component used by WSL 2 and
install the kernel package if you haven't already done so.
To learn more, see the Command reference for WSL for a list of WSL commands,
Comparing WSL 1 and WSL 2 for guidance on which to use for your work scenario, or
Best practices for setting up a WSL development environment for general guidance on
setting up a good development workflow with WSL.
There are several ways to run your Linux distributions once installed:
path is mounted in wsl. From PowerShell, the command get-date will provide the
date from the Windows file system and wsl date will provide the date from the
Linux file system.
The method you select should depend on what you're doing. If you've opened a WSL
command line within a Windows Prompt or PowerShell window and want to exit, enter
the command: exit .
Additional resources
Windows Command Line Blog: Install WSL with a single command now available in
Windows 10 version 2004 and higher
Manual installation steps for older
versions of WSL
Article • 06/16/2023
For simplicity, we generally recommend using the wsl --install to install Windows
Subsystem for Linux, but if you're running an older build of Windows, that may not be
supported. We have included the manual installation steps below. If you run into an
issue during the install process, check the installation section of the troubleshooting
guide.
Open PowerShell as Administrator (Start menu > PowerShell > right-click > Run as
Administrator) and enter this command:
PowerShell
We recommend now moving on to step #2, updating to WSL 2, but if you wish to only
install WSL 1, you can now restart your machine and move on to Step 6 - Install your
Linux distribution of choice. To update to WSL 2, wait to restart your machine and move
on to the next step.
For x64 systems: Version 1903 or later, with Build 18362.1049 or later.
For ARM64 systems: Version 2004 or later, with Build 19041 or later.
or Windows 11.
7 Note
Builds lower than 18362 do not support WSL 2. Use the Windows Update
Assistant to update your version of Windows. The Windows version 1903
support is also only for x64 systems. If you are using an Arm64 version of Windows,
you will need to upgrade to Windows 10 version 2004 or later for full access to WSL
2. For more info, see WSL 2 support coming to Windows 10 Versions 1903 and
1909 .
To check your version and build number, select Windows logo key + R, type winver,
select OK. Update to the latest Windows version in the Settings menu.
7 Note
If you are running Windows 10 version 1903 or 1909, open "Settings" from your
Windows menu, navigate to "Update & Security" and select "Check for Updates".
Your Build number must be 18362.1049+ or 18363.1049+, with the minor build #
over .1049. Read more: WSL 2 Support is coming to Windows 10 Versions 1903
and 1909 .
PowerShell
Restart your machine to complete the WSL install and update to WSL 2.
7 Note
2. Run the update package downloaded in the previous step. (Double-click to run -
you will be prompted for elevated permissions, select ‘yes’ to approve this
installation.)
Once the installation is complete, move on to the next step - setting WSL 2 as your
default version when installing new Linux distributions. (Skip this step if you want your
new Linux installs to be set to WSL 1).
7 Note
For more information, read the article changes to updating the WSL2 Linux
kernel , available on the Windows Command Line Blog .
PowerShell
wsl --set-default-version 2
You will then need to create a user account and password for your new Linux
distribution.
Troubleshooting installation
If you run into an issue during the install process, check the installation section of the
troubleshooting guide.
Downloading distributions
There are some scenarios in which you may not be able (or want) to, install WSL Linux
distributions using the Microsoft Store. You may be running a Windows Server or Long-
Term Servicing (LTSC) desktop OS SKU that doesn't support Microsoft Store, or your
corporate network policies and/or admins do not permit Microsoft Store usage in your
environment. In these cases, while WSL itself is available, you may need to download
Linux distributions directly.
If the Microsoft Store app is not available, you can download and manually install Linux
distributions using these links:
Ubuntu
Ubuntu 22.04 LTS
Ubuntu 20.04
Ubuntu 20.04 ARM
Ubuntu 18.04
Ubuntu 18.04 ARM
Ubuntu 16.04
Debian GNU/Linux
Kali Linux
SUSE Linux Enterprise Server 12
SUSE Linux Enterprise Server 15 SP2
SUSE Linux Enterprise Server 15 SP3
openSUSE Tumbleweed
openSUSE Leap 15.3
openSUSE Leap 15.2
Oracle Linux 8.5
Oracle Linux 7.9
Fedora Remix for WSL
This will cause the <distro>.appx packages to download to a folder of your choosing.
If you prefer, you can also download your preferred distribution(s) via the command
line, you can use PowerShell with the Invoke-WebRequest cmdlet. For example, to
download Ubuntu 20.04:
PowerShell
Tip
If the download is taking a long time, turn off the progress bar by setting
$ProgressPreference = 'SilentlyContinue'
You also have the option to use the curl command-line utility for downloading. To
download Ubuntu 20.04 with curl:
Console
In this example, curl.exe is executed (not just curl ) to ensure that, in PowerShell, the
real curl executable is invoked, not the PowerShell curl alias for Invoke-WebRequest.
Once the distribution has been downloaded, navigate to the folder containing the
download and run the following command in that directory, where app-name is the
name of the Linux distribution .appx file.
Powershell
Add-AppxPackage .\app_name.appx
Once the Appx package has finished downloading, you can start running the new
distribution by double-clicking the appx file. (The command wsl -l will not show that
the distribution is installed until this step is complete).
If you are using Windows server, or run into problems running the command above you
can find the alternate install instructions on the Windows Server documentation page to
install the .appx file by changing it to a zip file.
Once your distribution is installed, follow the instructions to create a user account and
password for your new Linux distribution.
The Windows Subsystem for Linux (WSL) is available for installation on Windows Server
2019 (version 1709) and later. This guide will walk through the steps of enabling WSL on
your machine.
Bash
wsl --install
You can now install everything you need to run WSL on Windows Server 2022 by
entering this command in an administrator PowerShell or Windows Command Prompt
and then restarting your machine.
This command will enable the required optional components, download the latest Linux
kernel, set WSL 2 as your default, and install a Linux distribution for you (Ubuntu by
default).
See the standard WSL docs for more information on how to:
PowerShell
PowerShell
2. Once the distribution has been downloaded, navigate to the folder containing the
download and run the following command in that directory, where app-name is the
name of the Linux distribution .appx file.
Powershell
Add-AppxPackage .\app_name.appx
U Caution
Installation failed with error 0x8007007e: If you receive this error, then your
system doesn't support WSL. Ensure that you're running Windows build 16215 or
later. Check your build. Also check to confirm that WSL is enabled and your
computer was restarted after the feature was enabled.
3.Add your Linux distribution path to the Windows environment PATH
( C:\Users\Administrator\Ubuntu in this example), using PowerShell:
PowerShell
You can now launch your distribution from any path by typing <DistributionName>.exe .
For example: ubuntu.exe .
Once installation is complete, you can create a user account and password for your new
Linux distribution.
Set up a WSL development environment
Article • 10/04/2022
Get started
Windows Subsystem for Linux comes with the Windows operating system, but you must
enable it and install a Linux distribution before you can begin using it.
To use the simplified --install command, you must be running a recent build of Windows
(Build 20262+). To check your version and build number, select Windows logo key + R,
type winver, select OK. You can update using the Settings menu or Windows Update
Assistant .
If you prefer to install a Linux distribution other than Ubuntu, or would prefer to
complete these steps manually, see the WSL installation page for more details.
PowerShell
wsl --install
You will need to restart your machine during this installation process.
Check the troubleshooting installation article if you run into any issues.
This User Name and Password is specific to each separate Linux distribution that
you install and has no bearing on your Windows user name.
Please note that whilst entering the Password, nothing will appear on screen. This
is called blind typing. You won't see what you are typing, this is completely normal.
Once you create a User Name and Password, the account will be your default user
for the distribution and automatically sign-in on launch.
This account will be considered the Linux administrator, with the ability to run sudo
(Super User Do) administrative commands.
Each Linux distribution running on WSL has its own Linux user accounts and
passwords. You will have to configure a Linux user account every time you add a
distribution, reinstall, or reset.
7 Note
Linux distributions installed with WSL are a per-user installation and can't be shared
with other Windows user accounts. Encountering a username error?
StackExchange: What characters should I use or not use in usernames on
Linux?
To change or reset your password, open the Linux distribution and enter the command:
passwd . You will be asked to enter your current password, then asked to enter your new
password, and then to confirm your new password.
If you need to update the forgotten password on a distribution that is not your
default, use the command: wsl -d Debian -u root , replacing Debian with the
name of your targeted distribution.
2. Once your WSL distribution has been opened at the root level inside PowerShell,
you can use this command to update your password: passwd <username> where
<username> is the username of the account in the distribution whose password
you've forgotten.
3. You will be prompted to enter a new UNIX password and then confirm that
password. Once you're told that the password has updated successfully, close WSL
inside of PowerShell using the command: exit .
Bash
Windows does not automatically update or upgrade your Linux distribution(s). This is a
task that most Linux users prefer to control themselves.
Whenever a new WSL Linux distribution is installed, a new instance will be created for it
inside the Windows Terminal that can be customized to your preferences.
We recommend using WSL with Windows Terminal, especially if you plan to work with
multiple command lines. See the Windows Terminal docs for help with setting it up and
customizing your preferences, including:
Install Windows Terminal or Windows Terminal (Preview) from the Microsoft Store
Use the Command Palette
Set up custom actions like keyboard shortcuts to make the terminal feel natural to
your preferences
Set up the default startup profile
Customize the appearance: theme, color schemes, name and starting directory,
background image, etc.
Learn how to use command line arguments like opening a terminal with multiple
command lines split into window panes or tabs
Learn about the search feature
Find tips and tricks, like how to rename or color a tab, use mouse interactions, or
enable "Quake mode"
Find tutorials on how to set up a customized command prompt, SSH profiles, or
tab titles
Find a custom terminal gallery and a troubleshooting guide
File storage
To open your WSL project in Windows File Explorer, enter: explorer.exe .
Be sure to add the period at the end of the command to open the current directory.
Store your project files on the same operating system as the tools you plan to use.
For the fastest performance speed, store your files in the WSL file system if you are
working on them with Linux tools in a Linux command line (Ubuntu, OpenSUSE,
etc). If you're working in a Windows command line (PowerShell, Command Prompt)
with Windows tools, store your files in the Windows file system. Files can be
accessed across the operating systems, but it may significantly slow down
performance.
Once VS Code is installed and set up, you can open your WSL project with a VS Code
remote server by entering: code .
Be sure to add the period at the end of the command to open the current directory.
Set up a database
Follow this step-by-step guide to Get started with databases on WSL and connect your
project to a database in the WSL environment. Get started with MySQL, PostgreSQL,
MongoDB, Redis, Microsoft SQL Server, or SQLite.
Set up GPU acceleration for faster performance
Follow this step-by-step guide to set up GPU accelerated machine learning training in
WSL and leverage your computer's GPU (graphics processing unit) to accelerate
performance heavy workloads.
In addition, many commands are interoperable between Windows and Linux. Here are a
couple of examples:
Run Linux tools from a Windows command line: Open PowerShell and display the
directory contents of C:\temp> using the Linux ls -la command by entering: wsl
ls -la
Mix Linux and Windows commands: In this example, the Linux command ls -la is
used to list files in the directory, then the PowerShell command findstr is used to
filter the results for words containing "git": wsl ls -la | findstr "git" . This could
also be done mixing the Windows dir command with the Linux grep command:
dir | wsl grep git .
Run a Windows tool directly from the WSL command line: <tool-name>.exe For
example, to open your .bashrc file (the shell script that runs whenever your Linux
command line is started), enter: notepad.exe .bashrc
Run the Windows ipconfig.exe tool with the Linux Grep tool: ipconfig.exe | grep
IPv4 | cut -d: -f2 This example demonstrates the ipconfig tool on the Windows
file system being used to display the current TCP/IP network configuration values
and then being filtered to only the IPv4 result with grep, a Linux tool.
Visual Studio Code, along with the WSL extension, enables you to use WSL as your full-
time development environment directly from VS Code. You can:
Install the Remote Development extension pack . This extension pack includes
the WSL extension, in addition to the Remote - SSH, and Dev Containers
extensions, enabling you to open any folder in a container, on a remote machine,
or in WSL.
) Important
In order to install the WSL extension, you will need the 1.35 May release version
or later of VS Code. We do not recommend using WSL in VS Code without the WSL
extension as you will lose support for auto-complete, debugging, linting, etc. Fun
fact: this WSL extension is installed in $HOME/.vscode/extensions (enter the
command ls $HOME\.vscode\extensions\ in PowerShell).
Bash
To add wget (to retrieve content from web servers) and ca-certificates (to allow SSL-
based applications to check for the authenticity of SSL connections), enter:
Bash
When running the WSL extension, selecting the 'Extensions' tab will display a list of
extensions split between your local machine and your WSL distribution.
Some extensions, like the Python extension or anything that handles things like linting
or debugging, must be installed separately on each WSL distribution. VS Code will
display a warning icon ⚠, along with a green "Install in WSL" button, if you have an
extension locally installed that is not installed on your WSL distribution.
For further information, see the VS Code docs:
When VS Code is started in WSL, no shell startup scripts are run. See this advanced
environment setup script article for more info on how to run additional
commands or modify the environment.
Having problems launching VS Code from your WSL command line? This
troubleshooting guide includes tips on changing path variables, resolving
extension errors about missing dependencies, resolving Git line ending issues,
installing a local VSIX on a remote machine, launching a browser window, blocker
localhost port, web sockets not working, errors storing extension data, and more.
To install Git, see set up Git to work with Windows Subsystem for Linux.
1. Get Windows Terminal in the Microsoft Store : By installing via the store, updates
are handled automatically.
2. Once installed, open Windows Terminal and select Settings to customize your
terminal using the profile.json file.
Additional Resources
VS Code WSL documentation
VS Code WSL tutorial
Remote development tips and tricks
Using Docker with WSL 2 and VS Code
Using C++ and WSL in VS Code
Remote R Service for Linux
Keymaps from other editors : These extensions can help your environment feel
right at home if you're transitioning from another text editor (like Atom, Sublime,
Vim, eMacs, Notepad++, etc).
Settings Sync : Enables you to synchronize your VS Code settings across different
installations using GitHub. If you work on different machines, this helps keep your
environment consistent across them.
Debugger for Chrome : Once you finish developing on the server side with Linux,
you'll need to develop and test the client side. This extension integrates your VS
Code editor with your Chrome browser debugging service, making things a bit
more efficient.
Get started using Git on Windows
Subsystem for Linux
Article • 06/21/2023
Git is the most commonly used version control system. With Git, you can track changes
you make to files, so you have a record of what has been done, and have the ability to
revert to earlier versions of the files if needed. Git also makes collaboration easier,
allowing changes by multiple people to all be merged into one source.
Debian \\wsl$\Debian\home\username
Tip
If you are seeking to access the Windows file directory from your WSL distribution
command line, instead of C:\Users\username , the directory would be accessed
using /mnt/c/Users/username , because the Linux distribution views your Windows
file system as a mounted drive.
You will need to install Git on each file system that you intend to use it with.
Installing Git
Git comes already installed with most of the Windows Subsystem for Linux distributions,
however, you may want to update to the latest version. You also will need to set up your
git config file.
To install Git, see the Git Download for Linux site. Each Linux distribution has their own
package manager and install command.
For the latest stable Git version in Ubuntu/Debian, enter the command:
Bash
7 Note
You also may want to install Git for Windows if you haven't already.
Bash
Set your email with this command (replacing "[email protected]" with the email
you prefer):
Bash
git config --global user.email "[email protected]"
Tip
If you don't yet have a GitHub account, you can sign-up for one on GitHub . If
you've never worked with Git before, GitHub Guides can help you get started. If
you need to edit your Git config, you can do so with a built-in text editor like nano:
nano ~/.gitconfig .
We recommend that you secure your account with two-factor authentication (2FA) .
GCM integrates into the authentication flow for services like GitHub and, once you're
authenticated to your hosting provider, requests a new authentication token. It then
stores the token securely in the Windows Credential Manager . After the first time, you
can use Git to talk to your hosting provider without needing to re-authenticate. It will
just access the token in the Windows Credential Manager.
In order to use GCM with WSL you must be on Windows 10 Version 1903 or later. This is
the first version of Windows that includes the required wsl.exe tool that GCM uses to
interoperate with Git in your WSL distributions.
It is recommended to install the latest Git for Windows in order to share credentials &
settings between WSL and the Windows host. Git Credential Manager is included with
Git for Windows and the latest version is included in each new Git for Windows release.
During the installation, you will be asked to select a credential helper, with GCM set as
the default.
If you have a reason not to install Git for Windows, you can install GCM as a Linux
application directly in your WSL distribution, but note that doing so means GCM is
running as a Linux application and cannot utilize the authentication or credential
storage features of the host Windows operating system. See the GCM repo for
instructions on how to configure WSL without Git for Windows .
To set up GCM for use with a WSL distribution, open your distribution and enter this
command:
If GIT installed is >= v2.39.0
Bash
Bash
Bash
7 Note
Using GCM as a credential helper for a WSL Git installation means that any
configuration set in WSL Git is NOT respected by GCM (by default). This is because
GCM is running as a Windows application, and therefore will use the Git for
Windows installation to query configuration. This means things like proxy settings
for GCM need to be set in Git for Windows as well as WSL Git as they are stored in
different files ( %USERPROFILE%\.gitconfig vs \\wsl$\distro\home\$USER\.gitconfig ).
You can configure WSL so that GCM will use the WSL Git configuration, but this
means that proxy settings will be unique to the specific WSL installation and not
shared with others or the Windows host.
Bash
Now any git operation you perform within your WSL distribution will use GCM. If you
already have credentials cached for a host, it will access them from the credential
manager. If not, you'll receive a dialog response requesting your credentials, even if
you're in a Linux console.
Tip
If you are using a GPG key for code signing security, you may need to associate
your GPG key with your GitHub email .
If you choose to create a new repo using the GitHub website , there are check boxes
available to initialize your repo with a README file, .gitignore file set up for your specific
project type, and options to add a license if you need one.
Additional resources
WSL & VS Code
GitHub Learning Lab: Online courses
Git Visualization Tool
Git Tools - Credential Storage
Get started with databases on Windows
Subsystem for Linux
Article • 09/19/2023
This step-by-step guide will help you get started connecting your project in WSL to a
database. Get started with MySQL, PostgreSQL, MongoDB, Redis, Microsoft SQL Server,
or SQLite.
Prerequisites
Running Windows 11 or Windows 10, updated to version 2004, Build 19041 or
later.
Install a Linux distribution using WSL and create a Linux user name and password.
MySQL (SQL)
PostgreSQL (SQL)
Microsoft SQL Server (SQL)
SQLite (SQL)
MongoDB (NoSQL)
Redis (NoSQL)
MySQL is an open-source SQL relational database, organizing data into one or more
tables in which data types may be related to each other. It is vertically scalable, which
means one ultimate machine will do the work for you. It is currently the most widely
used of the four database systems.
Microsoft SQL Server includes SQL Server on Windows, SQL Server on Linux, and SQL
on Azure. These are also relational database management systems set up on servers
with primary function of storing and retrieving data as requested by software
applications.
SQLite is an open-source self-contained, file-based, “serverless” database, known for its
portability, reliability, and good performance even in low-memory environments.
Install MySQL
To install MySQL on a Linux distribution running on WSL, just follow the Installing
MySQL on Linux instructions in the MySQL docs. You may need to first enable
systemd support in your wsl.conf configuration file.
1. Open your Ubuntu command line and update the packages available: sudo apt
update
2. Once the packages have updated, install MySQL with: sudo apt install mysql-
server
For more about working with MySQL databases, see the MySQL docs .
To work with with MySQL databases in VS Code, try the MySQL extension .
You may also want to run the included security script. This changes some of the less
secure default options for things like remote root logins and sample users. This script
also includes steps to change password for MySQL root user. To run the security script:
Install PostgreSQL
To install PostgreSQL on WSL (ie. Ubuntu):
sudo service postgresql status for checking the status of your database.
The default admin user, postgres , needs a password assigned in order to connect to a
database. To set a password:
Once you have successfully entered the psql shell, you will see your command line
change to look like this: postgres=#
7 Note
Alternatively, you can open the psql shell by switching to the postgres user with: su
- postgres and then entering the command: psql .
To see what user accounts have been created on your PostgreSQL installation, use from
your WSL terminal: psql -c "\du" ...or just \du if you have the psql shell open. This
command will display columns: Account User Name, List of Roles Attributes, and
Member of role group(s). To exit back to the command line, enter: q .
For more about working with PostgreSQL databases, see the PostgreSQL docs .
To work with with PostgreSQL databases in VS Code, try the PostgreSQL extension .
Install MongoDB
To install MongoDB, see the Mongodb docs: Install MongoDB Community Edition on
Linux
Installing MongoDB may require slightly different steps depending on the Linux
distribution being used for installation. Also note that MongoDB installation may differ
depending on the version # that you are aiming to install. Use the version drop-down
list in the top-left corner of the MongoDB documentation to select the version that
aligns with your goal. Lastly, you may need to enable systemd support in the wsl.conf
configuration file of the Linux distribution that you are using with WSL. The systemctl
command is a part of the systemd init system and may not work if your distribution is
using systemv.
VS Code supports working with MongoDB databases via the Azure CosmosDB
extension , you can create, manage and query MongoDB databases from within VS
Code. To learn more, visit the VS Code docs: Working with MongoDB .
Install SQLite
To install SQLite on WSL (ie. Ubuntu):
Database will be empty after creation. You can create a new table for your database with
CREATE TABLE empty (kol INTEGER); .
Now entering the .dbinfo ?DB? will show the database you have created.
For more information about working with a SQLite database, see the SQLite docs .
Install Redis
To install Redis on WSL (ie. Ubuntu):
Check to see if redis is working (redis-cli is the command line interface utility to talk with
Redis): redis-cli ping this should return a reply of "PONG".
To stop running your Redis server: sudo service redis-server stop
For more information about working with a Redis database, see the Redis docs .
Typing out sudo service mongodb start or sudo service postgres start and sudo -u
postgrest psql can get tedious. However, you could consider setting up aliases in your
.profile file on WSL to make these commands quicker to use and easier to remember.
To set up your own custom alias, or shortcut, for executing these commands:
1. Open your WSL terminal and enter cd ~ to be sure you're in the root directory.
2. Open the .profile file, which controls the settings for your terminal, with the
terminal text editor, Nano: sudo nano .profile
3. At the bottom of the file (don't change the # set PATH settings), add the following:
Bash
# My Aliases
alias start-pg='sudo service postgresql start'
alias run-pg='sudo -u postgres psql'
This will allow you to enter start-pg to start running the postgresql service and
run-pg to open the psql shell. You can change start-pg and run-pg to whatever
names you want, just be careful not to overwrite a command that postgres already
uses!
4. Once you've added your new aliases, exit the Nano text editor using Ctrl+X --
select Y (Yes) when prompted to save and Enter (leaving the file name as
.profile ).
5. Close and re-open your WSL terminal, then try your new alias commands.
Troubleshooting
Error: directory-sync fdatasync Invalid argument
Ensure that you are running your Linux distribution in WSL 2 mode. For help switching
from WSL 1 to WSL 2, see Set your distribution version to WSL 1 or WSL 2.
Additional resources
Setting up your development environment on Windows
Get started with Docker remote
containers on WSL 2
Article • 03/20/2023
This step-by-step guide will help you get started developing with remote containers by
setting up Docker Desktop for Windows with WSL 2 (Windows Subsystem for Linux,
version 2).
7 Note
We recommend using Docker Desktop due to its integration with Windows and
Windows Subsystem for Linux . However, while Docker Desktop supports
running both Linux and Windows containers, you can not run both simultaneously.
To run Linux and Windows containers simultaneously, you would need to install and
run a separate Docker instance in WSL. If you need to run simultaneous containers
or just prefer to install a container engine directly in your Linux distribution, follow
the Linux installation instructions for that container service, such as Install Docker
Engine on Ubuntu or Install Podman for running Linux containers .
Docker containers are similar to virtual machines, but don't create an entire virtual
operating system. Instead, Docker enables the app to use the same Linux kernel as the
system that it's running on. This allows the app package to only require parts not
already on the host computer, reducing the package size and improving performance.
Continuous availability, using Docker containers with tools like Kubernetes, is another
reason for the popularity of containers. This enables multiple versions of your app
container to be created at different times. Rather than needing to take down an entire
system for updates or maintenance, each container (and its specific microservices) can
be replaced on the fly. You can prepare a new container with all of your updates, set up
the container for production, and just point to the new container once it's ready. You
can also archive different versions of your app using containers and keep them running
as a safety fallback if needed.
Prerequisites
Ensure your machine is running Windows 10, updated to version 2004, Build 18362
or later.
Install WSL and set up a user name and password for your Linux distribution
running in WSL 2.
Install Visual Studio Code (optional). This will provide the best experience,
including the ability to code and debug inside a remote Docker container and
connected to your Linux distribution.
Install Windows Terminal (optional). This will provide the best experience, including
the ability to customize and open multiple terminals in the same interface
(including Ubuntu, Debian, PowerShell, Azure CLI, or whatever you prefer to use).
Sign up for a Docker ID at Docker Hub (optional).
See the Docker Desktop license agreement for updates on the terms of use.
7 Note
WSL can run distributions in both WSL version 1 or WSL 2 mode. You can check this
by opening PowerShell and entering: wsl -l -v . Ensure that the your distribution is
set to use WSL 2 by entering: wsl --set-version <distro> 2 . Replace <distro>
with the distro name (e.g. Ubuntu 18.04).
In WSL version 1, due to fundamental differences between Windows and Linux, the
Docker Engine couldn't run directly inside WSL, so the Docker team developed an
alternative solution using Hyper-V VMs and LinuxKit. However, since WSL 2 now
runs on a Linux kernel with full system call capacity, Docker can fully run in WSL 2.
This means that Linux containers can run natively without emulation, resulting in
better performance and interoperability between your Windows and Linux tools.
Install Docker Desktop
With the WSL 2 backend supported in Docker Desktop for Windows, you can work in a
Linux-based development environment and build Linux-based containers, while using
Visual Studio Code for code editing and debugging, and running your container in the
Microsoft Edge browser on Windows.
2. Once installed, start Docker Desktop from the Windows Start menu, then select the
Docker icon from the hidden icons menu of your taskbar. Right-click the icon to
display the Docker commands menu and select "Settings".
3. Ensure that "Use the WSL 2 based engine" is checked in Settings > General.
4. Select from your installed WSL 2 distributions which you want to enable Docker
integration on by going to: Settings > Resources > WSL Integration.
5. To confirm that Docker has been installed, open a WSL distribution (e.g. Ubuntu)
and display the version and build number by entering: docker --version
6. Test that your installation works correctly by running a simple built-in Docker
image using: docker run hello-world
Tip
Here are a few helpful Docker commands to know:
displayed)
List system-wide information regarding the Docker installation, including
statistics and resources (CPU & memory) available to you in the WSL 2
context, with: docker info
Install the VS Code WSL extension . This extension enables you to open your
Linux project running on WSL in VS Code (no need to worry about pathing issues,
binary compatibility, or other cross-OS challenges).
Install the VS Code Dev Containers extension . This extension enables you to
open your project folder or repo inside of a container, taking advantage of Visual
Studio Code's full feature set to do your development work within the container.
Install the VS Code Docker extension . This extension adds the functionality to
build, manage, and deploy containerized applications from inside VS Code. (You
need the Dev Containers extension to actually use the container as your dev
environment.)
Let's use Docker to create a development container for an existing app project.
1. For this example, I'll use the source code from my Hello World tutorial for Django
in the Python development environment set up docs. You can skip this step if you
prefer to use your own project source code. To download my HelloWorld-Django
web app from GitHub, open a WSL terminal (Ubuntu for example) and enter: git
clone https://github.com/mattwojo/helloworld-django.git
7 Note
Always store your code in the same file system that you're using tools in. This
will result in faster file access performance. In this example, we are using a
Linux distro (Ubuntu) and want to store our project files on the WSL file
system \\wsl\ . Storing project files on the Windows file system would
significantly slow things down when using Linux tools in WSL to access those
files.
2. From your WSL terminal, change directories to the source code folder for this
project:
Bash
cd helloworld-django
3. Open the project in VS Code running on the local WSL extension server by
entering:
Bash
code .
Confirm that you are connected to your WSL Linux distro by checking the green
remote indicator in the bottom-left corner of your VS Code instance.
4. From the VS Code command pallette (Ctrl + Shift + P), enter: Dev Containers:
Open Folder in Container... If this command doesn't display as you begin to type
it, check to ensure that you've installed the Dev Containers extension linked above.
5. Select the project folder that you wish to containerize. In my case, this is
\\wsl\Ubuntu-20.04\home\mattwojo\repos\helloworld-django\
6. A list of container definitions will appear, since there is no dev container
configuration in the project folder (repo) yet. The list of container configuration
definitions that appears is filtered based on your project type. For my Django
project, I'll select Python 3.
7. A new instance of VS Code will open, begin building our new image, and once the
build completed, will start our container. You will see that a new .devcontainer
folder has appeared with container configuration information inside a Dockerfile
and devcontainer.json file.
8. To confirm that your project is still connected to both WSL and within a container,
open the VS Code integrated terminal (Ctrl + Shift + ~). Check the operating
system by entering: uname and the Python version with: python3 --version . You
can see that the uname came back as "Linux", so you are still connected to the
WSL 2 engine, and Python version number will be based on the container config
that may differ from the Python version installed on your WSL distribution.
9. To run and debug your app inside of the container using Visual Studio Code, first
open the Run menu (Ctrl+Shift+D or select the tab on the far left menu bar). Then
select Run and Debug to select a debug configuration and choose the
configuration that best suites your project (in my example, this will be "Django").
This will create a launch.json file in the .vscode folder of your project with
instructions on how to run your app.
10. From inside VS Code, select Run > Start debugging (or just press the F5 key). This
will open a terminal inside VS Code and you should see a result saying something
like: "Starting development server at http://127.0.0.1:8000/ Quit the server with
CONTROL-C." Hold down the Control key and select the address displayed to open
your app in your default web browser and see your project running inside of its
container.
You have now successfully configured a remote development container using Docker
Desktop, powered by the WSL 2 backend, that you can code in, build, run, deploy, or
debug using VS Code!
Troubleshooting
For more on this issue, see How to set up Docker within Windows System for Linux
(WSL2) on Windows 10 .
\wsl$\docker-desktop
\wsl$\docker-desktop-data
You can find these folders by opening your WSL Linux distribution and entering:
explorer.exe . to view the folder in Windows File Explorer. Enter: \\wsl\<distro
name>\mnt\wsl replacing <distro name> with the name of your distribution (ie. Ubuntu-
Find more on locating docker storage locations in WSL, see this issue from the WSL
repo or this StackOverflow post .
For more help with general troubleshooting issues in WSL, see the Troubleshooting doc.
Additional resources
Docker docs: Best practices for Docker Desktop with WSL 2
Feedback for Docker Desktop for Windows: File an issue
VS Code Blog: Guidelines for choosing a development environment
VS Code Blog: Using Docker in WSL 2
VS Code Blog: Using Remote Containers in WSL 2
Hanselminutes Podcast: Making Docker lovely for Developers with Simon Ferquel
Walkthrough: Build and debug C++
with WSL 2 and Visual Studio 2022
Article • 10/24/2022
Visual Studio 2022 introduces a native C++ toolset for Windows Subsystem for Linux
version 2 (WSL 2) development. This toolset is available now in Visual Studio 2022
version 17.0 or higher.
WSL 2 is the new, recommended version of the Windows Subsystem for Linux (WSL). It
provides better Linux file system performance, GUI support, and full system call
compatibility. Visual Studio's WSL 2 toolset allows you to use Visual Studio to build and
debug C++ code on WSL 2 distros without adding a SSH connection. You can already
build and debug C++ code on WSL 1 distros using the native WSL 1 toolset
introduced in Visual Studio 2019 version 16.1.
Visual Studio's WSL 2 toolset supports both CMake and MSBuild-based Linux projects.
CMake is our recommendation for all C++ cross-platform development with Visual
Studio. We recommend CMake because it build and debug the same project on
Windows, WSL, and remote systems.
For a video presentation of the information in this topic, see Video: Debug C++ with
WSL 2 Distributions and Visual Studio 2022.
local rsync copy doesn't require any user intervention. It occurs automatically when
Visual Studio detects you're using a WSL 2 distro. To learn more about the differences
between WSL 1 and WSL 2, see Comparing WSL 1 and WSL 2.
The WSL 2 toolset is supported by CMake Presets integration in Visual Studio. To learn
more, see CMake Presets integration in Visual Studio and Visual Studio Code and
Configure and build with CMake Presets in Visual Studio. There's also more advanced
information in this article under Advanced WSL 2 and CMake projects considerations.
1. Install WSL and a WSL 2 distro by following the instructions at Install WSL.
2. Assuming your distro uses apt (this walkthrough uses Ubuntu), use the following
commands to install the required build tools on your WSL 2 distro:
Bash
A C++ compiler
gdb
CMake
rsync
zip
Visual Studio defines a CMake project as a folder with a CMakeLists.txt file at the
project root. In this walkthrough, you'll create a new CMake project by using the Visual
Studio CMake Project template:
3. From the Visual Studio Get started screen, select Create a new project.
4. In the Search for templates textbox, type "cmake". Choose the CMake Project type
and select Next. Give the project a name and location, and then select Create.
5. Enable Visual Studio's CMake Presets integration. Select Tools > Options > CMake
> General. Select Prefer using CMake Presets for configure, build, and test, then
select OK. Instead, you could have added a CMakePresets.json file to the root of
the project. For more information, see Enable CMake Presets integration.
6. To activate the integration: from the main menu, select File > Close Folder. The
Get started page appears. Under Open recent, select the folder you just closed to
reopen the folder.
7. There are three dropdowns across the Visual Studio main menu bar. Use the
dropdown on the left to select your active target system. This is the system where
CMake will be invoked to configure and build the project. Visual Studio queries for
WSL installations with wsl -l -v . In the following image, WSL2: Ubuntu-20.04 is
shown selected as the Target System.
7 Note
8. Use the dropdown in the middle to select your active Configure Preset. Configure
Presets tell Visual Studio how to invoke CMake and generate the underlying build
system. In step 7, the active Configure Preset is the linux-default Preset created by
Visual Studio. To create a custom Configure Preset, select Manage
Configurations… For more information about Configure Presets, see Select a
Configure Preset and Edit Presets.
9. Use the dropdown on the right to select your active Build Preset. Build Presets tell
Visual Studio how to invoke build. In the illustration for step 7, the active Build
Preset is the Default Build Preset created by Visual Studio. For more information
about Build Presets, see Select a Build Preset.
10. Configure the project on WSL 2. If project generation doesn't start automatically,
then manually invoke configure with Project > Configure project-name
11. If you don't have a supported version of CMake installed on your WSL 2 distro,
then Visual Studio will prompt you beneath the main menu ribbon to deploy a
recent version of CMake. Select Yes to deploy CMake binaries to your WSL 2 distro.
12. Confirm that the configure step has completed and that you can see the CMake
generation finished message in the Output window under the CMake pane. Build
files are written to a directory in the WSL 2 distro's file system.
13. Select the active debug target. The debug dropdown menu lists all the CMake
targets available to the project.
14. Expand the project subfolder in the Solution Explorer. In the CMakeProject.cpp file,
set a breakpoint in main() . You can also navigate to CMake targets view by
selecting the View Picker button in the Solution Explorer, highlighted in following
screenshot:
15. Select Debug > Start, or press F5. Your project will build, the executable will launch
on your WSL 2 distro, and Visual Studio will stop execution at the breakpoint. You
can see the output of your program (in this case, "Hello CMake." ) in the Linux
Console Window:
You've now built and debugged a C++ app with WSL 2 and Visual Studio 2022.
If forceWSL1Tooslet is set to true, then Visual Studio won't maintain a copy of your
source files in the WSL file system. Instead, it will access source files in the mounted
Windows drive ( /mnt/ …).
In most cases, it's best to use the WSL 2 toolset with WSL 2 distributions because WSL 2
is slower when project files are instead stored in the Windows file system. To learn more
about file system performance in WSL 2, see Comparing WSL 1 and WSL 2.
Specify advanced settings such as the path to the directory on WSL 2 where the project
will be copied, copy source options, and rsync command arguments, in the Visual Studio
Remote Settings vendor map in CMakePresets.json . For more information, see Visual
Studio Remote Settings vendor map.
System headers are still automatically copied to the Windows file system to supply the
native IntelliSense experience. You can customize the headers that are included or
excluded from this copy in the Visual Studio Remote Settings vendor map in
CMakePresets.json .
You can change the IntelliSense mode, or specify other IntelliSense options, in the Visual
Studio Settings vendor map in CMakePresets.json . For details about the vendor map,
see Visual Studio Remote Settings vendor map.
If you have a MSBuild-based Linux project, then you can upgrade to the WSL 2 toolset
in Visual Studio. Right-click the project in the solution explorer, then choose Properties
> General > Platform Toolset:
If you're targeting a WSL 2 distribution and you don't want to use the WSL 2 toolset,
then in the Platform Toolset dropdown, select the GCC for Windows Subsystem for
Linux or Clang for Windows Subsystem for Linux toolset. If either of these toolsets are
selected, Visual Studio won't maintain a copy of your source files in the WSL file system
and will instead access source files over the mounted Windows drive ( /mnt/ …). System
headers are still automatically copied to the Windows file system to provide a native
IntelliSense experience. Customize the headers that are included or excluded from this
copy in Property Pages > General.
In most cases, it's best to use the WSL 2 toolset with WSL 2 distributions because WSL 2
is slower when project files are stored in the Windows file system. To to learn more, see
Comparing WSL 1 and WSL 2.
See also
Video: Debug C++ with WSL 2 Distributions and Visual Studio 2022
Download Visual Studio 2022
Create a CMake Linux project in Visual Studio
Tutorial: Debug a CMake project on a remote Windows machine
Get started with GPU acceleration for
ML in WSL
Article • 03/20/2023
There are lots of different ways to set up these tools. For example, NVIDIA CUDA in
WSL , TensorFlow-DirectML and PyTorch-DirectML all offer different ways you can
use your GPU for ML with WSL. To learn more about the reasons for choosing one
versus another, see GPU accelerated ML training.
NVIDIA CUDA if you have an NVIDIA graphics card and run a sample ML
framework container
TensorFlow-DirectML and PyTorch-DirectML on your AMD, Intel, or NVIDIA
graphics card
Prerequisites
Ensure you are running Windows 11 or Windows 10, version 21H2 or higher.
Install WSL and set up a username and password for your Linux distribution.
2. Install Docker Desktop or install the Docker engine directly in WSL by running the
following command
Bash
curl https://get.docker.com | sh
Bash
Set up the stable repository for the NVIDIA Container Toolkit by running the
following commands:
Bash
Bash
Bash
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-
docker.list | sed 's#deb https://#deb [signed-
by=/usr/share/keyrings/nvidia-docker-keyring.gpg] https://#g' | sudo
tee /etc/apt/sources.list.d/nvidia-docker.list
Install the NVIDIA runtime packages and dependencies by running the commands:
Bash
Bash
To run a machine learning framework container and start using your GPU with this
NVIDIA NGC TensorFlow container, enter the command:
Bash
Bash
cd nvidia-examples/cnn/
Bash
We recommend setting up a virtual Python environment. There are many tools you
can use to setup a virtual Python environment — for these instructions, we'll use
Anaconda's Miniconda .
Bash
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-
x86_64.sh
Bash
bash Miniconda3-latest-Linux-x86_64.sh
Bash
Bash
TensorFlow-DirectML:
Bash
PyTorch-DirectML:
Bash
Bash
If you have questions or run into issues, visit the DirectML repo on GitHub .
Multiple GPUs
If you have multiple GPUs on your machine you can also access them inside of WSL.
However, you will only be able to access one at a time. To choose a specific GPU please
set the environment variable below to the name of your GPU as it appears in device
manager:
Bash
export MESA_D3D12_DEFAULT_ADAPTER_NAME="<NameFromDeviceManager>"
This will do a string match, so if you set it to "NVIDIA" it will match the first GPU that
starts with "NVIDIA".
Additional Resources
Guidance for setting up NVIDIA CUDA in WSL
Guidance for setting up TensorFlow with DirectML in WSL
TensorFlow with DirectML Samples
Guidance for setting up PyTorch with DirectML in WSL
PyTorch with DirectML Samples
Run Linux GUI apps on the Windows
Subsystem for Linux
Article • 07/18/2023
Windows Subsystem for Linux (WSL) now supports running Linux GUI applications (X11
and Wayland) on Windows in a fully integrated desktop experience.
WSL 2 enables Linux GUI applications to feel native and natural to use on Windows.
You can now integrate both Windows and Linux applications into your workflow for a
seamless desktop experience.
Prerequisites
You will need to be on Windows 10 Build 19044+ or Windows 11 to access this
feature.
PowerShell
wsl --install
Once your machine has finished rebooting, installation will continue and you will be
asked to enter a username and password. This will be your Linux credential for the
Ubuntu distribution.
1. Select Start, type PowerShell, right-click Windows PowerShell, and then select Run
as administrator.
PowerShell
wsl --update
3. You will need to restart WSL for the update to take effect. You can restart WSL by
running the shutdown command in PowerShell.
PowerShell
wsl --shutdown
7 Note
Linux GUI apps are only supported with WSL 2 and will not work with a Linux
distribution configured for WSL 1. Read about how to change your distribution
from WSL 1 to WSL 2.
7 Note
Support for GUI apps on WSL does not provide a full desktop experience. It relies
on Windows desktop, so installing desktop-focused tools or apps may not be
supported. To request additional support, you can file an issue in the WSLg repo on
GitHub .
Bash
7 Note
Install GIMP
GIMP is a free and open-source raster graphics editor used for image manipulation and
image editing, free-form drawing, transcoding between different image file formats, and
more specialized tasks.
Bash
Install Nautilus
Nautilus, also known as GNOME Files, is the file manager for the GNOME desktop.
(Similar to Windows File Explorer).
Bash
Install VLC
VLC is a free and open source cross-platform multimedia player and framework that
plays most multimedia files.
Bash
Bash
To launch, enter the name of the tool you would like to use. For example:
Troubleshooting
If you have any problem starting GUI applications please check this guide first:
Diagnosing "cannot open display" type issues with WSLg
Install Node.js on Windows Subsystem
for Linux (WSL2)
Article • 09/12/2022
If you are using Node.js professionally, find performance speed and system call
compatibility important, want to run Docker containers that leverage Linux workspaces
and avoid having to maintain both Linux and Windows build scripts, or just prefer using
a Bash command line, then you want to install Node.js on the Windows Subsystem for
Linux (more specifically, WSL 2).
Using Windows Subsystem for Linux (WSL), enables you to install your preferred Linux
distribution (Ubuntu is our default) so that you can have consistency between your
development environment (where you write code) and production environment (the
server where your code is deployed).
7 Note
If you are new to developing with Node.js and want to get up and running quickly
so that you can learn, install Node.js on Windows. This recommendation also
applies if you plan to use a Windows Server production environment.
Install WSL 2
WSL 2 is the most recent version available for Windows and we recommend it for
professional Node.js development workflows. To enable and install WSL 2, follow the
steps in the WSL install documentation. These steps will include choosing a Linux
distribution (for example, Ubuntu).
Once you have installed WSL 2 and a Linux distribution, open the Linux distribution (it
can be found in your Windows start menu) and check the version and codename using
the command: lsb_release -dc .
Install Windows Terminal using the Microsoft Store : By installing via the store, updates
are handled automatically.
) Important
2. Install cURL (a tool used for downloading content from the internet in the
command-line) with: sudo apt-get install curl
7 Note
Installing a newer version of NVM using cURL will replace the older one,
leaving the version of Node you've used NVM to install intact. For more
information, see the GitHub project page for the latest release information
on NVM .
4. To verify installation, enter: command -v nvm ...this should return 'nvm', if you receive
'command not found' or no response at all, close your current terminal, reopen it,
and try again. Learn more in the nvm github repo .
5. List which versions of Node are currently installed (should be none at this point):
nvm ls
6. Install both the current and stable LTS versions of Node.js. In a later step, you'll
learn how to switch between active versions of Node.js with an nvm command.
Install the current stable LTS release of Node.js (recommended for production
applications): nvm install --lts
Install the current release of Node.js (for testing latest Node.js features and
improvements, but more likely to have issues): nvm install node
7. List what versions of Node are installed: nvm ls ...now you should see the two
versions that you just installed listed.
8. Verify that Node.js is installed and the currently default version with: node --
version . Then verify that you have npm as well, with: npm --version (You can also
use which node or which npm to see the path used for the default versions).
9. To change the version of Node.js you would like to use for a project, create a new
project directory mkdir NodeTest , and enter the directory cd NodeTest , then enter
nvm use node to switch to the Current version, or nvm use --lts to switch to the
LTS version. You can also use the specific number for any additional versions you've
installed, like nvm use v8.2.1 . (To list all of the versions of Node.js available, use
the command: nvm ls-remote ).
If you are using NVM to install Node.js and NPM, you should not need to use the SUDO
command to install new packages.
7 Note
This “remote” scenario is a bit different than you may be accustomed to. WSL
supports an actual Linux distribution where your project code is running, separately
from your Windows operating system, but still on your local machine. The Remote-
WSL extension connects with your Linux subsystem as if it were a remote server,
though it’s not running in the cloud… it’s still running on your local machine in the
WSL environment that you enabled to run alongside Windows.
Other code editors, like IntelliJ, Sublime Text, Brackets, etc. will also work with a WSL 2
Node.js development environment, but may not have the same sort of remote features
that VS Code offers. These code editors may run into trouble accessing the WSL shared
network location (\wsl$\Ubuntu\home) and will try to build your Linux files using
Windows tools, which likely not what you want. The Remote-WSL Extension in VS Code
handles this compatibility for you, with other IDEs you may need to set up an X server.
Support for running GUI apps in WSL (like a code editor IDE) is coming soon.
Terminal-based text editors (vim, emacs, nano) are also helpful for making quick
changes from right inside your console. The article, Emacs, Nano, or Vim: Choose your
Terminal-Based Text Editor Wisely does a nice job explaining some differences and a
bit about how to use each.
2. Install the Remote - WSL Extension on VS Code. This allows you to use WSL as
your integrated development environment and will handle compatibility and
pathing for you. Learn more .
) Important
If you already have VS Code installed, you need to ensure that you have the 1.35
May release or later in order to install the Remote - WSL Extension . We do not
recommend using WSL in VS Code without the Remote-WSL extension as you will
lose support for auto-complete, debugging, linting, etc. Fun fact: This WSL
extension is installed in $HOME/.vscode-server/extensions.
The Extensions window is now divided into three sections (because you installed
the Remote-WSL extension).
"Local - Installed": The extensions installed for use with your Windows
operating system.
"WSL:Ubuntu-18.04-Installed": The extensions installed for use with your
Ubuntu operating system (WSL).
"Recommended": Extensions recommended by VS Code based on the file
types in your current project.
2. In the search box at the top of the Extensions window, enter: Node Extension Pack
(or the name of whatever extension you are looking for). The extension will be
installed for either your Local or WSL instances of VS Code depending on where
you have the current project opened. You can tell by selecting the remote link in
the bottom-left corner of your VS Code window (in green). It will either give you
the option to open or close a remote connection. Install your Node.js extensions in
the "WSL:Ubuntu-18.04" environment.
JavaScript Debugger : Once you finish developing on the server side with
Node.js, you'll need to develop and test the client side. This extension is a DAP-
based JavaScript debugger. It debugs Node.js, Chrome, Edge, WebView2, VS Code
extensions, and more.
Keymaps from other editors : These extensions can help your environment feel
right at home if you're transitioning from another text editor (like Atom, Sublime,
Vim, eMacs, Notepad++, etc).
Settings Sync : Enables you to synchronize your VS Code settings across different
installations using GitHub. If you work on different machines, this helps keep your
environment consistent across them.
This tutorial will help those new to Linux to get started installing and updating packages
using the Ubuntu distribution of Linux that is installed by default using WSL, as well as
using some basic commands with the Bash command line.
In Ubuntu, for example, first update the list of software available by running ‘sudo apt
update’. Then, you can directly get software by using the ‘sudo apt-get install’ command
followed by the name of the program you wish to install:
Bash
To update programs that have already been installed, you can run:
Bash
Tip
Different distributions of Linux often have different package managers and will
require using an install command specific to the associated package manager. For
example, the main package manager for Arch Linux is called pacman and the
install command would be sudo pacman -S <app_name> . The main package manager
for OpenSuse is called Zypper and the install command would be sudo zypper
install <app_name> . The main package manager for Alpine is called apk and the
install command would be sudo apk add <app_name> . The two main package
managers for Red Hat distributions, like CentOS, are YUM and RPM and an install
command could be sudo yum install <app_name> or sudo rpo -i <app_name> . Refer
to the documentation of the distribution you are working with to find out what
tools are available for you to install and update software.
Bash
pwd
To create a new directory, use the ‘mkdir’ command followed by the name of the
directory you want to create:
Bash
mkdir hello_world
To change directories, use the ‘cd’ command followed by the name of the directory you
want to navigate to:
Bash
cd hello_world
To see the contents within the directory you are currently in, type ‘ls’ into the command
line:
Bash
ls
By default, the ‘ls’ command will print the name of all the files and directories only. To
get additional information such as the last time a file was modified or file permissions,
use the flag “-l”:
Bash
ls -l
You can create a new file via the ‘touch’ command followed by the name of the file you
would like to create:
Bash
touch hello_world.txt
You can edit files using any downloaded graphical text-editor or the VS Code Remote –
WSL extension. You can learn more about getting started with VS Code here
If you prefer to edit a file directly from the command-line, you’ll need to use a
command-line editor such as vim, emacs, or nano. Many distributions come with one or
more of these programs installed, but you can always install these programs by
following the installation instructions outlined in the guide from above .
To edit your file with your preferred method of editing, simply run the program name
followed by the name of the file you’d like to edit:
Bash
code hello_world.txt
Bash
notepad.exe hello_world.txt
To see the contents of a file in the command line, use the ‘cat’ command followed by
the file you’d like to read:
Bash
cat hello_world.txt
Imagine you want to quickly sort the contents of a file. Take the fruits.txt example below:
Bash
cat fruits.txt
Orange
Banana
Apple
Pear
Plum
Kiwi
Strawberry
Peach
Apple
Banana
Kiwi
Orange
Peach
Pear
Plum
Strawberry
By default, the output of the ‘cat’ command is sent to standard output; however, the ‘|’
allows us to instead redirect the output as the input to another command, ‘sort’.
Another use case is searching. You can use ‘grep’ which is a helpful command that
searches input for a particular search string.
Bash
Pear
Plum
Peach
You can also use redirect operators like ‘>’ to pass the output to a file or stream. For
example, if you wanted to create a new .txt file with the sorted contents of fruit.txt:
Bash
Bash
$ cat sorted_fruit.txt
Apple
Banana
Kiwi
Orange
Peach
Pear
Plum
Strawberry
By default, the output of the sort command is sent to standard output; however, the ‘>’
operator allows us to instead redirect the output into a new file named sorted_fruits.txt.
You can use pipes and redirect operators in many interesting ways to more efficiently
complete tasks directly from the command line.
Recommended content
Microsoft Learn: Introduction to Bash
There are a number of considerations to keep in mind when working between Windows
and Linux file systems. We have outlined a few of them for you in this guide, including
some examples of interoperability support for mixing Windows and Linux-based
commands.
When you see /mnt/ in the file path of a WSL command line, it means that you are
working from a mounted drive. So the Windows file system C:/ drive ( C:\Users\<user
name>\Project ) will look like this when mounted in a WSL command line:
/mnt/c/Users/<user name>/Project$ . It is possible to store your project files on a
mounted drive, but your performance speed will improve if you store them directly on
the \\wsl$ drive.
Bash
explorer.exe .
Alternatively, you can also use the command: powershell.exe /c start . Be sure to add
the period at the end of the command to open the current directory.
To view all of your available Linux distributions and their root file systems in Windows
File explorer, in the address bar enter: \\wsl$
Run Windows tools (ie. notepad.exe) from a Linux command line (ie. Ubuntu).
Run Linux tools (ie. grep) from a Windows command line (ie. PowerShell).
Share environment variables between Linux and Windows. (Build 17063+)
For example:
PowerShell
Use the same working directory as the current CMD or PowerShell prompt.
Run as the WSL default user.
Have the same Windows administrative rights as the calling process and terminal.
The Linux command following wsl (or wsl.exe ) is handled like any command run in
WSL. Things such as sudo, piping, and file redirection work.
PowerShell
Your default Linux distribution user name will be listed after running this command and
you will be asked for your password. After entering your password correctly, your
distribution will download updates.
To use the Linux command ls -la to list files and the PowerShell command findstr to
filter the results for words containing "git", combine the commands:
PowerShell
To use the PowerShell command dir to list files and the Linux command grep to filter
the results for words containing "git", combine the commands:
PowerShell
To use the Linux command ls -la to list files and the PowerShell command > out.txt
to print that list to a text file named "out.txt", combine the commands:
PowerShell
The commands passed into wsl.exe are forwarded to the WSL process without
modification. File paths must be specified in the WSL format.
To use the Linux command ls -la to list files in the /proc/cpuinfo Linux file system
path, using PowerShell:
PowerShell
To use the Linux command ls -la to list files in the C:\Program Files Windows file
system path, using PowerShell:
PowerShell
Retain the working directory as the WSL command prompt (for the most part --
exceptions are explained below).
Have the same permission rights as the WSL process.
Run as the active Windows user.
Appear in the Windows Task Manager as if directly executed from the CMD
prompt.
Windows executables run in WSL are handled similarly to native Linux executables --
piping, redirects, and even backgrounding work as expected.
To run the Windows tool ipconfig.exe , use the Linux tool grep to filter the "IPv4"
results, and use the Linux tool cut to remove the column fields, from a Linux
distribution (for example, Ubuntu) enter:
Bash
Let's try an example mixing Windows and Linux commands. Open your Linux
distribution (ie. Ubuntu) and create a text file: touch foo.txt . Now use the Linux
command ls -la to list the direct files and their creation details, plus the Windows
PowerShell tool findstr.exe to filter the results so only your foo.txt file shows in the
results:
Bash
Windows tools must include the file extension, match the file case, and be executable.
Non-executables including batch scripts. CMD native commands like dir can be run
with cmd.exe /C command.
For example, list the contents of your Windows files system C:\ directory, by entering:
Bash
cmd.exe /C dir
Or use the ping command to send an echo request to the microsoft.com website:
Bash
ping.exe www.microsoft.com
Parameters are passed to the Windows binary unmodified. As an example, the following
command will open C:\temp\foo.txt in notepad.exe :
Bash
notepad.exe "C:\temp\foo.txt"
This will also work:
Bash
notepad.exe C:\\temp\\foo.txt
7 Note
Prior to 17063, only Windows environment variable that WSL could access was
PATH (so you could launch Win32 executables from under WSL). Starting in 17063,
WSLENV flags
There are four flags available in WSLENV to influence how the environment variable is
translated.
WSLENV flags:
/p - translates the path between WSL/Linux style paths and Win32 paths.
Read more about WSLENV , including FAQs and examples of setting the value of
WSLENV to a concatenation of other pre-defined environment vars, each suffixed with a
slash followed by flags to specify how the value should be translated and passing
variables with a script. This article also includes an example for setting up a dev
environment with the Go programming language , configured to share a GOPATH
between WSL and Win32.
Disable interoperability
Users may disable the ability to run Windows tools for a single WSL session by running
the following command as root:
Bash
To re-enable Windows binaries, exit all WSL sessions and re-run bash.exe or run the
following command as root:
Bash
Disabling interop will not persist between WSL sessions -- interop will be enabled again
when a new session is launched.
Advanced settings configuration in WSL
Article • 09/19/2023
The wsl.conf and .wslconfig files are used to configure advanced settings options, on a
per-distribution basis ( wsl.conf ) and globally across all WSL 2 distributions
( .wslconfig ). This guide will cover each of the settings options, when to use each file
type, where to store the file, sample settings files and tips.
Both file types are used for configuring WSL settings, but the location where the file is
stored, the scope of the configuration, and the version of WSL running your distribution
all impact which file type to choose.
The version of WSL that you are running will impact the configuration settings. WSL 2
runs as a lightweight virtual machine (VM), so uses virtualization settings that allow you
to control the amount of memory or processors used (which may be familiar if you use
Hyper-V or VirtualBox).
wsl.conf
Stored in the /etc directory of the distribution as a unix file.
Used to configure settings on a per-distribution basis. Settings configured in this
file will only be applied to the specific Linux distribution that contains the directory
where this file is stored.
Can be used for distributions run by either version, WSL 1 or WSL 2.
To get to the /etc directory for an installed distribution, use the distribution's
command line with cd / to access the root directory, then ls to list files or
explorer.exe . to view in Windows File Explorer. The directory path should look
WSL will detect the existence of these files, read the contents, and automatically apply
the configuration settings every time you launch WSL. If the file is missing or malformed
(improper markup formatting), WSL will continue to launch as normal without the
configuration settings applied.
7 Note
If you launch a distribution (e.g. Ubuntu), modify the configuration file, close the
distribution, and then re-launch it, you might assume that your configuration changes
have immediately gone into effect. This is not currently the case as the subsystem could
still be running. You must wait for the subsystem to stop before relaunching in order to
give enough time for your changes to be picked up. You can check to see whether your
Linux distribution (shell) is still running after closing it by using PowerShell with the
command: wsl --list --running . If no distributions are running, you will receive the
response: "There are no running distributions." You can now restart the distribution to
see your configuration updates applied.
The command wsl --shutdown is a fast path to restarting WSL 2 distributions, but it will
shut down all running distributions, so use wisely.
The wsl.conf file supports four sections: automount , network , interop , and user .
(Modeled after .ini file conventions, keys are declared under a section, like .gitconfig files.)
See wsl.conf for info on where to store the wsl.conf file.
systemd support
Many Linux distributions run "systemd" by default (including Ubuntu) and WSL has
recently added support for this system/service manager so that WSL is even more
similar to using your favorite Linux distributions on a bare metal machine. You will need
version 0.67.6+ of WSL to enable systemd. Check your WSL version with command wsl
--version . If you need to update, you can grab the latest version of WSL in the
To enable systemd, open your wsl.conf file in a text editor using sudo for admin
permissions and add these lines to the /etc/wsl.conf :
Bash
[boot]
systemd=true
You will then need to close your WSL distribution using wsl.exe --shutdown from
PowerShell to restart your WSL instances. Once your distribution restarts, systemd
should be running. You can confirm using the command: systemctl list-unit-files --
type=service , which will show the status of your services.
Automount settings
Section label: [automount]
key value default notes
enabled boolean true true causes fixed drives (i.e C:/ or D:/ ) to be
automatically mounted with DrvFs under /mnt .
false means drives won't be mounted
automatically, but you could still mount them
manually or via fstab .
root string /mnt/ Sets the directory where fixed drives will be
automatically mounted. By default this is set to
/mnt/ , so your Windows file system C-drive is
mounted to /mnt/c/ . If you change /mnt/ to
/windir/ , you should expect to see your fixed
C-drive mounted to /windir/c .
options comma-separated empty The automount option values are listed below
list of values, such as string and are appended to the default DrvFs mount
uid, gid, etc, see options string. Only DrvFs-specific options can
automount options be specified.
below
The automount options are applied as the mount options for all automatically mounted
drives. To change the options for a specific drive only, use the /etc/fstab file instead.
Options that the mount binary would normally parse into a flag are not supported. If
you want to explicitly specify those options, you must include every drive for which you
want to do so in /etc/fstab .
Automount options
Setting different mount options for Windows drives (DrvFs) can control how file
permissions are calculated for Windows files. The following options are available:
uid The User ID used for the owner of all files The default User ID of
your WSL distro (on first
installation this defaults to
1000)
gid The Group ID used for the owner of all files The default group ID of
your WSL distro (on first
Key Description Default
umask An octal mask of permissions to exclude for all files and 022
directories
By default, WSL sets the uid and gid to the value of the default user. For example, in
Ubuntu, the default user is uid=1000, gid=1000. If this value is used to specify a
different gid or uid option, the default user value will be overwritten. Otherwise, the
default value will always be appended.
User file-creation mode mask (umask) sets permission for newly created files. The
default is 022, only you can write data but anyone can read data. Values can be changed
to reflect different permission settings. For example, umask=077 changes permission to
be completely private, no other user can read or write data. To further specify
permission, fmask (files) and dmask (directories) can also be used.
7 Note
The permission masks are put through a logical OR operation before being applied
to files or directories.
What is DrvFs?
DrvFs is a filesystem plugin to WSL that was designed to support interop between WSL
and the Windows filesystem. DrvFs enables WSL to mount drives with supported file
systems under /mnt, such as /mnt/c, /mnt/d, etc. For more information about specifying
the default case sensitivity behavior when mounting Windows or Linux drives or
directories, see the case sensitivity page.
Network settings
Section label: [network]
Interop settings
Section label: [interop]
enabled boolean true Setting this key will determine whether WSL will
support launching Windows processes.
appendWindowsPath boolean true Setting this key will determine whether WSL will add
Windows path elements to the $PATH environment
variable.
User settings
Section label: [user]
default string The initial username Setting this key specifies which user to run as
created on first run when first starting a WSL session.
Boot settings
The Boot setting is only available on Windows 11 and Server 2022.
command string "" A string of the command that you would like to run when the WSL
instance starts. This command is run as the root user. e.g: service
docker start .
Bash
# Set to true will automount fixed drives (C:/ or D:/) with DrvFs under the
root directory set above. Set to false means drives won't be mounted
automatically, but need to be mounted manually or with fstab.
enabled = true
# Sets the directory where fixed drives will be automatically mounted. This
example changes the mount location, so your C-drive would be /c, rather than
the default /mnt/c.
root = /
# Network host settings that enable the DNS server used by WSL 2. This
example changes the hostname, sets generateHosts to false, preventing WSL
from the default behavior of auto-generating /etc/hosts, and sets
generateResolvConf to false, preventing WSL from auto-generating
/etc/resolv.conf, so that you can create your own (ie. nameserver 1.1.1.1).
[network]
hostname = DemoHost
generateHosts = false
generateResolvConf = false
# Set whether WSL supports interop process like launching Windows apps and
adding path variables. Setting these to false will block the launch of
Windows processes and block adding $PATH environment variables.
[interop]
enabled = false
appendWindowsPath = false
# Set a command to run when a new WSL instance launches. This example starts
the Docker container service.
[boot]
command = service docker start
7 Note
This file can contain the following options that affect the VM that powers any WSL 2
distribution:
demand
exceeds limit
on hardware
device.
2. Only
available for
Windows 11.
Experimental settings
These settings are opt-in previews of experimental features that we aim to make default
in the future.
sparseVhd bool false When set to true, any newly created VHD will be set to
sparse automatically.
networkingMode ** string NAT If the value is mirrored then this turns on mirrored
networking mode. Default or unrecognized strings result
in NAT networking.
firewall ** bool false Setting this to true allows the Windows Firewall rules, as
well as rules specific to Hyper-V traffic, to filter WSL
network traffic.
dnsTunneling ** bool false Changes how DNS requests are proxied from WSL to
Windows
autoProxy * bool false Enforces WSL to use Windows’ HTTP proxy information
Entries with the path value must be Windows paths with escaped backslashes, e.g:
C:\\Temp\\myCustomKernel
Entries with the size value must be a size followed by a unit, for example 8GB or 512MB .
Entries with an * after the value type are only available on Windows 11.
Entries with an ** after the value type are only available on the Windows Insiders
Program .
See the Windows Command Line Blog to learn more about Experimental features
included in the WSL September 2023 update and the 2.0.0 WSL pre-release .
Bash
# Limits VM memory to use no more than 4 GB, this can be set as whole
numbers using GB or MB
memory=4GB
# Specify a custom Linux kernel to use with your installed distros. The
default kernel used can be found at https://github.com/microsoft/WSL2-Linux-
Kernel
kernel=C:\\temp\\myCustomKernel
# Sets additional kernel parameters, in this case enabling older Linux base
images such as Centos 6
kernelCommandLine = vsyscall=emulate
# Sets amount of swap storage space to 8GB, default is 25% of available RAM
swap=8GB
# Disable page reporting so WSL retains all allocated memory claimed from
Windows and releases none back when free
pageReporting=false
Additional resources
Windows Command Line Blog: Automatically Configuring WSL
Windows Command Line Blog: Chmod/Chown, DrvFs, file metadata
File Permissions for WSL
Article • 12/29/2021
This page details how Linux file permissions are interpreted across the Windows
Subsystem for Linux, especially when accessing resources inside of Windows on the NT
file system. This documentation assumes a basic understanding of the Linux file system
permissions structure and the umask command .
When accessing Windows files from WSL the file permissions are either calculated from
Windows permissions, or are read from metadata that has been added to the file by
WSL. This metadata is not enabled by default.
$LXMOD File mode (File systems permission octals and type, e.g: 0777)
Additionally, any file that is not a regular file or directory (e.g: symlinks, FIFOs, block
devices, unix sockets, and character devices) also have an NTFS reparse point. This
makes it much faster to determine the kind of file in a given directory without having to
query its extended attributes.
If the file has no metadata associated with it then we translate the effective permissions
of the Windows user to read/write/execute bits and set them to the this as the same
value for user, group, and other. For example, if your Windows user account has read
and execute access but not write access to the file then this will be shown as r-x for
user, group and other. If the file has the 'Read Only' attribute set in Windows then we do
not grant write access in Linux.
If the file has metadata present, we simply use those metadata values instead of
translating effective permissions of the Windows user.
Chmod will only have one effect, if you remove all the write attributes of a file then the
'read only' attribute on the Windows file will be set, since this is the same behavior as
CIFS (Common Internet File System) which is the SMB (Server Message Block) client in
Linux.
Chmod will change or add metadata depending on the file's already existing metadata.
Please keep in mind that you cannot give yourself more access than what you have on
Windows, even if the metadata says that is the case. For example, you could set the
metadata to display that you have write permissions to a file using chmod 777 , but if you
tried to access that file you would still not be able to write to it. This is thanks to
interoperability, as any read or write commands to Windows files are routed through
your Windows user permissions.
The Windows permissions of the newly created file will be the same as if you created the
file in Windows without a specific security descriptor, it will inherit the parent's
permissions.
Metadata is enabled
The file's permission bits are set to follow the Linux umask, and the file will be saved
with metadata.
In the default scenario, when automounting Windows drives, we specify that the user ID
(UID) for any file is set to the user ID of your WSL user and the group ID (GID) is set to
the principal group ID of your WSL user.
The UID and GID specified in the metadata is applied as the user owner and group
owner of the file.
There are a few considerations to be aware of when working with networking apps,
whether you are accessing a Linux networking app from a Windows app or accessing a
Windows networking app from a Linux app, you may need to identify the IP address of
the virtual machine you are working with, which will be different than the IP address of
your local physical machine.
1. Obtain the IP address of your host machine by running this command from your
Linux distribution: cat /etc/resolv.conf
2. Copy the IP address following the term: nameserver .
3. Connect to any Windows server using the copied IP address.
The picture below shows an example of this by connecting to a Node.js server running
in Windows via curl.
Connecting via remote IP addresses
When using remote IP addresses to connect to your applications, they will be treated as
connections from the Local Area Network (LAN). This means that you will need to make
sure your application can accept LAN connections.
For example, you may need to bind your application to 0.0.0.0 instead of 127.0.0.1 . In
the example of a Python app using Flask, this can be done with the command:
app.run(host='0.0.0.0') . Please keep security in mind when making these changes as
This isn't the default case in WSL 2. WSL 2 has a virtualized ethernet adapter with its
own unique IP address. Currently, to enable this workflow you will need to go through
the same steps as you would for a regular virtual machine. (We are looking into ways to
improve this experience.)
Here's an example of using the Netsh interface portproxy Windows command to add a
port proxy that listens on your host port and connects that port proxy to the IP address
for the WSL 2 VM.
PowerShell
WSL 2 (the WSL 2 VM address), which can be found by entering the command: wsl.exe
hostname -i .
PowerShell
wsl hostname -i for the IP address of your Linux distribution installed via WSL 2
IPv6 access
WSL 2 distributions currently cannot reach IPv6-only addresses. We are working on
adding this feature.
Use systemd to manage Linux services
with WSL
Article • 06/16/2023
Windows Subsystem for Linux (WSL) now supports systemd, an init system and service
manager used by many popular Linux distributions such as Ubuntu, Debian, and more.
(What is systemd?).
The init system default has recently changed from SystemV, with Systemd now the
default for the current version of Ubuntu that will be installed using the wsl --install
command default. Linux distributions other than the current version of Ubuntu may still
use the WSL init, similar to SystemV init. To change to SystemD, see How to enable
systemd.
Primarily an init system and service manager, systemd includes features like on-demand
starting of daemons, mount and automount point maintenance, snapshot support, and
processes tracking using Linux control groups.
Most major Linux distributions now run systemd, so enabling it on WSL brings the
experience even closer to using bare-metal Linux. See the video announcement with
systemd demos or examples of using systemd below to learn more about what systemd
has to offer.
To enable systemd for any other Linux distributions running on WSL 2 (changing the
default from using the systemv init):
1. Ensure that your WSL version is 0.67.6 or newer. (To check, run wsl --version . To
update, run wsl --update or download the latest version from the Microsoft
Store .)
2. Open a command line for your Linux distribution and enter cd / to access the root
directory, then ls to list the files. You will see a directory named "etc" that
contains the WSL configuration file for the distribution. Open this file so that you
can make an update with the Nano text editor by entering: nano /etc/wsl.conf .
3. Add these lines in the wsl.conf file that you now have open to change the init
used to systemd:
Bash
[boot]
systemd=true
4. Exit the Nano text editor (Ctrl + X, select Y to save your change). You will then need
to close the Linux distribution. You can use the command wsl.exe --shutdown in
PowerShell to restart all WSL instances.
Once your Linux distribution restarts, systemd will be running. You can confirm using the
command: systemctl list-unit-files --type=service , which will show the status of any
services associated with your Linux distribution.
Learn more about Advanced settings configuration in WSL, including the difference
between teh wsl.conf (distribution-specific) and .wslconfig (global) config files, how to
update automount settings, etc.
Oliver's tutorials based on these demos on the Ubuntu blog - includes "Use snap
to create a Nextcloud instance in minutes on WSL", "Manage your web projects
with LXD", and "Run a .Net Echo Bot as a systemd service on Ubuntu WSL"
Systemd examples
A few examples of Linux applications that depend on systemd are:
status.
Systemd Essentials: Working with the Services, Units, and the Journal
It is also important to note that with these change, systemd services will NOT keep your
WSL instance alive. Your WSL instance will stay alive in the same way it did previous to
this update, which you can read more about in this Background Task Support blog post
from 2017 .
Enterprise environment: Set up
Windows Subsystem for Linux for your
company
Article • 03/20/2023
As an administrator or manager, you may require all developers to use the same
approved software. This consistency helps to create a well-defined work environment.
The Windows Subsystem for Linux aids in this consistency by allowing you to import and
export custom WSL images from one machine to the next. Read the guide below to
learn more about:
To begin creating your WSL image, first install the Windows Subsystem for Linux.
Once installed, use The Microsoft Store for Business to download and install the Linux
distribution that’s right for you. Create an account with the Microsoft Store for
Business .
In regard to WSL, if the local policy merge firewall policy is set to "No" then WSL
networking will not work. (For more information, see Establish local policy merge and
application rules.)
To change this configuration, you can add the following to Windows firewall settings:
Supported
Sharing an approved image internally using wsl --import and wsl --export
Creating your own WSL distro for your Enterprise using the WSL Distro Launcher
repo
Here's a list of features for which we don't yet have support for, but are investigating.
Currently unsupported
Below is a list of commonly asked features that are currently unsupported within WSL.
These requests are on our backlog and we are investigating ways to add them.
Synchronizing the user inside WSL with the Windows user on the host machine
Managing updates and patching of the Linux distributions and packages using
Windows tools
Having Windows update also update WSL distro contents
Controlling which distributions users in your Enterprise can access
Running mandatory services (logging or monitoring) inside of WSL
Monitoring Linux instances using Windows configuration manager tools such as
SCCM or Intune
McAfee support
Import any Linux distribution to use
with WSL
Article • 02/14/2022
You can use any Linux distribution inside of the Windows Subsystem for Linux (WSL),
even if it is not available in the Microsoft Store , by importing it with a tar file.
This article shows how to import the Linux distribution, CentOS , for use with WSL by
obtaining its tar file using a Docker container. This process can be applied to import any
Linux distribution.
You can obtain a tar file in a variety of ways, two of which include:
Download a provided tar file. You can find an example for Alpine in the "Mini Root
Filesystem" section of the Alpine Linux downloads site.
Find a Linux distribution container and export an instance as a tar file. The example
below will show this process using the CentOS container .
Prerequisites
You must have WSL enabled with a Linux distribution installed running WSL 2.
You must have Docker Desktop for Windows installed with the WSL 2 engine
enabled and integration checked See the Docker Desktop license agreement for
updates on the terms of use.
1. Open the command line (Bash) for a Linux distribution that you've already installed
from the Microsoft Store (Ubuntu in this example).
2. Start the Docker service:
Bash
Bash
Bash
Bash
This process exports the CentOS tar file from the Docker container so that we can now
import it for use locally with WSL.
1. Open PowerShell and ensure that you have a folder created where you'd like the
distribution to be stored.
PowerShell
cd C:\temp
mkdir E:\wslDistroStorage\CentOS
PowerShell
3. Use the command wsl -l -v to check which distributions you have installed.
4. Finally, use the command wsl -d CentOS to run your newly imported CentOS Linux
distribution.
To set up user account with the CentOS distribution we just imported, first open
PowerShell and boot into CentOS, using the command:
PowerShell
wsl -d CentOS
Next, open your CentOS command line. Use this command to install sudo and password
setting tools into CentOS, create a user account, and set it as the default user. In this
example, the username will be 'caloewen'.
7 Note
You will want to add the username to the sudoers file so that enables the user to
use sudo. The command adduser -G wheel $myUsername adds the user myUsername
to the wheel group. Users in the wheel group are automatically granted sudo
privileges and can perform tasks requiring elevated permission.
Bash
You must now quit out of that instance and ensure that all WSL instances are
terminated. Start your distribution again to see your new default user by running this
command in PowerShell:
PowerShell
wsl --terminate CentOS
wsl -d CentOS
You will now see [caloewen@loewen-dev]$ as the output based on this example.
To learn more about configuring WSL settings, see Configure settings with .wslconfig
and wsl.conf.
Use our open source WSL sample to build WSL distro packages for the Microsoft Store
and/or to create custom Linux distro packages for sideloading. You can find the distro
launcher repo on GitHub.
Background
We distribute Linux distros for WSL as UWP applications through the Microsoft Store.
You can install those applications that will then run on WSL - the subsystem that sits in
the Windows kernel. This delivery mechanism has many benefits as discussed in an
earlier blog post .
Getting Started
Follow the instructions on the Distro Launcher GitHub repo to create a custom Linux
distro package.
Team Blogs
Open Sourcing a WSL Sample for Linux Distribution Maintainers and Sideloading
Custom Linux Distributions
Command-Line blog
Provide Feedback
Distro Launcher GitHub repo
GitHub issue tracker for WSL
Mount a Linux disk in WSL 2
Article • 07/18/2023
If you want to access a Linux disk format that isn't supported by Windows, you can use
WSL 2 to mount your disk and access its content. This tutorial will cover the steps to
identify the disk and partition to attach to WSL2, how to mount them, and how to
access them.
If you are connecting an external drive and do not have success with these mounting
instructions, you may want to try the instructions to Connect USB devices. The wsl --
mount command does not currently support USB/flash drives/SD card readers, (learn
7 Note
Prerequisites
You will need to be on Windows 11 Build 22000 or later, or be running the Microsoft
Store version of WSL. To check your WSL and Windows version, use the command:
wsl.exe --version
If you have mounted a NTFS-formatted drive on your Windows file system, you can
access that drive from your Linux distribution using WSL by creating a mounted
directory ( sudo mkdir /mnt/d , replacing 'd' with whatever drive letter you'd like to use)
and then using the drfs file system interop plugin, with the command:
Bash
If you have a Ext4-formatted drive, you cannot mount it on your Windows file system. In
order to mount an Ext4-formatted drive on your Linux distribution with WSL, you can
use the wsl --mount command following the instructions below.
PowerShell
The disks paths are available under the 'DeviceID' columns. Usually under the
\\.\PHYSICALDRIVE* format.
2. Mount the disk - Using PowerShell, you can mount the disk using the Disk path
discovered above, run:
PowerShell
PowerShell
The disks paths are listed after 'DeviceID', usually in the \\.\PHYSICALDRIVE*
format.
2. List and select the partitions to mount in WSL 2 - Once the disk is identified, run:
PowerShell
This will make the disk available in WSL 2. (In the case of our example, the
<DiskPath> is \\.\PHYSICALDRIVE* .
3. Once attached, the partition can be listed by running the following command
inside WSL 2:
Bash
lsblk
This will display the available block devices and their partitions.
Example output:
Bash
Bash
blkid <BlockDevice>
This will output the detected filesystem type (under the TYPE="<Filesystem>" format).
PowerShell
7 Note
If you wish to mount the entire disk as a single volume (i.e. if the disk isn't
partitioned), --partition can be omitted.
From Windows, the disk can be accessed from File Explorer by navigating to: \\wsl$\\
<Distro>\\<Mountpoint> (pick any Linux distribution).
PowerShell
7 Note
WSL from the Microsoft Store introduces a new argument to directly mount a
VHD: wsl --mount --vhd <pathToVHD>
You can also mount virtual hard disk files (VHD) into WSL using wsl --mount . To do this,
you first need to mount the VHD into Windows using the Mount-VHD command in
Windows. Be sure to run this command with administrator privileges. Below is an
example where we use this command, and also output the disk path. Be sure to replace
<pathToVHD> with your actual VHD path.
PowerShell
You can also use this technique to mount and interact with the virtual hard disks of
other WSL distros, as each WSL 2 distro is stored via a virtual hard disk file called:
ext4.vhdx . By default the VHDs for WSL 2 distros are stored in this path: C:\Users\
[user]\AppData\Local\Packages\[distro]\LocalState\[distroPackageName] , please
exercise caution accessing these system files, this is a power user workflow. Make sure
to run wsl --shutdown before interacting with this disk to ensure the disk is not in use.
PowerShell
7 Note
This only works if the disk is either MBR (Master Boot Record) or GPT (GUID Partition
Table). Read about partition styles - MBR and GPT.
PowerShell
Example:
PowerShell
7 Note
Only filesystem specific options are supported at this time. Generic options such as
ro, rw, noatime, ... are not supported.
PowerShell
7 Note
This option is only available with WSL from the Microsoft Store
By default the mountpoint name is generated based on the physical disk or VHD name.
This can be overriden with --name . Example:
PowerShell
Detaching a disk
To detach a disk from WSL 2, run:
PowerShell
7 Note
If one disk fails to unmount, WSL 2 can be forced to exit by running wsl --
shutdown , which will detach the disk.
Limitations
At this time, only entire disks can be attached to WSL 2, meaning that it's not
possible to attach only a partition. Concretely, this means that it's not possible to
use wsl --mount to read a partition on the boot device, because that device can't
be detached from Windows.
Only filesystems that are natively supported in the kernel can be mounted by wsl
--mount . This means that it's not possible to use installed filesystem drivers (such
Filesystems not directly supported by the kernel can be mounted via a --bare
attach and then invoking the relevant FUSE driver.
Connect USB devices
Article • 03/20/2023
This guide will walk through the steps necessary to connect a USB device to a Linux
distribution running on WSL 2 using the USB/IP open-source project, usbipd-win .
Setting up the USB/IP project on your Windows machine will enable common developer
USB scenarios like flashing an Arduino or accessing a smartcard reader.
Prerequisites
Running Windows 11 (Build 22000 or later). (Windows 10 support is possible, see
note below).
A machine with an x64/x86 processor is required. (Arm64 is currently not
supported with usbipd-win).
Linux distribution installed and set to WSL 2.
Running Linux kernel 5.10.60.1 or later.
7 Note
To check your Windows version and build number, select Windows logo key + R,
type winver, select OK. You can update to the latest Windows version by selecting
Start > Settings > Windows Update > Check for updates. To check your Linux
kernel version, open your Linux distribution and enter the command: uname -a . To
manually update to the latest kernel, open PowerShell and enter the command: 'wsl
--update`.
) Important
7 Note
Alternatively, you can also install the usbipd-win project using Windows Package
Manager (winget). If you have already installed winget, just use the command:
winget install --interactive --exact dorssel.usbipd-win to install usbipd-win. If
you leave out --interactive, winget may immediately restart your computer if that is
required to install the drivers.
A service called usbipd (display name: USBIP Device Host). You can check the
status of this service using the Services app from Windows.
A command line tool usbipd . The location of this tool will be added to the PATH
environment variable.
A firewall rule called usbipd to allow all local subnets to connect to the service. You
can modify this firewall rule to fine tune access control.
Bash
At this point a service is running on Windows to share USB devices, and the necessary
tools are installed in WSL to attach to shared devices.
Attach a USB device
Before attaching your USB device, ensure that a WSL command line is open. This will
keep the WSL 2 lightweight VM active.
PowerShell
2. Select the bus ID of the device you’d like to attach to WSL and run this command.
You’ll be prompted by WSL for a password to run a sudo command. The Linux
distribution to be attached must be your default distribution. (See the Basic
commands for WSL doc to change your default distribution).
PowerShell
3. Open Ubuntu (or your preferred WSL command line) and list the attached USB
devices using the command:
Bash
lsusb
You should see the device you just attached and be able to interact with it using
normal Linux tools. Depending on your application, you may need to configure
udev rules to allow non-root users to access the device.
4. Once you are done using the device in WSL, you can either physically disconnect
the USB device or run this command from PowerShell in administrator mode:
PowerShell
To learn more about how this works, see the Windows Command Line Blog and the
usbipd-win repo on GitHub .
For a video demonstration, see WSL 2: Connect USB devices (Tabs vs Spaces show) .
Adjust case sensitivity
Article • 04/27/2022
Case sensitivity determines whether uppercase (FOO.txt) and lowercase (foo.txt) letters
are handled as distinct (case-sensitive) or equivalent (case-insensitive) in a file name or
directory.
Standard behavior:
Windows file system treats file and directory names as case-insensitive. FOO.txt
and foo.txt will be treated as equivalent files.
Linux file system treats file and directory names as case-sensitive. FOO.txt and
foo.txt will be treated as distinct files.
The Windows file system supports setting case sensitivity with attribute flags per
directory. While the standard behavior is to be case-insensitive, you can assign an
attribute flag to make a directory case sensitive, so that it will recognize Linux files and
folders that may differ only by case.
This may be especially true when mounting drives to the Windows Subsystem for Linux
(WSL) file system. When working in the WSL file system, you are running Linux, thus files
and directories are treated as case-sensitive by default.
7 Note
In the past, if you had files whose name differed only by case, these files could not
be accessed by Windows, because Windows applications treat the file system as
case insensitive and cannot distinguish between files whose names only differ in
case. While Windows File Explorer will show both files, only one will open
regardless of which you select.
Change the case sensitivity of files and
directories
The following steps explain how to change a directory on the Windows file system so
that it is case-sensitive and will recognize files and folders that differ only by case.
2 Warning
Some Windows applications, using the assumption that the file system is case
insensitive, don’t use the correct case to refer to files. For example, it’s not
uncommon for applications to transform filenames to use all upper or lower case.
In directories marked as case sensitive, this means that these applications can no
longer access the files. Additionally, if Windows applications create new directories
in a directory tree where you are using case sensitive files, these directories are not
case sensitive. This can make it difficult to work with Windows tools in case
sensitive directories, so exercise caution when changing Windows file system case-
sensitivity settings.
PowerShell
Replace <path> with your file path. For a directory in the Windows (NTFS) file system,
the <path> will look like: C:\Users\user1\case-test or if you are already in the user1
directory, you could just run: fsutil.exe file setCaseSensitiveInfo case-test
Changing the case-sensitivity of a directory requires that you run elevated permissions
(run as Administrator). Changing the case-sensitivity flag also requires “Write attributes”,
“Create files”, “Create folders” and “Delete subfolders and files” permissions on the
directory. See the troubleshooting section for more about this.
To change a directory in the Windows file system so that it is case-sensitive (FOO ≠ foo),
run PowerShell as Administrator and use the command:
PowerShell
To change a directory in the Windows file system back to the case-insensitive default
(FOO = foo), run PowerShell as Administrator and use the command:
PowerShell
A directory must be empty in order to change the case sensitivity flag attribute on that
directory. You cannot disable the case sensitivity flag on a directory containing
folders/files whose names differ on only by case.
2 Warning
There is an exception to this inheritance policy when running in WSL 1 mode. When
a distribution is running in WSL 1 mode, the per-directory case sensitivity flag is not
inherited; directories created in a case sensitive directory are not automatically case
sensitive themselves. You must explicitly mark each directory as case sensitive
Bash
[automount]
options = case = dir
Case sensitivity unavailable (all directories on mounted NTFS drives will be case
insensitive): off
Bash
[automount]
options = case = off
Bash
[automount]
options = case = force
This option is only supported for mounting drives on Linux distributions running as WSL
1 and may require a registration key. To add a registration key, you can use this
command from an elevated (admin) command prompt: reg.exe add
HKLM\SYSTEM\CurrentControlSet\Services\lxss /v DrvFsAllowForceCaseSensitivity /t
REG_DWORD /d 1 .
You will need to restart WSL after making any changes to the wsl.conf file in order for
those changes to take effect. You can restart WSL using the command: wsl --shutdown
Tip
To mount a drive (which uses the DrvFs filesystem plugin to make the disk available
under /mnt, such as /mnt/c, /mnt/d, etc) with a specific case sensitivity setting for
ALL drives, use /etc/wsl.conf as described above. To set the default mount options
for one specific drive, use the /etc/fstab file to specify these options. For more
WSL configuration options, see Configure per distro launch settings with wslconf.
Bash
Bash
7 Note
If you change the case sensitive flag on an existing directory for a mounted drive
while WSL is running, ensure WSL has no references to that directory or else the
change will not be effective. This means the directory must not be open by any
WSL processes, including using the directory (or its descendants) as the current
working directory.
Setting this option to false on a case-insensitive file system may lead to confusing
errors, false conflicts, or duplicate files.
Troubleshooting
Additional resources
DevBlog: Per-directory case sensitivity and WSL
DevBlog: Improved per-directory case sensitivity support in WSL
How to manage WSL disk space
Article • 03/20/2023
This guide covers how to manage the disk space used by Linux distributions installed
using WSL 2, including:
Windows Subsystem for Linux (WSL 2) uses a virtualization platform to install Linux
distributions alongside the host Windows operating system, creating a Virtual Hard Disk
(VHD) to store files for each of the Linux distributions that you install. These VHDs use
the ext4 file system type and are represented on your Windows hard drive as an
ext4.vhdx file.
WSL 2 automatically resizes these VHD files to meet storage needs. By default each VHD
file used by WSL 2 is initially allocated a 1TB maximum amount of disk space (prior to
WSL release 0.58.0 this default was set to a 512GB max and 256GB max prior to that).
If the storage space required by your Linux files exceeds this maximum size, you will see
errors stating that you've run out of disk space. To fix this error, follow the guidance
below on How to expand the size of your WSL 2 Virtual Hard Disk.
To check available disk space, open a PowerShell command line and enter this command
(replacing <distribution-name> with the actual distribution name):
PowerShell
If this command does not work for you please upgrade to the Store version of WSL
using the wsl --update command, or try wsl df -h / .
If you see that you are near to reaching the available amount of disk space allocated to
your VHD, or have already received an error due to no disk space remaining, see the
next section for steps on how to expand the maximum amount of disk space allocated
to the VHD associated with your Linux distribution. The amount of disk space allocated
to your VHD by WSL will always show the default maximum amount (1TB in the most
recent version of WSL), even if the amount of disk space on your actual Windows device
is less than that. WSL mounts a VHD that will expand in size as you use it, so your Linux
distribution sees that it can grow to the allocated maximum size of 1TB.
2. Copy the directory path to the ext4.vhdx file associated with the Linux distribution
installed on your machine. For help, see How to locate the vhdx file and disk path
for your Linux distribution.
3. Open Windows Command Prompt with admin privileges and then open the
diskpart command interpreter by entering:
diskpart
4. You will now have a DISKPART> prompt. Enter the following command, replacing
<pathToVHD> with the directory path to the ext4.vhdx file associated with the Linux
5. Display the details associated with this virtual disk, including the Virtual size,
representing the current maximum size the VHD is allocated:
detail vdisk
6. You will need to convert the Virtual size to megabytes. For example, if Virtual size:
512 GB, convert this to 512000. The new value you enter must be greater than this
original value. For example, to double the virtual size of 512 GB to 1024 GB, you
would convert to MB and enter the value: 1024000. Be careful not to enter a value
higher than you actually want as the process of reducing a virtual disk size is much
more complicated.
7. Enter the value for the new maximum size you want to allocate to this Linux
distribution using the Windows Command Prompt DISKPART> prompt:
exit
9. Launch this Linux distribution. (Ensure it is running in WSL 2. You can confirm this
using the command: wsl.exe -l -v . WSL 1 is not supported).
10. Make WSL aware that it can expand the file system size for this distribution by
running these commands from your WSL distribution command line. You may see
this message in response to the first mount command: "/dev: none already
mounted on /dev." This message can safely be ignored.
Bash
Bash
Using the example from above, we changed the vhd size to 2048000, so the command
would be: sudo resize2fs /dev/sdb 2048000M .
7 Note
You may need to install resize2fs. If so, you can use this command to install it: sudo
apt install resize2fs .
Bash
The virtual drive (ext4.vhdx) for this Linux distribution has now successfully been
expanded to the new size.
) Important
We recommend that you do not modify, move, or access the WSL related files
located inside of your AppData folder using Windows tools or editors. Doing so
could cause your Linux distribution to become corrupted. If you would like to
access your Linux files from Windows, that is possible via the path \\wsl$\
<distribution-name>\ . Open your WSL distribution and enter explorer.exe . to
view that folder. To learn more, see the blog post: Accessing Linux files from
Windows .
To find the names of the block devices currently being used by WSL 2, open your
distribution and enter the command: lsblk . (Or open PowerShell and enter the
command: wsl.exe lsblk .) The output will look something like this:
Bash
NAME: The name assigned to the device will be sd[a-z], referring to the SCSI Disk
with a letter designation for each disk being used. sda is always the system
distribution.
MAJ:MIN: Represents numbers used by the Linux kernel to internally identify the
devices with the first number representing the device type (8 is used for Small
Computer System Interface/SCSI disks).
RM: Let's us know if the device is removable (1) or not (0).
SIZE: Total size of the volume.
RO: Let's us know if the device is read-only (1) or not (0).
TYPE: Refers to the device type (disk in this case).
MOUNTPOINTS: Refers to the current directory on the files system where the
block device is located (SWAP is for preconfigured inactive memory so no
mountpoint).
PowerShell
When a distribution is started as read-only, any attempts to write to the filesystem will
fail with an error like this:
Bash
$ touch file
touch: cannot touch 'file': Read-only file system
To repair a disk mount error in WSL, and restore it back to a usable / writeable state
again, you can use the wsl.exe --mount command to re-mount the disk with the
following steps:
1. Shutdown all WSL distributions by opening PowerShell and entering the command:
PowerShell
wsl.exe --shutdown
2. Open PowerShell as administrator (in an elevated command prompt) and enter the
mount command, replacing <path-to-ext4.vhdx> with the path to the
distribution's .vhdx file. For help locating this file, see How to locate the VHD file
and disk path for your Linux distribution.
PowerShell
3. Use the wsl.exe lsblk command from PowerShell to identify the block device
name for the distribution (sd[a-z]) and then enter the following command to repair
the disk (replacing <device> with the correct block device name, like "sdc"). The
e2fsck command checks ext4 file systems (the type used by distributions installed
PowerShell
wsl.exe sudo e2fsck -f /dev/<device>
7 Note
If you only have a single Linux distribution installed, you may encounter a "ext file
in use" error and will need to install an additional distribution in order to run
wsl.exe lsblk . You can uninstall the distribution once the repair is complete.
PowerShell
wsl.exe --unmount
2 Warning
You can use the command: sudo mount -o remount,rw / to return a read-only
distribution to a usable/writable state, but all changes will be in-memory and so will
be lost when the distribution is restarted. We recommend using the steps listed
above to mount and repair the disk instead.
PowerShell
PowerShell
C:\Users\User\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_7
9rhkp1fndgsc\LocalState\ext4.vhdx
This is the path to the ext4.vhdx file associated with the Linux distribution that you
listed.
Frequently Asked Questions about
Windows Subsystem for Linux
FAQ
General
What is Windows Subsystem for Linux (WSL)?
The Windows Subsystem for Linux (WSL) is a feature of the Windows operating system
that enables you to run a Linux file system, along with Linux command-line tools and
GUI apps, directly on Windows, alongside your traditional Windows desktop and apps.
What is Bash?
Bash is a popular text-based shell and command-language. It is the default shell
included within Ubuntu and other Linux distros. Users type commands into a shell to
execute scripts and/or run commands and tools to accomplish many tasks.
How does this work?
Check out this article on the Windows Command Line blog: A Deep Dive Into How WSL
Allows Windows to Access Linux Files which goes into detail about the underlying
technology.
Many languages like Ruby and Node.js are often ported to, and run great, on Windows.
However, not all of the Ruby Gem or node/NPM library owners port their libraries to
support Windows, and many have Linux-specific dependencies. This can often result in
systems built using such tools and libraries suffering from build and sometimes runtime
errors or unwanted behaviors on Windows.
These are just some of issues that caused many people to ask Microsoft to improve
Windows’ command-line tools and what drove us to partner with Canonical to enable
native Bash and Linux command-line tools to run on Windows.
Read more on the PowerShell team blog -- Bash for Windows: Why it’s awesome and
what it means for PowerShell
What processors does WSL support?
WSL supports x64 and Arm CPUs.
/mnt/<drive letter>/
WSL mounts your machine's fixed drives under the /mnt/<drive> folder in your Linux
distros. For example, your C: drive is mounted under /mnt/c/
Using your mounted drives, you can edit code in, for example, C:\dev\myproj\ using
Visual Studio / or VS Code , and build/test that code in Linux by accessing the same
files via /mnt/c/dev/myproj .
Learn more in Working across Windows and Linux file systems article.
2. Files in mounted drives are controlled by Windows and have the following
behaviors:
Additionally, you can then uninstall the Linux distro app on your machine just like any
other store application.
To learn more about wsl commands, see the article, Basic commands for WSL.
Bash
sudo update-locale LANG=en_US.UTF8
1. Kaspersky
2. AVG
3. Avast
4. Symantec Endpoint Protection
5. F-Secure
In some cases turning off the firewall allows for access. In some cases simply having the
firewall installed looks to block access.
Please note that traditional backup services that backup files in your AppData folders
(like Windows Backup) will not corrupt your Linux files.
The main differences between WSL and a traditional production environment are:
WSL has a lightweight utility VM that starts, stops and manages resources
automatically.
If you have no open file handles to Windows processes, the WSL VM will
automatically be shut down. This means if you are using it as a web server, SSH
into it to run your server and then exit, the VM could shut down because it is
detecting that users are finished using it and will clean up its resources.
WSL users have full access to their Linux instances. The lifetime of the VM, the
registered WSL distributions, etc., are all accessible by the user and can be
modified by the user.
WSL automatically gives file access to Windows files.
Windows paths are appended to your path by default, which could cause
unexpected behavior for certain Linux applications compared to a traditional Linux
environment.
WSL can run Windows executables from Linux, which could also lead to a different
environment than a traditional Linux VM.
The Linux kernel used by WSL is updated automatically.
GPU access in WSL happens through a /dev/dxg device, which routes GPU calls
out to the Windows GPU. This setup is different than a traditional Linux set up.
There are other smaller differences compared to bare metal Linux and more
differences are expected to arise in the future as the inner loop development
workflow is prioritized.
The easiest way is to use the wsl --export --vhd command to export your WSL
distribution to a VHD file. You can then copy this file to another machine, and
import it using wsl --import --vhd . Please see the commands doc for more
information.
The implementation above requires a lot of disk space. If you don't have a lot of
disk space you can use Linux techniques to move your files over:
Use tar -czf <tarballName> <directory> to create a tarball of your files. You
can then copy these specific files over to your new machine and run tar -xzf
<tarballName> to extract them.
You can also export a list of installed packages via apt with a command like so:
dpkg --get-selections | grep -v deinstall | awk '{print $1}' >
WSL 2
Does WSL 2 use Hyper-V? Will it be available on
Windows 10 Home and Windows 11 Home?
WSL 2 is available on all Desktop SKUs where WSL is available, including Windows 10
Home and Windows 11 Home.
The newest version of WSL uses Hyper-V architecture to enable its virtualization. This
architecture will be available in the 'Virtual Machine Platform' optional component. This
optional component will be available on all SKUs. You can expect to see more details
about this experience soon as we get closer to the WSL 2 release.
See the WSL issues repo for more background and discussion on WSL 2 issues with
VirtualBox 6.1 .
*If you're looking for a Windows virtual machine, VMWare, Hyper-V, VirtualBox, and
Parallels VM downloads are available on the Windows Dev Center.
Make sure to replace '<VMName>' with the name of your virtual machine.
Can I use wsl.conf in WSL 2?
WSL 2 supports the same wsl.conf file that WSL 1 uses. This means that any
configuration options that you had set in a WSL 1 distro, such as automounting
Windows drives, enabling or disabling interop, changing the directory where Windows
drives will be mounted, etc. will all work inside of WSL 2. You can learn more about the
configuration options in WSL in the Distribution Management page. Learn more about
support for mounting drives, disks, devices, or virtual hard disks (VHDs) in the Mount a
Linux disk in WSL 2 article.
Search existing issues to see if there are any associated with a problem that you
are having. Note that in the search bar, you can remove "is:open" to include issues
that have already been resolved in your search. Please consider commenting or
giving a thumbs up to any open issues that you would like to express your interest
in moving forward as a priority.
File a new issue. If you have found a problem with WSL and there does not appear
to be an existing issue, you can select the green New issue button and then choose
WSL - Bug Report. You will need to include a title for the issue, your Windows build
number (run cmd.exe /c ver to see your current build #), whether you're running
WSL 1 or 2, your current Linux Kernel version # (run wsl.exe --status or cat
/proc/version ), the version # of your distribution (run lsb_release -r ), any other
software versions involved, the repro steps, expected behavior, actual behavior,
and diagnostic logs if available and appropriate. For more info, see contributing to
WSL .
File a feature request by selecting the green New issue button and then select
Feature request. You will need to address a few questions describing your request.
File a documentation issue using the WSL docs repo . To contribute to the WSL
docs, see the Microsoft Docs contributor guide.
File a Windows Terminal issue using the the Windows Terminal product repo if
your problem is related more to the Windows Terminal, Windows Console, or the
command-line UI.
If you'd like to stay up to date with the latest WSL news you can do so with:
We have covered some common troubleshooting scenarios associated with WSL below,
but please consider searching the issues filed in the WSL product repo on GitHub as
well.
Search existing issues to see if there are any associated with a problem that you
are having. Note that in the search bar, you can remove "is:open" to include issues
that have already been resolved in your search. Please consider commenting or
giving a thumbs up to any open issues that you would like to express your interest
in moving forward as a priority.
File a new issue. If you have found a problem with WSL and there does not appear
to be an existing issue, you can select the green New issue button and then choose
WSL - Bug Report. You will need to include a title for the issue, your Windows build
number (run cmd.exe /c ver to see your current build #), whether you're running
WSL 1 or 2, your current Linux Kernel version # (run wsl.exe --status or cat
/proc/version ), the version # of your distribution (run lsb_release -r ), any other
software versions involved, the repro steps, expected behavior, actual behavior,
and diagnostic logs if available and appropriate. For more info, see contributing to
WSL .
File a feature request by selecting the green New issue button and then select
Feature request. You will need to address a few questions describing your request.
File a documentation issue using the WSL docs repo . To contribute to the WSL
docs, see the Microsoft Docs contributor guide.
File a Windows Terminal issue using the the Windows Terminal product repo if
your problem is related more to the Windows Terminal, Windows Console, or the
command-line UI.
Installation issues
Installation failed with error 0x80070003
The Windows Subsystem for Linux only runs on your system drive (usually this is
your C: drive). Make sure that distributions are stored on your system drive:
On Windows 10 open Settings -> System -> Storage -> More Storage
Settings: Change where new content is saved
On Windows 11 open Settings -> System -> Storage -> Advanced storage
settings -> Where new content is saved
Ensure that you have the Windows Subsystem for Linux enabled, and that you're
using Windows Build version 18362 or later. To enable WSL run this command
in a PowerShell prompt with admin privileges: Enable-WindowsOptionalFeature -
Online -FeatureName Microsoft-Windows-Subsystem-Linux .
The requested operation could not be completed due to a virtual disk system
limitation. Virtual hard disk files must be uncompressed and unencrypted and
must not be sparse.
Deselect "Compress contents" (as well as "Encrypt contents" if that’s checked)
by opening the profile folder for your Linux distribution. It should be located in
a folder on your Windows file system, something like:
%USERPROFILE%\AppData\Local\Packages\CanonicalGroupLimited...
In this Linux distro profile, there should be a LocalState folder. Right-click this
folder to display a menu of options. Select Properties > Advanced and then
ensure that the "Compress contents to save disk space" and "Encrypt contents
to secure data" checkboxes are unselected (not checked). If you are asked
whether to apply this to just to the current folder or to all subfolders and files,
select "just this folder" because you are only clearing the compress flag. After
this, the wsl --set-version command should work.
7 Note
In my case, the LocalState folder for my Ubuntu 18.04 distribution was located at
C:\Users<my-user-
name>\AppData\Local\Packages\CanonicalGroupLimited.Ubuntu18.04onWindows_
79rhkp1fndgsc
Check WSL Docs GitHub thread #4103 where this issue is being tracked for
updated information.
The term 'wsl' is not recognized as the name of a cmdlet, function, script file, or
operable program.
Ensure that the Windows Subsystem for Linux Optional Component is installed.
Additionally, if you are using an ARM64 device and running this command from
PowerShell, you will receive this error. Instead run wsl.exe from PowerShell
Core, or Command Prompt.
1. Run the distribution at least once before invoking it from the command line.
2. Check whether you may be running separate user accounts. Running your
primary user account with elevated permissions (in admin mode) should not
result in this error, but you should ensure that you aren't accidentally running
the built-in Administrator account that comes with Windows. This is a
separate user account and will not show any installed WSL distributions by
design. For more info, see Enable and Disable the Built-in Administrator
Account.
3. The WSL executable is only installed to the native system directory. When
you’re running a 32-bit process on 64-bit Windows (or on ARM64, any non-
native combination), the hosted non-native process actually sees a different
System32 folder. (The one a 32-bit process sees on x64 Windows is stored on
disk at \Windows\SysWOW64.) You can access the "native" system32 from a
hosted process by looking in the virtual folder: \Windows\sysnative . It won’t
actually be present on disk, mind you, but the filesystem path resolver will
find it.
Error: This update only applies to machines with the Windows Subsystem for
Linux.
To install the Linux kernel update MSI package, WSL is required and should be
enabled first. If it fails, it you will see the message: This update only applies to
machines with the Windows Subsystem for Linux .
1. You are still in old version of Windows which doesn't support WSL 2. See step
#2 for version requirements and links to update.
2. WSL is not enabled. You will need to return to step #1 and ensure that the
optional WSL feature is enabled on your machine.
3. After you enabled WSL, a reboot is required for it to take effect, reboot your
machine and try again.
Error: WSL 2 requires an update to its kernel component. For information please
visit https://aka.ms/wsl2kernel .
If the Linux kernel package is missing in the %SystemRoot%\system32\lxss\tools
folder, you will encounter this error. Resolve it by installing the Linux kernel
update MSI package in step #4 of these installation instructions. You may need
to uninstall the MSI from 'Add or Remove Programs', and install it again.
Common issues
If you hit 'Check for Updates' and still do not receive the update you can install KB
KB4566116 manually .
PowerShell
wsl --set-default-version 2
Error: 0x1bc
For information on key differences with WSL 2 please visit
https://aka.ms/wsl2
PowerShell
To check this, you can check the start up logs using: dmesg |grep 9p , and this will show
you any errors. A successful output looks like the following:
Bash
Please see this GitHub thread for further discussion on this issue.
PowerShell
C:\Users\me>wsl
WSL 2
To resolve this issue, please visit https://aka.ms/wsl2kernel and install the kernel
manually by following the directions on that doc page.
Users can run Windows executables like notepad.exe directly from Linux. Sometimes,
you may hit "command not found" like below:
Bash
$ notepad.exe
-bash: notepad.exe: command not found
If there are no Win32 paths in your $PATH, interop isn't going to find the .exe. You can
verify it by running echo $PATH in Linux. It's expected that you will see a Win32 path (for
example, /mnt/c/Windows) in the output. If you can't see any Windows paths then most
likely your PATH is being overwritten by your Linux shell.
Bash
The correct way on Debian is to remove above lines. You may also append $PATH during
the assignment like below, but this lead to some other problems with WSL and
VSCode..
Bash
PowerShell
4. Restart your machine after enabling the Virtual Machine Platform optional
component.
5. Make sure that the hypervisor launch is enabled in your boot configuration. You
can validate this by running (elevated powershell):
PowerShell
7. If you are receiving this error on an Azure Virtual Machine, check to ensure that
Trusted Launch is disabled. Nested Virtualization is not supported on Azure virtual
machines.
Learn more about how to Configure Nested Virtualization when running Hyper-V in a
Virtual Machine.
You can confirm local rule merging's setting by following these steps:
1. Open "Windows Defender Firewall with advanced security" (this is different than
"Windows Defender Firewall" in the Control Panel)
2. Right-click on the "Windows Defender Firewall with advanced security on Local
Computer" tab
3. Select "Properties"
4. Select the "Public Profile" tab on the new Window that opens
5. Select "Customize" under the "Settings" section
6. Check in the "Customize Settings for the Public Profile" window that opens to see
if "Rule Merging" is set to "No". This will block access to WSL.
You can find instructions on how to change this Firewall setting in Enterprise
environment: Set up WSL for your company.
1. Take a note of the DNS server of the VPN from doing ipconfig.exe /all
2. Make a copy of the existing resolv.conf sudo cp /etc/resolv.conf
/etc/resolv.conf.new
Once you have disconnected the VPN, you will have to revert the changes to
/etc/resolv.conf . To do this, do:
1. cd /etc
2. sudo mv resolv.conf resolv.conf.new
3. sudo ln -s ../run/resolvconf/resolv.conf resolv.conf
Some VPNs have been tested and confirmed to be incompatible with WSL, including:
PAC Proxy: WSL will configure the setting in Linux by Setting the "WSL_PAC_URL"
environment variable. Linux does not support PAC proxies by default.
Interactions with WSLENV: User defined environment variables take precedence
over those specified by this feature.
When enabled, the following apply to proxy settings on your Linux distributions:
The Linux environment variable, HTTP_PROXY , is set to the one or more HTTP
proxies found installed in the Windows HTTP proxy configuration.
The Linux environment variable, HTTPS_PROXY , is set to the one or more HTTPS
proxies found installed in the Windows HTTP proxy configuration.
The Linux environment variable, NO_PROXY , is set to bypass any HTTP/S proxies
found in the Windows configuration targets.
Every environment variable, except WSL_PAC_URL , is set to both lower case and
upper case. For example: HTTP_PROXY and http_proxy .
Learn more in the Command Line blog: WSL September 2023 update .
DNS Tunneling can be configured using the dnsTunneling setting in the experimental
section of the WSL Configuration file. When applying this setting, note these
considerations:
Native Docker can have connectivity issues in WSL when DNS tunneling is enabled
– if the network has a policy to block DNS traffic to: 8.8.8.8
If you use a VPN with WSL, turn on DNS tunneling. Many VPNs use NRPT policies,
which are only applied to WSL DNS queries when DNS tunneling is enabled.
The /etc/resolv.conf file in your Linux distribution has a 3 DNS servers maximum
limitation, while Windows may use more than 3 DNS servers. Using DNS tunneling
removes this limitation – all Windows DNS servers can now be used by Linux.
WSL will use Windows DNS suffixes in the following order (similar to the order
used by the Windows DNS client):
DNS queries from Docker containers (either Docker Desktop or native Docker
running in WSL) will bypass DNS tunneling. DNS tunneling cannot be leveraged to
apply host DNS settings and policies to Docker DNS traffic.
Docker Desktop has its own way (different from DNS tunneling) of applying host
DNS settings and policies to DNS queries from Docker containers.
Learn more in the Command Line blog: WSL September 2023 update .
WSL will automatically configure certain Linux networking settings when using mirrored
networking mode. Any user configurations of these settings while using mirrored
networking mode is not supported. Here is the list of settings WSL will configure:
Updating WSL
There are two components of Windows Subsystem for Linux that can require updating.
1. To update the Windows Subsystem for Linux itself, use the command wsl --update
in PowerShell or CMD.
2. To update the specific Linux distribution user binaries, use the command: apt-get
update | apt-get upgrade in the Linux distribution that you are seeking to update.
Bash
#!/bin/sh
exit 101
Bash
chmod +x /usr/sbin/policy-rc.d
Bash
1. Open cmd.exe
2. Right click title bar -> Properties -> Uncheck Use legacy console
3. Click OK
"Error: 0x80040154" after Windows update
The Windows Subsystem for Linux feature may be disabled during a Windows update. If
this happens the Windows feature must be re-enabled. Instructions for enabling the
Windows Subsystem for Linux can be found in the Manual Installation Guide.
Bash
Note: Do not do this if your optional feature is fully installed and working.
2. Enable the WSL optional feature (if not already)
3. Reboot
4. lxrun /uninstall /full
5. Install bash
1. Kaspersky
2. AVG
3. Avast
4. Symantec Endpoint Protection
In some cases turning off the firewall allows for access. In some cases simply having the
firewall installed looks to block access.
If you are using Microsoft Defender Firewall, unchecking "Blocks all incoming
connections, including those in the list of allowed apps." allows for access.
For later versions of Windows, Build 14926+, administrator privileges are no longer
required.
Bash is hung
If while working with bash, you find that bash is hung (or deadlocked) and not
responding to inputs, help us diagnose the issue by collecting and reporting a memory
dump. Note that these steps will crash your system. Do not do this if you are not
comfortable with that or save your work prior to doing this.
1. Change the memory dump type to "complete memory dump". While changing the
dump type, take a note of your current type.
To find your Windows Server build number, run the following in PowerShell:
PowerShell
PowerShell
Bash
3. Check the startup logs and make sure HostKeys are available and you don't see log
messages such as:
BASH
If you do see such messages and the keys are missing under /etc/ssh/ , you will have to
regenerate the keys or just purge&install openssh-server:
BASH
If you are running the enable WSL feature command from PowerShell, try using the
GUI instead by opening the start menu, searching for 'Turn Windows features on
or off' and then in the list select 'Windows Subsystem for Linux' which will install
the optional component.
If both of those fail and you need to access WSL please consider upgrading in
place by reinstalling Windows using installation media and selecting 'Keep
Everything' to ensure your apps and files are preserved. You can find instructions
on how to do so at the Reinstall Windows 10 page .
Bash
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/home/user/.ssh/private-key.pem' are too open.
Bash
[automount]
enabled = true
options = metadata,uid=1000,gid=1000,umask=0022
Please note that adding this command will include metadata and modify the file
permissions on the Windows files seen from WSL. Please see the File System Permissions
for more information.
It's a known issue, when using the Store version of WSL. You can work around this today
by using WSL 1, or by using the in-Windows version of WSL. See
https://aka.ms/wslstoreinfo for more info.
Console
Systems that require WSL 2 should leave the ICS service (SharedAccess) in it's default
start state, Manual (Trigger Start), and any policy that disables ICS should be overwritten
or removed. While disabling the ICS service will break WSL 2, and we do not
recommend disabling ICS, portions of ICS can be disabled using these instructions
bash.exe has been replaced with wsl.exe . Linux commands can be run from the
Windows Command Prompt or from PowerShell, but for early Windows versions,
you may need to use the bash command. For example: C:\temp> bash -c "ls -
la" . The WSL commands passed into bash -c are forwarded to the WSL process
without modification. File paths must be specified in the WSL format and care
must be taken to escape relevant characters. For example: C:\temp> bash -c "ls -
la /proc/cpuinfo" or C:\temp> bash -c "ls -la \"/mnt/c/Program Files\"" .
To see what commands are available for a particular distribution, run [distro.exe]
/? . For example, with Ubuntu: C:\> ubuntu.exe /? .
To change the default user to root use this command in PowerShell: C:\> lxrun
/setdefaultuser root and then run Bash.exe to log in: C:\> bash.exe . Reset your
password using the distributions password command: $ passwd username and then
close the Linux command line: $ exit . From Windows command prompt or
Powershell, reset your default user back to your normal Linux user account: C:\>
lxrun.exe /setdefaultuser username .
Build 21364
For general Windows information on build 21364 visit the Windows blog .
GUI apps are now available! For more information see this blog post .
Resolve error when accessing files via \\wsl.localhost\.
Fix potential deadlock in LxssManager service.
Build 21354
For general Windows information on build 21354 visit the Windows blog .
Switch the \wsl prefix to \wsl.localhost to avoid issues when there is a machine on
the network named "wsl". \wsl$ will continue to work.
Enable Linux quick access icon for wow processes.
Update issue where version 2 was always being passed via wslapi
RegisterDistribution.
Change the fmask of the /usr/lib/wsl/lib directory to 222 so files are marked as
executable [GH 3847]
Fix wsl service crash if Virtual Machine Platform is not enabled.
Build 21286
For general Windows information on build 21286 visit the Windows blog .
Console
[boot]
command=<string>
Build 20226
For general Windows information on build 20226 visit the Windows blog .
Build 20211
For general Windows information on build 20211 visit the Windows blog .
Introduce wsl.exe --mount for mounting physical or virtual disks. For more
information see Access Linux filesystems in Windows and WSL 2 .
Fix crash in LxssManager service when checking if the VM is idle. [GH 5768]
Support for compressed VHD files. [GH 4103]
Ensure that Linux user mode libs installed to c:\windows\system32\lxss\lib are
preserved across OS upgrade. [GH 5848]
Added the ability to list available distributions that can be installed with wsl --
install --list-distributions .
WSL instances are now terminated when the user logs off.
Build 20190
For general Windows information on build 20190 visit the Windows blog .
Build 20175
For general Windows information on build 20175 visit the Windows blog .
Build 20150
For general Windows information on build 20150 visit the Windows blog .
Build 19640
For general Windows information on build 19640 visit the Windows blog .
Build 19555
For general Windows information on build 19555 visit the Windows blog .
[WSL2] Use a memory cgroup to limit the amount of memory used by install and
conversion operations [GH 4669]
Make wsl.exe present when the Windows Subsystem for Linux optional component
is not enabled to improve feature discoverability.
Change wsl.exe to print help text if the WSL optional component is not installed
Fix race condition when creating instances
Create wslclient.dll that contains all command line functionality
Prevent crash during LxssManagerUser service stop
Fix wslapi.dll fast fail when distroName parameter is NULL
Build 19041
For general Windows information on build 19041 visit the Windows blog .
[WSL2] Clear the signal mask before launching the processes
[WSL2] Update Linux kernel to 4.19.84
Handle creation of /etc/resolv.conf symlink when the symlink is non-relative
Build 19028
For general Windows information on build 19028 visit the Windows blog .
Build 19018
For general Windows information on build 19018 visit the Windows blog .
[WSL2] Use cache=mmap as the default for 9p mounts to fix dotnet apps
[WSL2] Fixes for localhost relay [GH 4340]
[WSL2] Introduce a cross-distro shared tmpfs mount for sharing state between
distros
Fix restoring persistent network drive for \\wsl$
Build 19013
For general Windows information on build 19013 visit the Windows blog .
[WSL2] Improve memory performance of WSL utility VM. Memory that is no longer
in use will be freed back to the host.
[WSL2] Update kernel version to 4.19.79. (add CONFIG_HIGH_RES_TIMERS,
CONFIG_TASK_XACCT, CONFIG_TASK_IO_ACCOUNTING, CONFIG_SCHED_HRTICK,
and CONFIG_BRIDGE_VLAN_FILTERING).
[WSL2] Fix input relay to handle cases where stdin is a pipe handle that is not
closed [GH 4424]
Make the check for \\wsl$ case-insensitive.
Console
[wsl2]
pageReporting = <bool> # Enable or disable the free memory page reporting
feature (default true).
idleThreshold = <integer> # Set the idle threshold for memory compaction, 0
disables the feature (default 1).
Build 19002
For general Windows information on build 19002 visit the Windows blog .
Build 18995
For general Windows information on build 18995 visit the Windows blog .
[WSL2] Fix an issue where DrvFs mounts stopped working after an operation was
interrupted (e.g. ctrl-c) [GH 4377]
[WSL2] Fix handling of very large hvsocket messages [GH 4105]
[WSL2] Fix issue with interop when stdin is a file [GH 4475]
[WSL2] Fix service crash when unexpected network state is encountered [GH 4474]
[WSL2] Query the distro name from the interop server if the current process does
not have the environment variable
[WSL2] Fix issue with interop whe stdin is a file
[WSL2] Update Linux kernel version to 4.19.72
[WSL2] Add ability to specify additional kernel command line parameters via
.wslconfig
[wsl2]
kernelCommandLine = <string> # Additional kernel command line arguments
Build 18990
For general Windows information on build 18990 visit the Windows blog .
Build 18980
For general Windows information on build 18980 visit the Windows blog .
Fix reading symlinks that deny FILE_READ_DATA. This includes all the symlinks
Windows creates for backwards compatibility such as "C:\Document and Settings"
and a bunch of symlinks in the user profile directory
Make unexpected filesystem state non-fatal [GH 4334, 4305]
[WSL2] Add support for arm64 if your CPU / firmware supports virtualization
[WSL2] Allow unprivileged users to view kernel log
[WSL2] Fix output relay when stdout / stderr sockets have been closed [GH 4375]
[WSL2] Support battery and AC adapter passthrough
[WSL2] Update Linux kernel to 4.19.67
Add the ability to set default username in /etc/wsl.conf:
[user]
default=<string>
Build 18975
For general Windows information on build 18975 visit the Windows blog .
Build 18970
For general Windows information on build 18970 visit the Windows blog .
[WSL2] Sync time with host time when system resumes from sleep state [GH 4245]
[WSL2] Create NT symlinks on the Windows volumes when possible.
[WSL2] Create distros in UTS, IPC, PID, and Mount namespaces.
[WSL2] Fix localhost port relay when server binds to localhost directly [GH 4353]
[WSL2] Fix interop when output is redirected [GH 4337]
[WSL2] Support translating absolute NT symlinks.
[WSL2] Update kernel to 4.19.59
[WSL2] Properly set subnet mask for eth0.
[WSL2] Change logic to break out of console worker loop when exit event is
signaled.
[WSL2] Eject distribution vhd when the distro is not running.
[WSL2] Fix config parsing library to correctly handle empty values.
[WSL2] Support Docker Desktop by creating cross distro mounts. A distro can opt-
in to this behavior by adding the following line to the /etc/wsl.conf file:
[automount]
crossDistro = true
Build 18945
For general Windows information on build 18945 visit the Windows blog .
WSL
[WSL2] Allow listening tcp sockets in WSL2 to be accessible from the host by using
localhost:port
[WSL2] Fixes for install / conversion failures and additional diagnostics to track
down future issues [GH 4105]
[WSL2] Improve diagnosability of WSL2 network issues
[WSL2] Update kernel version to 4.19.55
[WSL2] Update kernel with config options required for docker [GH 4165]
[WSL2] Increase the number of CPUs assigned to the lightweight utility VM to be
the same as the host (was previously capped at 8 by CONFIG_NR_CPUS in the
kernel config) [GH 4137]
[WSL2] Create a swap file for the WSL2 lightweight VM
[WSL2] Allow user mounts to be visible via \\wsl$\distro (for example sshfs) [GH
4172]
[WSL2] Improve 9p filesystem performance
[WSL2] Ensure vhd ACL does not grow unbounded [GH 4126]
[WSL2] Update kernel config to support squashfs and xt_conntrack [GH 4107,
4123]
[WSL2] Fix for interop.enabled /etc/wsl.conf option [GH 4140]
[WSL2] Return ENOTSUP if the file system does not support EAs
[WSL2] Fix CopyFile hang with \\wsl$
Switch default umask to 0022 and add filesystem.umask setting to /etc/wsl.conf
Fix wslpath to properly resolve symlinks, this was regressed in 19h1 [GH 4078]
Introduce %UserProfile%\.wslconfig file for tweaking WSL2 settings
[wsl2]
kernel=<path> # An absolute Windows path to a custom Linux
kernel.
memory=<size> # How much memory to assign to the WSL2 VM.
processors=<number> # How many processors to assign to the WSL2 VM.
swap=<size> # How much swap space to add to the WSL2 VM. 0
for no swap file.
swapFile=<path> # An absolute Windows path to the swap vhd.
localhostForwarding=<bool> # Boolean specifying if ports bound to wildcard
or localhost in the WSL2 VM should be connectable from the host via
localhost:port (default true).
Build 18917
For general Windows information on build 18917 visit the Windows blog .
WSL
WSL 2 is now available! Please see blog for more details.
Fix a regression where launching Windows processes via symlinks did not work
correctly [GH 3999]
Add wsl.exe --list --verbose, wsl.exe --list --quiet, and wsl.exe --import --version
options to wsl.exe
Add wsl.exe --shutdown option
Plan 9: Allow opening a directory for write to succeed
Build 18890
For general Windows information on build 18890 visit the Windows blog .
WSL
Non-blocking socket leak [GH 2913]
EOF input to terminal can block subsequent reads [GH 3421]
Update resolv.conf header to refer to wsl.conf [discussed in GH 3928]
Deadlock in epoll delete code [GH 3922]
Handle spaces in arguments to --import and –export [GH 3932]
Extending mmap'd files does not work properly [GH 3939]
Fix issue with ARM64 \\wsl$ access not working properly
Add better default icon for wsl.exe
Build 18342
For general Windows information on build 18342 visit the Windows blog .
WSL
We've added the ability for users to access Linux files in a WSL distro from
Windows. These files can be accessed through the command line, and also
Windows apps, like file explorer, VSCode, etc. can interact with these files. Access
your files by navigating to \\wsl$\<distro_name>, or see a list of running
distributions by navigating to \\wsl$
Add additional CPU info tags and fix Cpus_allowed[_list] values [GH 2234]
Support exec from non-leader thread [GH 3800]
Treat configuration update failures as non-fatal [GH 3785]
Update binfmt to properly handle offsets [GH 3768]
Enable mapping network drives for Plan 9 [GH 3854]
Support Windows -> Linux and Linux -> Windows path translation for bind
mounts
Create read-only sections for mappings on files opened read-only
Build 18334
For general Windows information on build 18334 visit the Windows blog .
WSL
Redesign the way that Windows time zone is mapped to a Linux time zone [GH
3747]
Fix memory leaks and add new string translation functions [GH 3746]
SIGCONT on a threadgroup with no threads is a no-op [GH 3741]
Correctly display socket and epoll file descriptors in /proc/self/fd
Build 18305
For general Windows information on build 18305 visit the Windows blog .
WSL
pthreads lose access to files when the primary thread exits [GH 3589]
TIOCSCTTY should ignore the "force" parameter unless it is required [GH 3652]
wsl.exe command line improvements and addition of import / export functionality.
--exec, -e <CommandLine>
Execute the specified command without using the default Linux shell.
--
Pass the remaining command line as is.
Options:
--distribution, -d <DistributionName>
Run the specified distribution.
--user, -u <UserName>
Run as the specified user.
--list, -l [Options]
Lists distributions.
Options:
--all
List all distributions, including distributions that are
currently
being installed or uninstalled.
--running
List only distributions that are currently running.
-setdefault, -s <DistributionName>
Sets the distribution as the default.
--terminate, -t <DistributionName>
Terminates the distribution.
--unregister <DistributionName>
Unregisters the distribution.
--upgrade <DistributionName>
Upgrades the distribution to the WslFs file system format.
--help
Display usage information.
Build 18277
For general Windows information on build 18277 visit the Windows blog .
WSL
Fix "no such interface supported" error introduced in build 18272 [GH 3645]
Ignore the MNT_FORCE flag for umount syscall [GH 3605]
Switch WSL interop to use the official CreatePseudoConsole API
Maintain no timeout value when FUTEX_WAIT restarts
Build 18272
For general Windows information on build 18272 visit the Windows blog .
WSL
WARNING: There is an issue in this build that makes WSL inoperable. When trying
to launch your distribution you will see a "No such interface supported" error. The
issue has been fixed and will be in next week's Insider Fast build. If you've installed
this build you can roll back to the previous Windows build using "Go back to the
previous version of Windows 10" in Settings->Update & Security->Recovery.
Build 18267
For general Windows information on build 18267 visit the Windows blog .
WSL
Fix issue where zombie process may not be reaped and remain indefinitely.
WslRegisterDistribution hangs if error message exceeds max length [GH 3592]
Allow fsync to succeed for read-only files on DrvFs [GH 3556]
Ensure that /bin and /sbin directories exist before creating symlinks inside [GH
3584]
Added an instance termination timeout mechanism for WSL instances. The timeout
is currently set to 15 seconds, meaning the instance will terminate 15 seconds after
the last WSL process exits. To terminate a distribution immediately, use:
WSL
Setpriority syscall permission check too strict for changing same thread priority
[GH 1838]
Ensure that unbiased interrupt time is used for boot time to avoid returning
negative values for clock_gettime(CLOCK_BOOTTIME) [GH 3434]
Handle symlinks in the WSL binfmt interpreter [GH 3424]
Better handling of threadgroup leader file descriptor cleanup.
Switch WSL to use KeQueryInterruptTimePrecise instead of
KeQueryPerformanceCounter to avoid overflow [GH 3252]
Ptrace attach may cause bad return value from system calls [GH 1731]
Fix several AF_UNIX related issues [GH 3371]
Fix issue that could cause WSL interop to fail if the current working directory is less
than 5 characters long [GH 3379]
Avoid one second delay failing loopback connections to non-existent ports [GH
3286]
Add /proc/sys/fs/file-max stub file [GH 2893]
More accurate IPV6 scope information.
PR_SET_PTRACER support [GH 3053]
Pipe filesystem inadvertently clearing edge-triggered epoll event [GH 3276]
Win32 executable launched via NTFS symlink doesn't respect symlink name [GH
2909]
Improved zombie support [GH 1353]
Add wsl.conf entries for controlling Windows interop behavior [GH 1493]
[interop]
Fix for getsockname not always returning UNIX socket family type [GH 1774]
Add support for TIOCSTI [GH 1863]
Non-blocking sockets in the process of connecting should return EAGAIN for write
attempts [GH 2846]
Support interop on mounted VHDs [GH 3246, 3291]
Fix permission checking issue on root folder [GH 3304]
Limited support for TTY keyboard ioctls KDGKBTYPE, KDGKBMODE and
KDSKBMODE.
Windows UI apps should execute even when launched in the background.
Add wsl -u or --user option [GH 1203]
Fix WSL launch issues when fast startup is enabled [GH 2576]
Unix sockets need to retain disconnected peer credentials [GH 3183]
Non-blocking Unix sockets failing indefinitely with EAGAIN [GH 3191]
case=off is the new default drvfs mount type [GH 2937, 3212, 3328]
See blog for more information.
Add wslconfig /terminate to stop running distributions.
Fix issue with the WSL shell context menu entries that do not correctly handle
paths with spaces.
Expose per-directory case sensitivity as an extended attribute
ARM64: Emulate cache maintenance operations. Resolve dotnet issue .
DrvFs: only unescape characters in the private range that correspond to an
escaped character.
Fix off-by-one error in ELF parser interpreter length validation [GH 3154]
WSL absolute timers with a time in the past do not fire [GH 3091]
Ensure newly created reparse points are listed as such in the parent directory.
Atomically create case sensitive directories in DrvFs.
Fixed an additional issue where multithreaded operations could return ENOENT
even though the file exists. [GH 2712]
Fixed WSL launch failure when UMCI is enabled. [GH 3020]
Add explorer context menu to launch WSL [GH 437, 603, 1836]. To use, hold shift
and right-click when in an explorer window.
Fix Unix socket non-blocking behavior [GH 2822, 3100]
Fix hanging NETLINK command as reported in GH 2026.
Add support for mount propagation flags [GH 2911].
Fix issue with truncate not causing inotify events [GH 2978].
Add --exec option for wsl.exe to invoke a single binary without a shell.
Add --distribution option for wsl.exe to select a specific distro.
Limited support for dmesg. Applications can now log to dmesg. WSL driver logs
limited information to dmesg. In future, this can be extended to carry other
information/diagnostics from the driver.
Note: dmesg is currently supported through the /dev/kmsg device interface.
syslog syscall interface is not yet supported. And, so, some of the dmesg
WSL
Move init and bsdtar binaries out of lxssmanager dll and into a separate tools
folder
Fix race around closing file descriptor when using CLONE_FILES
Handle optional fields in /proc/pid/mountinfo when translating DrvFs paths
Allow DrvFs mknod to succeed without metadata support for S_IFREG
Readonly files created on DrvFs should have the readonly attribute set [GH 3411]
Add /sbin/mount.drvfs helper to handle DrvFs mounting
Use POSIX rename in DrvFs.
Allow path translation on volumes without a volume GUID.
WSL
Setpriority syscall permission check too strict for changing same thread priority
[GH 1838]
Ensure that unbiased interrupt time is used for boot time to avoid returning
negative values for clock_gettime(CLOCK_BOOTTIME) [GH 3434]
Handle symlinks in the WSL binfmt interpreter [GH 3424]
Better handling of threadgroup leader file descriptor cleanup.
WSL
Switch WSL to use KeQueryInterruptTimePrecise instead of
KeQueryPerformanceCounter to avoid overflow [GH 3252]
Ptrace attach may cause bad return value from system calls [GH 1731]
Fix a number of AF_UNIX related issues [GH 3371]
Fix issue that could cause WSL interop to fail if the current working directory is less
than 5 characters long [GH 3379]
WSL
Pipe filesystem inadvertently clearing edge-triggered epoll event [GH 3276]
Win32 executable launched via NTFS symlink doesn't respect symlink name [GH
2909]
WSL
Avoid one second delay failing loopback connections to non-existent ports [GH
3286]
Add /proc/sys/fs/file-max stub file [GH 2893]
More accurate IPV6 scope information.
PR_SET_PTRACER support [GH 3053]
Pipe filesystem inadvertently clearing edge-triggered epoll event [GH 3276]
Win32 executable launched via NTFS symlink doesn't respect symlink name [GH
2909]
Build 17713
For general Windows information on build 17713 visit the Windows Blog .
WSL
Improved zombie support [GH 1353]
Add wsl.conf entries for controlling Windows interop behavior [GH 1493]
[interop]
Fix for getsockname not always returning UNIX socket family type [GH 1774]
Add support for TIOCSTI [GH 1863]
Non-blocking sockets in the process of connecting should return EAGAIN for write
attempts [GH 2846]
Support interop on mounted VHDs [GH 3246, 3291]
Fix permission checking issue on root folder [GH 3304]
Limited support for TTY keyboard ioctls KDGKBTYPE, KDGKBMODE and
KDSKBMODE.
Windows UI apps should execute even when launched in the background.
Build 17704
For general Windows information on build 17704 visit the Windows Blog .
WSL
Add wsl -u or --user option [GH 1203]
Fix WSL launch issues when fast startup is enabled [GH 2576]
Unix sockets need to retain disconnected peer credentials [GH 3183]
Non-blocking Unix sockets failing indefinitely with EAGAIN [GH 3191]
case=off is the new default drvfs mount type [GH 2937, 3212, 3328]
See blog for more information.
Add wslconfig /terminate to stop running distributions.
Build 17692
For general Windows information on build 17692 visit the Windows Blog .
WSL
Fix issue with the WSL shell context menu entries that do not correctly handle
paths with spaces.
Expose per-directory case sensitivity as an extended attribute
ARM64: Emulate cache maintenance operations. Resolve dotnet issue .
DrvFs: only unescape characters in the private range that correspond to an
escaped character.
Build 17686
For general Windows information on build 17686 visit the Windows Blog .
WSL
Fix off-by-one error in ELF parser interpreter length validation [GH 3154]
WSL absolute timers with a time in the past do not fire [GH 3091]
Ensure newly created reparse points are listed as such in the parent directory.
Atomically create case sensitive directories in DrvFs.
Build 17677
For general Windows information on build 17677 visit the Windows Blog .
WSL
Fixed an additional issue where multithreaded operations could return ENOENT
even though the file exists. [GH 2712]
Fixed WSL launch failure when UMCI is enabled. [GH 3020]
Build 17666
For general Windows information on build 17666 visit the Windows Blog .
WSL
WSL
Limited support for dmesg. Applications can now log to dmesg. WSL driver logs
limited information to dmesg. In future, this can be extended to carry other
information/diagnostics from the driver.
Note: dmesg is currently supported through the /dev/kmsg device interface.
syslog sycall interface is not yet supported. And, so, some of the dmesg
WSL
Change default gid and mode of serial devices to match native [GH 3042]
DrvFs now supports extended attributes.
Note: DrvFs has some limitations on the name of extended attributes. In
particular, some characters (like '/', ':' and '*') are not allowed, and extended
attribute names are not case sensitive on DrvFs
WSL
Fix for hang in WSL. [GH 3039, 3034]
WSL
None
WSL
Add support for the futex pi-aware operations. [GH 1006]
Note that priorities are not currently a supported WSL feature so there are
limitations, but standard usage should be unblocked.
Windows firewall support for WSL processes. [GH 1852]
For example, to allow the WSL python process to listen on any port, use the
elevated Windows cmd: netsh.exe advfirewall firewall add rule
name=wsl_python dir=in action=allow program="C:\users\
<username>\appdata\local\packages\canonicalgrouplimited.ubuntuonwindows_79r
hkp1fndgsc\localstate\rootfs\usr\bin\python2.7" enable=yes
Console
No fixes.
LTP Results:
Testing in progress.
WSL
Introduce pseudoconsole functionality for NT interop [GH 988, 1366, 1433, 1542,
2370, 2406].
The legacy install mechanism (lxrun.exe) has been deprecated. The supported
mechanism for installing distributions is through the Microsoft Store.
Console
No fixes.
LTP Results:
Testing in progress.
Build 17110
For general Windows information on build 17110 visit the Windows Blog .
WSL
Allow /init to be terminated from Windows [GH 2928].
DrvFs now uses per-directory case sensitivity by default (equivalent to the
"case=dir" mount option).
Using "case=force" (the old behavior) requires setting a registry key. Run the
following command to enable "case=force" if you need to use it: reg add
HKLM\SYSTEM\CurrentControlSet\Services\lxss /v
DrvFsAllowForceCaseSensitivity /t REG_DWORD /d 1
If you have existing directories created with WSL in older version of Windows
which need to be case sensitive, use fsutil.exe to mark them as case sensitive:
fsutil.exe file setcasesensitiveinfo <path> enable
NULL terminate strings returned from the uname syscall.
Console
No fixes.
LTP Results:
Testing in progress.
Build 17107
For general Windows information on build 17107 visit the Windows Blog .
WSL
Support TCSETSF and TCSETSW on master pty endpoints [GH 2552].
Starting simultaneous interop processes can result in EINVAL [GH 2813].
Fix PTRACE_ATTACH to show proper tracing status in /proc/pid/status.
Fix race where short-lived processes cloned with both the CLEARTID and SETTID
flags could exit without clearing the TID address.
Display a message when upgrading the Linux file system directories when moving
from a pre-17093 build. For more details on the 17093 file system changes, see the
release notes for 17093 .
Console
No fixes.
LTP Results:
Testing in progress.
Build 17101
For general Windows information on build 17101 visit the Windows Blog .
WSL
Support for signalfd. [GH 129]
Support file-names containing illegal NTFS characters by encoding them as private
Unicode characters. [GH 1514]
Auto mount will fallback to read-only when write is not supported. [GH 2603]
Allow pasting of Unicode surrogate pairs (like emoji characters). [GH 2765]
Pseudo-files in /proc and /sys should return read and write ready from select, poll,
epoll, et al. [GH 2838]
Fix issue that could cause service to go into infinite loop when the registry has
been tampered with or is corrupt.
Fix netlink messages to work with newer (upstream 4.14) version of iproute2.
Console
No fixes.
LTP Results:
Testing in progress.
Build 17093
For general Windows information on build 17093 visit the Windows Blog .
Important:
When starting WSL for the first time after upgrading to this build, it needs to perform
some work upgrading the Linux file system directories. This may take up to several
minutes, so WSL may appear to start slowly. This should only happen once for each
distribution you have installed from the store.
WSL and Windows applications can now communicate with each other over Unix
sockets. Imagine you want to run a service in Windows and make it available to both
Windows and WSL apps. Now, that's possible with Unix sockets. Read more in our blog
post at https://aka.ms/afunixinterop
WSL
Support mmap() with MAP_NORESERVE [GH 121, 2784]
Support CLONE_PTRACE and CLONE_UNTRACED [GH 121, 2781]
Handle non-SIGCHLD termination signal in clone [GH 121, 2781]
Stub /proc/sys/fs/inotify/max_user_instances and
/proc/sys/fs/inotify/max_user_watches [GH 1705]
Error loading ELF binaries that contain load headers with non-zero offsets [GH
1884]
Zero out trailing page bytes when loading images.
Reduce cases where execve silently terminates process
Console
No fixes.
LTP Results:
Testing in progress.
Build 17083
For general Windows information on build 17083 visit the Windows Blog .
WSL
Fixed bugcheck related to epoll [GH 2798, 2801, 2857]
Fixed hangs when turning off ASLR [GH 1185, 2870]
Ensure mmap operations appear atomic [GH 2732]
Console
No fixes.
LTP Results:
Testing in progress.
Build 17074
For general Windows information on build 17074 visit the Windows Blog .
WSL
Fixed storage format of DrvFs metadata [GH 2777]
Important: DrvFs metadata created before this build will show up incorrectly or
not at all. To fix affected files, use chmod and chown to re-apply the metadata.
Fixed issue with multiple signals and restartable syscalls.
Console
No fixes.
LTP Results:
Testing in progress.
Build 17063
For general Windows information on build 17063 visit the Windows Blog .
WSL
DrvFs supports additional Linux metadata. This allows setting the owner and mode
of files using chmod/chown, and also the creation of special files such as fifos, unix
sockets and device files. This is disabled by default for now since it's still
experimental. Note: We fixed a bug in the metadata format used by DrvFs. While
metadata works on this build for experimentation, future builds will not correctly
read metadata created by this build. You might need to manually update owner for
modified files and devices with a custom device ID will have to be recreated.
To enable, mount DrvFs with the metadata option (to enable it on an existing
mount, you must first unmount it):
Bash
Linux permissions are added as additional metadata to the file; they do not affect
the Windows permissions. Remember, editing a file using a Windows editor may
remove the metadata. In this case, the file will revert to its default permissions.
For example:
Combine with the metadata option to specify default permissions for files without
metadata.
For example:
Bash
WSLENV=GOPATH/l:USERPROFILE/pu:DISPLAY
when launching WSL processes from Win32 or Win32 processes from WSL. Each
variable can be suffixed with a slash followed by flags to specify how it is
translated.
p: The value is a path that should be translated between WSL paths and Win32
paths.
l: The value is a list of paths. In WSL, it is a colon-delimited list. In Win32, it is a
semicolon-delimited list.
u: The value should only be included when invoking WSL from Win32
w: The value should only be included when invoking Win32 from WSL
You can set WSLENV in .bashrc or in the custom Windows environment for your
user.
significantly improved mmap performance for large reserve regions; improves ghc
performance (GH 1671)
personality supports for READ_IMPLIES_EXEC; fixes maxima and clisp (GH 1185)
Ignore interfaces that are not up when generating resolv.conf nameservers [GH
2694]
AF_UNIX is available in the Windows Insider SDK (17061+). Read this blog to
learn more about AF_UNIX and how developers on Windows can use it.
Console
No fixes.
LTP Results:
Testing in progress.
Build 17046
For general Windows information on build 17046 visit the Windows Blog .
Fixed
WSL
Allow processes to run without an active terminal. [GH 709, 1007, 1511, 2252, 2391,
et al.]
Better support of CLONE_VFORK and CLONE_VM. [GH 1878, 2615]
Skip TDI filter drivers for WSL networking operations. [GH 1554]
DrvFs creates NT symlinks when certain conditions are met. [GH 353, 1475, 2602]
The link target must be relative, must not cross any mount points or symlinks,
and must exist.
The user must have SE_CREATE_SYMBOLIC_LINK_PRIVILEGE (this normally
requires you to launch wsl.exe elevated), unless Developer Mode is turned on.
In all other situations, DrvFs still creates WSL symlinks.
Allow running elevated and non-elevated WSL instances simultaneously.
Support /proc/sys/kernel/yama/ptrace_scope
Add wslpath to do WSL<->Windows path conversions. [GH 522, 1243, 1834, 2327,
et al.]
wslpath usage:
-a force result to absolute path format
-u translate from a Windows path to a WSL path (default)
-w translate from a WSL path to a Windows path
-m translate from a WSL path to a Windows path, with '/' instead
of '\\'
LTP Results:
Testing in progress.
Build 17040
For general Windows information on build 17040 visit the Windows Blog .
Fixed
WSL
No fixes since 17035.
Console
No fixes since 17035.
LTP Results:
Testing in progress.
Build 17035
For general Windows information on build 17035 visit the Windows Blog .
Fixed
WSL
Accessing files on DrvFs could occasionally fail with EINVAL. [GH 2448]
Console
Build 17025
For general Windows information on build 17025 visit the Windows Blog .
Fixed
WSL
Start initial processes in a new foreground process group [GH 1653, 2510].
SIGHUP delivery fixes [GH 2496].
Generate default virtual bridge name if none provided [GH 2497].
Implement /proc/sys/kernel/random/boot_id [GH 2518].
More interop stdout/stderr pipe fixes.
Stub syncfs system call.
Console
Fix input VT translation for third party consoles [GH 111]
LTP Results:
Testing in progress.
Build 17017
For general Windows information on build 17017 visit the Windows Blog .
Fixed
WSL
Console
No Console related changes in this release.
LTP Results:
Testing in progress.
Build 16288
For general Windows information on build 16288 visit the Windows Blog .
Fixed
WSL
Correctly initialize and report uid, gid, and mode for socket file descriptors [GH
2490]
Additional improvements and bug fixes
Console
LTP Results:
No change since 16273
Build 16278
For general Windows information on build 162738 visit the Windows Blog .
Fixed
WSL
Explicitly unmap mapped views of file backed sections when tearing down LX MM
state [GH 2415]
Additional improvements and bug fixes
Console
No Console related changes in this release.
LTP Results:
No change since 16273
Build 16275
For general Windows information on build 162735 visit the Windows Blog .
Fixed
WSL
Console
No Console related changes in this release.
LTP Results:
No change since 16273
Build 16273
For general Windows information on build 16273 visit the Windows Blog .
Fixed
WSL
Fixed an issue where DrvFs sometimes reported the wrong file type for directories
[GH 2392]
Allow creation of NETLINK_KOBJECT_UEVENT sockets to unblock programs that
use uevent [GH 1121, 2293, 2242, 2295, 2235, 648, 637]
Add support for non-blocking connect [GH 903, 1391, 1584, 1585, 1829, 2290,
2314]
Implement CLONE_FS clone system call flag [GH 2242]
Fix issues around not handling tabs or quotes correctly in NT interop [GH 1625,
2164]
Resolve access denied error when trying to re-launch WSL instances [GH 651,
2095]
Implement futex FUTEX_REQUEUE and FUTEX_CMP_REQUEUE operations [GH
2242]
Fix permissions for various SysFs files [GH 2214]
Fix Haskell stack hang during setup [GH 2290]
Implement binfmt_misc 'C' 'O' and 'P' flags [GH 2103]
Add /proc/sys/kernel /shmmax /shmmni & /threads-max [GH 1753]
Add partial support for ioprio_set system call [GH 498]
Stub SO_REUSEPORT & adding support for SO_PASSCRED for netlink sockets [GH
69]
Return different error codes from RegisterDistribution if a distribution is currently
being installed or uninstalled.
Allow unregistration of partially installed WSL distributions via wslconfig.exe
Fix python socket test hang from udp::msg_peek
Additional improvements and bug fixes
Console
LTP Results:
Total Tests: 1904
Total Skipped Tests: 209
Total Failures: 229
Build 16257
For general Windows information on build 16257 visit the Windows Blog .
Fixed
WSL
Implement prlimit64 system call
Add support for ulimit -n (setrlimit RLIMIT_NOFILE) [GH 1688]
Stub MSG_MORE for TCP sockets [GH 2351]
Fix invalid AT_EXECFN auxiliary vector behavior [GH 2133]
Fix copy/paste behavior for console/tty, and add better full buffer handling [GH
2204, 2131]
Set AT_SECURE in auxiliary vector for set-user-ID and set-group-ID programs [GH
2031]
Pseudo-terminal master endpoint not handling TIOCPGRP [GH 1063]
Fix lseek does to rewind directories in LxFs [GH 2310]
/dev/ptmx locks up after heavy usage [GH 1882]
Additional improvements and bug fixes
Console
LTP Results:
No change since 16251
Syscall Support
Below are a list of new or enhanced syscalls that have some implementation in WSL. The
syscalls on this list are supported in at least one scenario, but may not have all
parameters supported at this time.
prlimit64
Known Issues
In build 16257, WSL has issues when enumerating Windows files/folders via /mnt/c/... .
This issue has been fixed and should be released in Insiders build during week
commencing 8/14/2017.
Build 16251
For general Windows information on build 16251 visit the Windows Blog .
Fixed
WSL
Remove beta tag from WSL optional component, see blog post for details.
Correctly initialize saved-set uid and gid for set-user-ID and set-group-ID binaries
on exec [GH 962, 1415, 2072]
Added support for ptrace PTRACE_O_TRACEEXIT [GH 555]
Added support for ptrace PTRACE_GETFPREGS and PTRACE_GETREGSET with
NT_FPREGSET [GH 555]
Fixed ptrace to stop on ignored signals
Additional improvements and bug fixes
Console
LTP Results:
Number of Passing Tests: 768
Number of Failing Tests: 244
Number of Skipped Tests: 96
Build 16241
For general Windows information on build 16241 visit the Windows Blog .
Fixed
WSL
Console
Fix for outputting the wrong character for the crossing-lines DEC, originally
reported here
Fix for no output text being displayed in codepage 65001 (utf8)
Do not transfer changes made to one color's RGB values to other parts of the
palette on selection change. This will make the console properties sheet a lot
easier to use.
Ctrl+S doesn't appear to work correctly
Un-Bold/-Dim completely absent from ANSI escape codes [GH 2174]
Console doesn't correctly support Vim color themes [GH 1706]
Cannot paste particular characters [GH 2149]
Reflow resize interacts strangely with resizing a bash window when stuff is on the
edit/command line [GH ConEmu 1123]
Ctrl-L leaves the screen dirty [GH 1978]
Console rendering bug when displaying VT on HDPI [GH 1907]
Japanese characters look strange with Unicode Character U+30FB [GH 2146]
Additional improvements and bug fixes
Build 16237
For general Windows information on build 16237 visit the Windows Blog .
Fixed
Use default attributes for files without EAs in lxfs (root, root, 0000)
Added support for distributions that use extended attributes
Fix padding for entries returned by getdents and getdents64
Fix permissions check for the shmctl SHM_STAT system call [GH 2068]
Fixed incorrect initial epoll state for ttys [GH 2231]
Fix DrvFs readdir not returning all entries [GH 2077]
Fix LxFs readdir when files are unlinked [GH 2077]
Allow unlinked drvfs files to be reopened through procfs
Added global registry key override for disabling WSL features (interop / drive
mounting)
Fix incorrect block count in "stat" for DrvFs (and LxFs) [GH 1894]
Additional improvements and bug fixes
Build 16232
For general Windows information on build 16232 visit the Windows Blog .
Fixed
No WSL related changes in this release.
Build 16226
For general Windows information on build 16226 visit the Windows Blog .
Fixed
xattr related syscalls support (getxattr, setxattr, listxattr, removexattr).
security.capability xattr support.
Improved compatibility with certain file systems and filters, including non-MS SMB
servers. [GH #1952]
Improved support for OneDrive placeholders, GVFS placeholders, and Compact OS
compressed files.
Additional improvements and bug fixes
Build 16215
For general Windows information on build 16215 visit the Windows Blog .
Fixed
WSL no longer requires developer mode.
Support directory junctions in drvfs.
Handle uninstalling of WSL distribution appx packages.
Update procfs to show private and shared mappings.
Add ability for wslconfig.exe to clean up distributions that are partially installed or
uninstalled.
Added support for IP_MTU_DISCOVER for TCP sockets. [GH 1639, 2115, 2205]
Infer protocol family for routes to AF_INADDR.
Serial device improvements [GH 1929].
Build 16199
For general Windows information on build 16199 visit the Windows Blog .
Fixed
No WSL related changes in these releases.
Build 16193
For general Windows information on build 16193 visit the Windows Blog .
Fixed
Race condition between sending SIGCONT and a threadgroup terminating [GH
1973]
change tty and pty devices to report FILE_DEVICE_NAMED_PIPE instead of
FILE_DEVICE_CONSOLE [GH 1840]
SSH fix for IP_OPTIONS
Moved DrvFs mounting to init daemon [GH 1862, 1968, 1767, 1933]
Added support in DrvFs for following NT symlinks.
Build 16184
For general Windows information on build 16184 visit the Windows Blog .
Fixed
Removed apt package maintenance task (lxrun.exe /update)
Fixed output not showing up in from Windows processes in node.js [GH 1840]
Relax alignment requirements in lxcore [GH 1794]
Fixed handling of the AT_EMPTY_PATH flag in a numer of system calls.
Fixed issue where deleting DrvFs files with open handles will cause the file to
exhibit undefined behavior [GH 544,966,1357,1535,1615]
/etc/hosts will now inherit entries from the Windows hosts file
(%windir%\system32\drivers\etc\hosts) [GH 1495]
Build 16179
For general Windows information on build 16179 visit the Windows Blog .
Fixed
No WSL changes this week.
Build 16176
For general Windows information on build 16176 visit the Windows Blog .
Fixed
Enabled serial support
Added IP socket option IP_OPTIONS [GH 1116]
Implemented pwritev function (while uploading file to nginx/PHP-FPM) [GH 1506]
Added IP socket options IP_MULTICAST_IF & IPV6_MULTICAST_IF [GH 990]
Support for socket option IP_MULTICAST_LOOP & IPV6_MULTICAST_LOOP [GH
1678]
Added IP(V6)_MTU socket option for apps node, traceroute, dig, nslookup, host
Added IP socket option IPV6_UNICAST_HOPS
Filesystem Improvements
Allow mounting of UNC paths
Enable CDFS support in drvfs
Correctly handle permissions for network file systems in drvfs
Add support for remote drives to drvfs
Enable FAT support in drvfs
Additional fixes and Improvements
LTP Results
No changes since 15042
Build 16170
For general Windows information on build 16170 visit the Windows Blog .
Fixed
Support socket option IP_ADD_MEMBERSHIP & IPV6_ADD_MEMBERSHIP [GH
1678]
Add support for PTRACE_OLDSETOPTIONS. [GH 1692]
Additional fixes and improvements
LTP Results
No changes since 15042
Build 15042
For general Windows information on build 15042 visit the Windows Blog .
Fixed
Fix for a deadlock when removing a path ending in ".."
Fixed an issue where FIONBIO not returning 0 on success [GH 1683]
Fixed issue with zero-length reads of inet datagram sockets
Fix possible deadlock due to race condition in drvfs inode lookup [GH 1675]
Extended support for unix socket ancillary data; SCM_CREDENTIALS and
SCM_RIGHTS [GH 514, 613, 1326]
Additional fixes and improvements
LTP Results:
Number of Passing Test: 737
Number of non-Passing (failing, skipped, etc…): 255
Build 15031
For general Windows information on build 15031 visit the Windows Blog .
Fixed
Fixed a bug where time(2) would sporadically misbehave.
Fixed and issue where *SIGPROCMASK syscalls could corrupt signal mask.
Now return full command line length in WSL process creation notification. [GH
1632]
WSL now reports thread exit through ptrace for GDB hangs. [GH 1196]
Fixed bug where ptys would hang after heavy tmux IO. [GH 1358]
Fixed timeout validation in many system calls (futex, semtimedop, ppoll,
sigtimedwait, itimer, timer_create)
Added eventfd EFD_SEMAPHORE support [GH 452]
Additional fixes and improvements
LTP Results:
Number of Passing Test: 737
Number of non-Passing (failing, skipped, etc…): 255
Build 15025
For general Windows information on build 15025 visit the Windows Blog .
Fixed
Fix for bug that broke grep 2.27 [GH 1578]
Implemented EFD_SEMAPHORE flag for eventfd2 syscall [GH 452]
Implemented /proc/[pid]/net/ipv6_route [GH 1608]
Signal driven IO support for unix stream sockets [GH 393, 68]
Support F_GETPIPE_SZ and F_SETPIPE_SZ [GH 1012]
Implement recvmmsg() syscall [GH 1531]
Fixed bug where epoll_wait() wasn't waiting [GH 1609]
Implement /proc/version_signature
Tee syscall now returns failure if both file descriptors refer to the same pipe
Implemented correct behavior for SO_PEERCRED for Unix sockets
Fixed tkill syscall invalid parameter handling
Changes to increase the performance of drvfs
Minor fix for Ruby IO blocking
Fixed recvmsg() returning EINVAL for the MSG_DONTWAIT flag for inet sockets
[GH 1296]
Additional fixes and improvements
LTP Results:
Number of Passing Test: 732
Number of non-Passing (failing, skipped, etc…): 255
Build 15019
For general Windows information on build 15019 visit the Windows Blog .
Fixed
Fixed bug that incorrectly reported CPU usage in procfs for tools like htop (GH 823,
945, 971)
When calling open() with O_TRUNC on an existing file inotify now generates
IN_MODIFY before IN_OPEN
Fixes to unix socket getsockopt SO_ERROR to enable postgres [GH 61, 1354]
Implement /proc/sys/net/core/somaxconn for the GO language
Apt-get package update background task now runs hidden from view
Clear scope for ipv6 localhost (Spring-Framework(Java) failure).
Additional fixes and improvements
LTP Results:
Number of Passing Test: 714
Number of non-Passing (failing, skipped, etc…): 249
Build 15014
For general Windows information on build 15014 visit the Windows Blog .
Fixed
Ctrl+C now works as intended
htop and ps auxw now show correct resource utilization (GH #516)
Basic translation of NT exceptions to signals. (GH #513)
fallocate now fails with ENOSPC when running out of space instead of EINVAL (GH
#1571)
Added /proc/sys/kernel/sem.
Implemented semop and semtimedop system calls
Fixed nslookup errors with IP_RECVTOS & IPV6_RECVTCLASS socket option (GH 69)
Support for socket options IP_RECVTTL and IPV6_RECVHOPLIMIT
Additional fixes and improvements
LTP Results:
Number of Passing Test: 709
Number of non-Passing (failing, skipped, etc…): 255
Syscall Summary
Total Syscalls: 384
Total Implemented: 235
Total Stubbed: 22
Total Unimplemented: 127
Build 15007
For general Windows information on build 15007 visit the Windows Blog .
Known Issue
There is a known bug where the console does not recognize some Ctrl + <key>
input. This includes the ctrl-c command which will act as a normal 'c' keypress.
Workaround: Map an alternate key to Ctrl+C. For example, to map Ctrl+K to
Ctrl+C do: stty intr \^k . This mapping is per terminal and will have to be
done every time bash is launched. Users can explore the option to include this
in their .bashrc
Fixed
Corrected the issue where running WSL would consume 100% of a CPU core
Socket option IP_PKTINFO, IPV6_RECVPKTINFO now supported. (GH #851, 987)
Truncate network interface physical address to 16 bytes in lxcore (GH #1452, 1414,
1343, 468, 308)
Additional fixes and improvements
LTP Results:
Number of Passing Test: 709
Number of non-Passing (failing, skipped, etc…): 255
Build 15002
For general Windows information on build 15002 visit the Windows Blog .
Known Issue
Two known issues:
There is a known bug where the console does not recognize some Ctrl + <key>
input. This includes the ctrl-c command which will act as a normal 'c' keypress.
Workaround: Map an alternate key to Ctrl+C. For example, to map Ctrl+K to
Ctrl+C do: stty intr \^k . This mapping is per terminal and will have to be
done every time bash is launched. Users can explore the option to include this
in their .bashrc
While WSL is running a system thread will consume 100% of a CPU core. The root
cause has been addressed and fixed internally.
Fixed
All bash sessions must now be created at the same permission level. Attempting to
start a session at a different level will be blocked. This means admin and non-
admin consoles cannot run at the same time. (GH #626)
Implemented the following NETLINK_ROUTE messages (requires Windows admin)
RTM_NEWADDR (supports ip addr add )
RTM_NEWROUTE (supports ip route add )
RTM_DELADDR (supports ip addr del )
RTM_DELROUTE (supports ip route del )
Scheduled task checking for packages to update will no longer run on a metered
connection (GH #1371)
Fixed error where piping gets stuck i.e. bash -c "ls -alR /" | bash -c "cat" (GH #1214)
Implemented TCP_KEEPCNT socket option (GH #843)
Implemented IP_MTU_DISCOVER INET socket option (GH #720, 717, 170, 69)
Removed legacy functionality to run NT binaries from init with NT path lookup.
(GH #1325)
Fix mode of /dev/kmsg to allow group / other read access (0644) (GH #1321)
Implemented /proc/sys/kernel/random/uuid (GH #1092)
Corrected error where process start time was showing as year 2432 (GH #974)
Switched default TERM environment variable to xterm-256color (GH #1446)
Modified the way that process commit is calculated during process fork. (GH
#1286)
Implemented /proc/sys/vm/overcommit_memory. (GH #1286)
Implemented /proc/net/route file (GH #69)
Fixed error where shortcut name was incorrectly localized (GH #696)
Fixed elf parsing logic that is incorrectly validating the program headers must be
less than (or equal to) PATH_MAX. (GH #1048)
Implemented statfs callback for procfs, sysfs, cgroupfs, and binfmtfs (GH #1378)
Fixed AptPackageIndexUpdate windows that won't close (GH #1184, also discussed
in GH #1193)
Added ASLR personality ADDR_NO_RANDOMIZE support. (GH #1148, 1128)
Improved PTRACE_GETSIGINFO, SIGSEGV, for proper gdb stack traces during AV
(GH #875)
Elf parsing no longer fails for patchelf binaries. (GH #471)
VPN DNS propagated to /etc/resolv.conf (GH #416, 1350)
Improvements to TCP close for more reliable data transfer. (GH #610, 616, 1025,
1335)
Now return correct error code when too many files are opened (EMFILE). (GH
#1126, 2090)
Windows Audit log now reports the image name in process create audit.
Now gracefully fail when launching bash.exe from within a bash window
Added error message when interop is unable to access a working directory under
LxFs (i.e. notepad.exe .bashrc)
Fixed issue where Windows path was truncated in WSL
Additional fixes and improvements
LTP Results:
Number of Passing Test: 690
Number of non-Passing (failing, skipped, etc…): 274
Syscall Support
Below are a list of new or enhanced syscalls that have some implementation in WSL. The
syscalls on this list are supported in at least one scenario, but may not have all
parameters supported at this time.
shmctl
shmget
shmdt
shmat
Build 14986
For general Windows information on build 14986 visit the Windows Blog .
Fixed
Fixed bugchecks with Netlink and Pty IOCTLs
Kernel version now reports 4.4.0-43 for consistency with Xenial
Bash.exe now launches when input directed to 'nul:' (GH #1259)
Thread IDs now reported correctly in procfs (GH #967)
IN_UNMOUNT | IN_Q_OVERFLOW | IN_IGNORED | IN_ISDIR flags now supported in
inotify_add_watch() (GH #1280)
Implement timer_create and related system calls. This enables GHC support (GH
#307)
Fixed issue where ping returned a time of 0.000ms (GH #1296)
Return correct error code when too many files are opened.
Fixed issue in WSL where Netlink request for network interface data would fail with
EINVAL if the interface's hardware address is 32-bytes (such as the Teredo
interface)
Note that the Linux "ip" utility contains a bug where it will crash if WSL reports a
32-byte hardware address. This is a bug in "ip", not WSL. The "ip" utility hard-
codes the length of the string buffer used to print the hardware address, and
that buffer is too small to print a 32-byte hardware address.
Additional fixes and improvements
LTP Results:
Number of Passing Test: 669
Number of non-Passing (failing, skipped, etc…): 258
Syscall Support
Below are a list of new or enhanced syscalls that have some implementation in WSL. The
syscalls on this list are supported in at least one scenario, but may not have all
parameters supported at this time.
timer_create
timer_delete
timer_gettime
timer_settime
Build 14971
For general Windows information on build 14971 visit the Windows Blog .
Fixed
Due to circumstances beyond our control there are no updates in this build for the
Windows Subsystem for Linux. Regularly scheduled updates will resume on the
next release.
LTP Results:
Unchanged from 14965
Number of Passing Test: 664
Number of non-Passing (failing, skipped, etc…): 263
Build 14965
For general Windows information on build 14965 visit the Windows Blog .
Fixed
Support for Netlink sockets NETLINK_ROUTE protocol's RTM_GETLINK and
RTM_GETADDR (GH #468)
Enables ifconfig and ip commands for network enumeration
NT user path now appended to the WSL path by default (i.e. you can now type
notepad.exe without adding System32 to the Linux path)
Fixed error where piping gets stuck i.e. bash -c "ls -alR /" | bash -c "cat" (GH #1214)
Fix ELF validation logic which incorrectly assumes interpreter paths must be less
than 64 characters long. (GH #743)
Open file descriptors can keep console window open (GH #1187)
Fixed error where rename() failed with trailing slash on target name (GH #1008)
LTP Results:
Number of Passing Test: 664
Number of non-Passing (failing, skipped, etc…): 263
Build 14959
For general Windows information on build 14959 visit the Windows Blog .
Fixed
Improved Pico Process notification for Windows. Additional information found on
the WSL Blog.
Improved stability with Windows interoperability
Fixed error 0x80070057 when launching bash.exe when Enterprise Data Protection
(EDP) is enabled
Additional bugfixes and improvements
LTP Results:
Number of Passing Test: 665
Number of non-Passing (failing, skipped, etc…): 263
Build 14955
For general Windows information on build 14955 visit the Windows Blog .
Fixed
Due to circumstances beyond our control there are no updates in this build for the
Windows Subsystem for Linux. Regularly scheduled updates will resume on the
next release.
LTP Results:
Number of Passing Test: 665
Number of non-Passing (failing, skipped, etc…): 263
Build 14951
For general Windows information on build 14951 visit the Windows Blog .
$ export PATH=$PATH:/mnt/c/Windows/System32
$ notepad.exe
$ ipconfig.exe | grep IPv4 | cut -d: -f2
$ ls -la | findstr.exe foo.txt
$ cmd.exe /c dir
Fixed
Ubuntu 16.04 (Xenial) is now installed for all new WSL instances. Users with
existing 14.04 (Trusty) instances will not be automatically upgraded.
Locale set during install is now displayed
Terminal improvements including bug where redirecting a WSL process to a file
does not always work
Console lifetime should be tied to bash.exe lifetime
Console window size should use visible size, not buffer size
Additional bugfixes and improvements
LTP Results:
Number of Passing Test: 665
Number of non-Passing (failing, skipped, etc…): 263
Build 14946
For general Windows information on build 14946 visit the Windows Blog .
Fixed
Fixed an issue that prevented creating WSL user accounts for users with NT
usernames that contain spaces or quotes.
Change VolFs and DrvFs to return 0 for directory's link count in stat
DrvFs now appears in mountinfo with a name that matches mounted Windows
volume
LTP Results:
Number of Passing Test: 665
Number of non-Passing (failing, skipped, etc…): 263
Build 14942
For general Windows information on build 14942 visit the Windows Blog .
Fixed
A number of bugchecks addressed, including the "ATTEMPTED EXECUTE OF
NOEXECUTE MEMORY" networking crash which was blocking SSH
inotify support for notifications generated from Windows applications on DrvFs is
now in
Implement TCP_KEEPIDLE and TCP_KEEPINTVL for mongod. (GH #695)
Implement the pivot_root system call
Implement socket option for SO_DONTROUTE
Additional bugfixes and improvements
LTP Results:
Number of Passing Test: 665
Number of non-Passing (failing, skipped, etc…): 263
Syscall Support
Below are a list of new or enhanced syscalls that have some implementation in WSL. The
syscalls on this list are supported in at least one scenario, but may not have all
parameters supported at this time.
pivot_root
Build 14936
For general Windows information on build 14936 visit the Windows Blog .
Note: WSL will install Ubuntu version 16.04 (Xenial) instead of Ubuntu 14.04 (Trusty) in
an upcoming release. This change will apply to Insiders installing new instances
(lxrun.exe /install or first run of bash.exe). Existing instances with Trusty will not be
upgraded automatically. Users can upgrade their Trusty image to Xenial using the do-
release-upgrade command.
Known Issue
WSL is experiencing an issue with some socket implementations. The bugcheck
manifests itself as a crash with the error "ATTEMPTED EXECUTE OF NOEXECUTE
MEMORY". The most common manifestation of this issue is a crash when using ssh. The
root cause is fixed on internal builds and will be pushed to Insiders at the earliest
opportunity.
Fixed
Implemented the chroot system call
Improvements in inotify including support for notifications generated from
Windows applications on DrvFs
Correction: Inotify support for changes originating from Windows applications
not available at this time.
Socket binding to IPV6::<port n> now supports IPV6_V6ONLY (GH #68, #157, #393,
#460, #674, #740, #982, #996)
WNOWAIT behavior for waitid systemcall implemented (GH #638)
Support for IP socket options IP_HDRINCL and IP_TTL
Zero-length read() should return immediately (GH #975)
Correctly handle filenames and filename prefixes that don't include a NULL
terminator in a .tar file.
epoll support for /dev/null
Fix /dev/alarm time source
Bash -c now able to redirect to a file
Additional bugfixes and improvements
LTP Results:
Number of Passing Test: 664
Number of non-Passing (failing, skipped, etc…): 264
Syscall Support
Below are a list of new or enhanced syscalls that have some implementation in WSL. The
syscalls on this list are supported in at least one scenario, but may not have all
parameters supported at this time.
chroot
Build 14931
For general Windows information on build 14931 visit the Windows Blog .
Fixed
Due to circumstances beyond our control there are no updates in this build for the
Windows Subsystem for Linux. Regularly scheduled updates will resume in the next
release.
Build 14926
For general Windows information on build 14926 visit the Windows Blog .
Fixed
Ping now works in consoles which do not have administrator privileges
Ping6 now supported, also without administrator privileges
Inotify support for files modified through WSL. (GH #216)
Flags supported:
inotify_init1: LX_O_CLOEXEC, LX_O_NONBLOCK
inotify_add_watch events: LX_IN_ACCESS, LX_IN_MODIFY, LX_IN_ATTRIB,
LX_IN_CLOSE_WRITE, LX_IN_CLOSE_NOWRITE, LX_IN_OPEN,
LX_IN_MOVED_FROM, LX_IN_MOVED_TO, LX_IN_CREATE, LX_IN_DELETE,
LX_IN_DELETE_SELF, LX_IN_MOVE_SELF
inotify_add_watch attributes: LX_IN_DONT_FOLLOW, LX_IN_EXCL_UNLINK,
LX_IN_MASK_ADD, LX_IN_ONESHOT, LX_IN_ONLYDIR
read output: LX_IN_ISDIR, LX_IN_IGNORED
Known issue: Modifying files from Windows applications does not generate any
events
Unix socket now supports SCM_CREDENTIALS
LTP Results:
Number of Passing Test: 651
Number of non-Passing (failing, skipped, etc…): 258
Build 14915
For general Windows information on build 14915 visit the Windows Blog .
Fixed
Socketpair for unix datagram sockets (GH #262)
Unix socket support for SO_REUSEADDR
UNIX socket support for SO_BROADCAST (GH #568)
Unix socket support for SOCK_SEQPACKET (GH #758, #546)
Adding support for unix datagram socket send, recv and shutdown
Fix bugcheck due to invalid mmap parameter validation for non-fixed addresses.
(GH #847)
Support for suspend / resume of terminal states
Support for TIOCPKT ioctl to unblock the Screen utility (GH #774)
Known issue: Function keys not operational
Corrected a race in TimerFd that could cause a freed member 'ReaderReady' to be
accessed by LxpTimerFdWorkerRoutine (GH #814)
Enable restartable system call support for futex, poll, and clock_nanosleep
Added bind mount support
unshare for mount namespace support
Known issue: When creating a new mount namespace with
unshare(CLONE_NEWNS) the current working directory will continue to point to the
old namespace
Additional improvements and bug fixes
Build 14905
For general Windows information on build 14905 visit the Windows Blog .
Fixed
Restartable system calls are now supported (GH #349, GH #520)
Symlinks to directories ending in / now operational (GH #650)
Implemented RNDGETENTCNT ioctl for /dev/random
Implemented the /proc/[pid]/mounts, /proc/[pid]/mountinfo and
/proc/[pid]/mountstats files
Additional bugfixes and improvements
Build 14901
First Insider build for the post Windows 10 Anniversary Update release.
For general Windows information on build 14901 visit the Windows Blog .
Fixed
Fixed trailing slash issue
Commands such as $ mv a/c/ a/b/ now work
Installing now prompts if Ubuntu locale should be set to Windows locale
Procfs support for ns folder
Added mount and unmount for tmpfs, procfs and sysfs file systems
Fix mknod[at] 32-bit ABI signature
Unix sockets moved to dispatch model
INET socket recv buffer size set using the setsockopt should be honored
Implement MSG_CMSG_CLOEXEC unix socket receive message flag
Linux process stdin/stdout pipe redirection (GH #2)
Allows for piping of bash -c commands in CMD. Example: >dir | bash -c "grep
foo"
Bash can now be installed on systems with multiple pagefiles (GH #538, #358)
Default INET Socket buffer size should match that of default Ubuntu setup
Align xattr syscalls to listxattr
Only return interfaces with a valid IPv4 address from SIOCGIFCONF
Fix signal default action when injected by ptrace
implement /proc/sys/vm/min_free_kbytes
Use machine context register values when restoring context in sigreturn
This resolves the issue where java and javac were hanging for some users
Implement /proc/sys/kernel/hostname
Syscall Support
Below are a list of new or enhanced syscalls that have some implementation in WSL. The
syscalls on this list are supported in at least one scenario, but may not have all
parameters supported at this time.
waitid
epoll_pwait
Fixed
Fixes to prepare for the Windows 10 Anniversary Update on 8/2
More information about WSL in the Anniversary Update can be found on our
blog
Build 14376
For general Windows information on build 14376 visit the Windows Blog .
Fixed
Removed some instances where apt-get hangs (GH #493)
Fixed an issue where empty mounts were not handled correctly
Fixed an issue where ramdisks were not mounted correctly
Change unix socket accept to support flags (partial GH #451)
Fixed common network related bluescreen
Fixed bluescreen when accessing /proc/[pid]/task (GH #523)
Fixed high CPU utilization for some pty scenarios (GH #488, #504)
Additional bugfixes and improvements
Build 14371
For general Windows information on build 14371 visit the Windows Blog .
Fixed
Corrected timing race with SIGCHLD and wait() when using ptrace
Corrected some behavior when paths have a trailing / (GH #432)
Fixed issue with rename/unlink failing due to open handles to children
Additional bugfixes and improvements
Build 14366
For general Windows information on build 14366 visit the Windows Blog .
Fixed
Fix in file creation through symlinks
Added listxattr for Python (GH 385)
Additional bugfixes and improvements
Syscall Support
Below are a list of new or enhanced syscalls that have some implementation in
WSL. The syscalls on this list are supported in at least one scenario, but may not
have all parameters supported at this time.
listxattr
Build 14361
For general Windows information on build 14361 visit the Windows Blog .
Fixed
DrvFs is now case sensitive when running in Bash on Ubuntu on Windows.
Users may case.txt and CASE.TXT on their /mnt/c drives
Case sensitivity is only supported within Bash on Ubuntu on Windows. When
outside of Bash NTFS will report the files correctly, but unexpected behavior
may occur interacting with the files from Windows.
The root of each volume (i.e. /mnt/c) is not case sensitive
More information on handling these files in Windows can be found here.
Greatly enhanced pty / tty support. Applications like TMUX now supported (GH
#40)
Fixed install issue where user accounts not always created
Optimized command line arg structure allowing for extremely long argument list.
(GH #153)
Now able to delete and chmod read_only files from DrvFs
Fixed some instances where the terminal hangs on disconnect (GH #43)
chmod and chown now work on tty devices
Allow connection to 0.0.0.0 and :: as localhost (GH #388)
Sendmsg/recvmsg now handle an IO vector length of >1 (partial GH #376)
Users can now opt-out of auto-generated hosts file (GH #398)
Automatically match Linux locale to the NT locale during install (GH #11)
Added the /proc/sys/vm/swappiness file (GH #306)
strace now exits correctly
Allow pipes to be reopened through /proc/self/fd (GH #222)
Hide directories under %LOCALAPPDATA%\lxss from DrvFs (GH #270)
Better handling of bash.exe ~. Commands like "bash ~ -c ls" now supported (GH
#467)
Sockets now notify epoll read available during shutdown (GH #271)
lxrun /uninstall does a better job of deleting the files and folders
Corrected ps -f (GH #246)
Improved support for x11 apps such as xEmacs (GH #481)
Updated initial thread stack size to match default Ubuntu setting and reporting the
size correctly to the get_rlimit syscall (GH #172, #258)
Improved reporting of pico process image names (e.g., for auditing)
Implemented /proc/mountinfo for df command
Fixed symlink error code for child name . and ..
Additional improvements bugfixes and improvements
Syscall Support
Below are a list of new or enhanced syscalls that have some implementation in WSL. The
syscalls on this list are supported in at least one scenario, but may not have all
parameters supported at this time.
GETTIMER
MKNODAT
RENAMEAT
SENDFILE
SENDFILE64
SYNC_FILE_RANGE
Build 14352
For general Windows information on build 14352 visit the Windows Blog .
Fixed
Fixed issue where large files were not downloaded / created correctly. This should
unblock npm and other scenarios (GH #3, GH #313)
Removed some instances where sockets hang
Corrected some ptrace errors
Fixed issue with WSL allowing filenames longer than 255 characters
Improved support for non-English characters
Add current Windows timezone data and set as default
Unique device id's for each mount point (jre fix – GH #49)
Correct issue with paths containing "." and ".."
Added Fifo support (GH #71)
Updated format of resolv.conf to match native Ubuntu format
Some procfs cleanup
Enabled ping for Administrator consoles (GH #18)
Syscall Support
Below are a list of new or enhanced syscalls that have some implementation in WSL. The
syscalls on this list are supported in at least one scenario, but may not have all
parameters supported at this time.
FALLOCATE
EXECVE
LGETXATTR
FGETXATTR
Build 14342
For general Windows information on build 14342 the Windows Blog .
Fixed
Fixed install issue when the Windows user had Unicode characters in the username
The apt-get update udev workaround in the FAQ is now provided by default on
first run
Enabled symlinks in DriveFs ( /mnt/<drive> ) directories
Symlinks now work between DriveFs and VolFs
Addressed top level path parsing issue: ls .// will now work as expected
npm install on DriveFs and the -g options are now working
Fixed issue preventing PHP server from launching
Updated default environment values, such as $PATH to closer match native Ubuntu
Added a weekly maintenance task in Windows to update the apt package cache
Fixed issue with ELF header validation, WSL now supports all Melkor options
Zsh shell is functional
Precompiled Go binaries are now supported
Prompting on Bash.exe first run is now localized correctly
/proc/meminfo now returns correct information
Sockets now supported in VFS
/dev now mounted as tempfs
Fifo now supported
Multi-core systems now showing correctly in /proc/cpuinfo
Additional improvements and error messages downloading during first run
Syscall improvements and bugfixes. Supported syscall list below.
Additional bugfixes and improvements
Known Issues
Not resolving '..' correctly on DriveFs in some cases
Syscall Support
Below are a list of new or enhanced syscalls that have some implementation in WSL. The
syscalls on this list are supported in at least one scenario, but may not have all
parameters supported at this time.
FCHOWNAT
GETEUID
GETGID
GETRESUID
GETXATTR
PTRACE
SETGID
SETGROUPS
SETHOSTNAME
SETXATTR
Build 14332
For general Windows information on build 14332 visit the Windows Blog .
Fixed
Better resolv.conf generation including prioritizing DNS entries
Issue with moving files and directories between /mnt and non-/mnt drives
Tar files can now be created with symlinks
Added default /run/lock directory on instance creation
Update /dev/null to return proper stat info
Additional errors when downloading during first run
Syscall improvements and bugfixes. Supported syscall list below.
Additional improvements bugfixes and improvements
Syscall Support
Below is the new syscall that has some implementation in WSL. The syscall on this list is
supported in at least one scenario, but may not have all parameters supported at this
time.
READLINKAT
Build 14328
For general Windows information on build 14332 visit the Windows Blog .
New Features
Now support Linux users. Installing Bash on Ubuntu on Windows will prompt for
creation of a Linux user. For more information, visit https://aka.ms/wslusers
Hostname is now set to the Windows computer name, no more @localhost
For more information on build 14328, visit: https://aka.ms/wip14328
Fixed
Symlink improvements for non /mnt/<drive> files
npm install now works
jdk / jre now installable using instructions found here .
known issue: symlinks do not work for Windows mounts. Functionality will be
available in a later build
top and htop now display
Additional error messages for some install failures
Syscall improvements and bugfixes. Supported syscall list below.
Additional improvements bugfixes and improvements
Syscall Support
Below is a list of syscalls that have some implementation in WSL. Syscalls on this list are
supported in at least one scenario, but may not have all parameters supported at this
time.
ACCEPT
ACCEPT4
ACCESS
ALARM
ARCH_PRCTL
BIND
BRK
CAPGET
CAPSET
CHDIR
CHMOD
CHOWN
CLOCK_GETRES
CLOCK_GETTIME
CLOCK_NANOSLEEP
CLONE
CLOSE
CONNECT
CREAT
DUP
DUP2
DUP3
EPOLL_CREATE
EPOLL_CREATE1
EPOLL_CTL
EPOLL_WAIT
EVENTFD
EVENTFD2
EXECVE
EXIT
EXIT_GROUP
FACCESSAT
FADVISE64
FCHDIR
FCHMOD
FCHMODAT
FCHOWN
FCHOWNAT
FCNTL64
FDATASYNC
FLOCK
FORK
FSETXATTR
FSTAT64
FSTATAT64
FSTATFS64
FSYNC
FTRUNCATE
FTRUNCATE64
FUTEX
GETCPU
GETCWD
GETDENTS
GETDENTS64
GETEGID
GETEGID16
GETEUID
GETEUID16
GETGID
GETGID16
GETGROUPS
GETPEERNAME
GETPGID
GETPGRP
GETPID
GETPPID
GETPRIORITY
GETRESGID
GETRESGID16
GETRESUID
GETRESUID16
GETRLIMIT
GETRUSAGE
GETSID
GETSOCKNAME
GETSOCKOPT
GETTID
GETTIMEOFDAY
GETUID
GETUID16
GETXATTR
GET_ROBUST_LIST
GET_THREAD_AREA
INOTIFY_ADD_WATCH
INOTIFY_INIT
INOTIFY_RM_WATCH
IOCTL
IOPRIO_GET
IOPRIO_SET
KEYCTL
KILL
LCHOWN
LINK
LINKAT
LISTEN
LLSEEK
LSEEK
LSTAT64
MADVISE
MKDIR
MKDIRAT
MKNOD
MLOCK
MMAP
MMAP2
MOUNT
MPROTECT
MREMAP
MSYNC
MUNLOCK
MUNMAP
NANOSLEEP
NEWUNAME
OPEN
OPENAT
PAUSE
PERF_EVENT_OPEN
PERSONALITY
PIPE
PIPE2
POLL
PPOLL
PRCTL
PREAD64
PROCESS_VM_READV
PROCESS_VM_WRITEV
PSELECT6
PTRACE
PWRITE64
READ
READLINK
READV
REBOOT
RECV
RECVFROM
RECVMSG
RENAME
RMDIR
RT_SIGACTION
RT_SIGPENDING
RT_SIGPROCMASK
RT_SIGRETURN
RT_SIGSUSPEND
RT_SIGTIMEDWAIT
SCHED_GETAFFINITY
SCHED_GETPARAM
SCHED_GETSCHEDULER
SCHED_GET_PRIORITY_MAX
SCHED_GET_PRIORITY_MIN
SCHED_SETAFFINITY
SCHED_SETPARAM
SCHED_SETSCHEDULER
SCHED_YIELD
SELECT
SEND
SENDMMSG
SENDMSG
SENDTO
SETDOMAINNAME
SETGID
SETGROUPS
SETHOSTNAME
SETITIMER
SETPGID
SETPRIORITY
SETREGID
SETRESGID
SETRESUID
SETREUID
SETRLIMIT
SETSID
SETSOCKOPT
SETTIMEOFDAY
SETUID
SETXATTR
SET_ROBUST_LIST
SET_THREAD_AREA
SET_TID_ADDRESS
SHUTDOWN
SIGACTION
SIGALTSTACK
SIGPENDING
SIGPROCMASK
SIGRETURN
SIGSUSPEND
SOCKET
SOCKETCALL
SOCKETPAIR
SPLICE
STAT64
STATFS64
SYMLINK
SYMLINKAT
SYNC
SYSINFO
TEE
TGKILL
TIME
TIMERFD_CREATE
TIMERFD_GETTIME
TIMERFD_SETTIME
TIMES
TKILL
TRUNCATE
TRUNCATE64
UMASK
UMOUNT
UMOUNT2
UNLINK
UNLINKAT
UNSHARE
UTIME
UTIMENSAT
UTIMES
VFORK
WAIT4
WAITPID
WRITE
WRITEV
Release Notes for Windows Subsystem
for Linux kernel
Article • 08/19/2022
We've added support for WSL 2 distributions, which use a full Linux kernel . This Linux
kernel is open source, with its source code available at the WSL2-Linux-Kernel
repository. This Linux kernel is delivered to your machine via Microsoft Update, and
follows a separate release schedule to the Windows Subsystem for Linux which is
delivered as part of the Windows image.
5.15.57.1
Release Date: Prerelease 2022/08/02
Initial release of the WSL2 kernel based on the v5.15 kernel series
Release rolling-lts/wsl/5.15.57.1
Update to stable kernel version v5.15.57
Enable Retbleed mitigations in x86_64 builds
Enable nftables and traffic control
Enable VGEM driver
Fix 9p filesystem regressions since the last v5.10 WSL2 kernel
Enable support for the Precision Time Protocol (PTP) clock device
Enable the Landlock Linux Security Module (LSM)
https://landlock.io/
Enable the Miscellaneous Control Group (CGroup)
https://www.kernel.org/doc/html/v5.15/admin-guide/cgroup-v2.html#misc
Disable support for the Ceph Distributed File System
5.10.102.1
Release Date: Prerelease 2022/05/09
Release rolling-lts/wsl/5.10.102.1
Update to upstream stable kernel release 5.10.102
Disable unprivileged BPF by default
It can be re-enabled by setting the kernel.unprivileged_bpf_disabled sysctl to 0
Update Dxgkrnl Version to 2216
Fix out of bounds array access for ioctls[]
Implement wait for sync VM bus messages as “killable” to allow killing a process
waiting for a synchronous call to the host
Flush device for termination when process is destroyed to avoid a deadlock when
the guest process is killed
5.10.93.2
Release Date: Prerelease 2022/02/08
Release rolling-lts/wsl/5.10.93.2
Update to upstream stable kernel release 5.10.93
Enable CH341 and CP210X USB Serial drivers
Fix README.md build instructions to include dwarves dependency for pahole
Switched Dxgkrnl Version to 2111
Removed the limit of existing and total sysmem allocations
Properly flush the device for termination during process cleanup
Fixed SPDX-License-Identifier for d3dkmthk.h
5.10.81.1
Release Date: Prerelease 2022/02/01
Release rolling-lts/wsl/5.10.81.1
Update to upstream stable kernel release 5.10.81
Unify the kernel configurations by enabling missing options on arm64
Enable non-arch specific ACPI options
Enable options related to device-mapper RAID
Enable Btrfs
Enable LZO and ZSTD compression
5.10.74.3
Release Date: Prerelease 2021/11/10
5.10.60.1
Release Date: 2021/11/02 ( Prerelease 2021/10/05 )
Release rolling-lts/wsl/5.10.60.1
Update to upstream stable kernel release 5.10.60
Enable virtio-pmem with support for PCI BAR-relative addresses
Enable vPCI support under Hyper-V for arm64
Enable io_uring support
Enable USB over IP support
Enable paravirtualized spinlock support for x86_64
Refresh dxgkrnl driver to pick up bug fixes and code cleanups
Enable NFS client support for NFSv4.1
Enable USB kernel configuration options for interacting with an Arduino over USB
Provide a WSL2-specific README.md
5.10.43.3
Release Date: Prerelease 2021/07/12
Version rolling-lts/wsl/5.10.43.3
Update to upstream stable kernel release 5.10.43
Improved dxgkrnl driver
New revision of arm64 Linux on Hyper-V series (v9)
Always use the Hyper-V hypercall interface on arm64 guests to support running on
all versions of Windows
5.10.16.3
Release Date: 2021/07/20 ( Prerelease 2021/04/16 )
Fixes GH 5324
Adds support for LUKS encrypted disks using wsl --mount
5.4.91
Release Date: Prerelease 2021/02/22
5.4.72
Release Date: 2021/01/21
5.4.51-microsoft-standard
Release Date: Prerelease - 2020/10/22
4.19.128-microsoft-standard
Release Date: 2020/09/15
4.19.121-microsoft-standard
Release Date: Prerelease
4.19.104-microsoft-standard
Release Date: 2020/06/09
4.19.84-microsoft-standard
Release Date: 2019/12/11
The release notes for WSL inside of the Microsoft Store can be found on the
Microsoft/WSL Github repository releases page . Please see that list for latest updates.
Known Issues:
Launching Windows Subsystem for Linux from session zero does not currently
work (for example from an ssh connection).