You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Final editorial review update (#2063)
Fix oobe delete user path
Rename best practices to recommendations
Minor writing style updates
* Fix backtick in build-custom-distro.md (#2062)
* Remove the duplicate `feedback_product_url` value (#2040)
* Update troubleshooting.md (#2034)
Azure virtual machine does support Nested Virtualization, but cannot use with Trusted Launch. Hence proposing minor correction.
* Update networking.md (#2033)
Updated that the hostname takes a lowercase -i as the address flag. This can be seen by running hostname --help. also made the "under the hood" section more verbose with the full length ip-address command.
* Add the information about the --pre-release option (#2031)
* Add note for blocked Microsoft Store (#2030)
* Add note for blocked Microsoft Store
* Editorial update
---------
Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com>
* Add rule to ignore service account's contribute (#2039)
* Update WSL shutdown instructions for clarity by specifying PowerShell should be run as administrator before executing the shutdown command. (#2028)
* Update WSL shutdown instructions for clarity by specifying PowerShell should be run as administrator before executing the shutdown command.
* Add Docker Desktop error recommendation
---------
Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com>
* Fix warnings (#2065)
* Fix pytorch directml install command (#2066)
Resolves#2044
* Add documentation for shortcut.enabled and windowsterminal.enabled (#2076)
* Add documentation for shortcut.enabled and windowsterminal.enabled
* Small fixes
* chore: update wsl config docs (#2087)
WSL default behaviour changed as of May 2024
* Put the whole command in a block (#2071)
* Put the whole command in a block
Without this change, the command gets inline and breaks at the beginning, confusing the reader, making them think the command begins by route instead of ip
* Update WSL/networking.md
---------
Co-authored-by: Craig Loewen <crloewen@microsoft.com>
* Fix `contributors_to_exclude` did not work (#2068)
* make sure the systemd-sysv package is installed (#1996)
* make sure the systemd-sysv package is installed
* Update WSL/systemd.md
---------
Co-authored-by: Craig Loewen <crloewen@microsoft.com>
* WSL/wsl-config.md: rewrite lead for clarity (#2021)
* WSL/wsl-config.md: rewrite lead for clarity
This is a rewrite of the lead section, as I feel the previous one was long-winded yet did not meaningfully summarize the most important points of the article.
* Minor changes to this table format update
---------
Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com>
* Fixed typos (#2092)
* Update wsl-database.md (#2096)
* Update wsl-database.md
Update the Microsoft SQL Server installation link to SQL Server on WSL 2
* Updated to fix link and streamline title.
---------
Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com>
* Update systemd.md (#2102)
* Update systemd.md
State that `wsl --version` command could throws an error if outdated and therefore it must be updated to make systemd working on the distribution.
* Update formatting
---------
Co-authored-by: Matt Wojciakowski <mattwoj@microsoft.com>
* add section for wsl manage (#2107)
* Update disk space expand command format (#2121)
* Fix typo in troubleshooting.md (#2114)
* Add platform id to feedback template
* add kernelModules documentation (#2145)
---------
Co-authored-by: Carlos Nihelton <carlosnsoliveira@gmail.com>
Co-authored-by: Caozhi Li <git@licaoz.com>
Co-authored-by: thiruma0203 <thiruma.msft@hotmail.com>
Co-authored-by: Horsevad <Horsevad@users.noreply.github.com>
Co-authored-by: Carlos Rafael Ramirez <crramirez@users.noreply.github.com>
Co-authored-by: Chunyao Chan <24861096+Civon@users.noreply.github.com>
Co-authored-by: Blue <OneBlue@users.noreply.github.com>
Co-authored-by: alsi-lawr <alexlawrence1418@gmail.com>
Co-authored-by: Craig Loewen <crloewen@microsoft.com>
Co-authored-by: Zhoneym <140673973+Zhoneym@users.noreply.github.com>
Co-authored-by: multiplealiases <conflictvegetable@protonmail.com>
Co-authored-by: Lucas Dondo / Dondi <59975541+LucasDondo@users.noreply.github.com>
Co-authored-by: Amit Khandelwal <119350246+amitkh-msft@users.noreply.github.com>
Co-authored-by: Federico C. <24813315+fcucino@users.noreply.github.com>
Co-authored-by: justus-camp-microsoft <campjustus@microsoft.com>
Co-authored-by: Ally Zhang <931550270@qq.com>
Co-authored-by: John Kennedy <jken@microsoft.com>
@@ -63,6 +65,9 @@ WSL distribution file configuration options:
63
65
|`oobe.defaultUid`| integer |`<none>`| The default UID that the distribution starts with. This is useful when the `oobe.command` script creates a new user. |
64
66
|`oobe.defaultName`| string |`<none>`| The default name that the distribution is registered under. This default name can be replaced with the command: `wsl.exe --install <distro> --name <name>`|
65
67
|`shortcut.icon`| string | The default WSL icon | The icon in the start menu shortcut for the distribution. Must be in `.ico` format with a maximum size of `10MB`|
68
+
|`shortcut.enabled`| boolean | true | Whether a start menu shortcut should be created when the distribution is installed. |
69
+
|`windowsterminal.profileTemplate`| string |`<none>`| The JSON template to generate a Windows Terminal profile for this distribution. |
70
+
|`windowsterminal.enabled`| boolean | true | Whether a terminal profile should be created when the distribution is installed. If `profileTemplate` is not set, a default profile will be generated. |
66
71
|`windowsterminal.profileTemplate`| string | Path to a terminal template file | The JSON template to generate a Windows Terminal profile for this distribution. |
67
72
68
73
You need to create an out of box experience (OOBE) first run experience for the distribution. Below is a sample bash script that you can use. This script assumes that `oobe.defaultUid` is set to `1000`:
Copy file name to clipboardExpand all lines: WSL/compare-versions.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,25 +54,25 @@ WSL 2 provides the benefits of WSL 1, including seamless integration between Win
54
54
55
55
### Full Linux kernel
56
56
57
-
The Linux kernel in WSL 2 is built by Microsoft from the latest stable branch, based on the source available at kernel.org. This kernel has been specially tuned for WSL 2, optimizing for size and performance to provide an amazing Linux experience on Windows. The kernel will be serviced by Windows updates, which means you will get the latest security fixes and kernel improvements without needing to manage it yourself.
57
+
The Linux kernel in WSL 2 is built by Microsoft from the latest stable branch, based on the source available at [kernel.org](https://kernel.org). This kernel has been specially tuned for WSL 2, optimizing for size and performance to provide an amazing Linux experience on Windows. The kernel will be serviced by Windows updates, which means you will get the latest security fixes and kernel improvements without needing to manage it yourself.
58
58
59
59
The [WSL 2 Linux kernel is open source](https://github.com/microsoft/WSL2-Linux-Kernel). If you'd like to learn more, check out the blog post [Shipping a Linux Kernel with Windows](https://devblogs.microsoft.com/commandline/shipping-a-linux-kernel-with-windows/) written by the team that built it.
60
60
61
61
Learn more in the [Release Notes for Windows Subsystem for Linux kernel](./kernel-release-notes.md).
62
62
63
63
### Increased file IO performance
64
64
65
-
File intensive operations likegit clone, npm install, apt update, apt upgrade, and more are all noticeably faster with WSL 2.
65
+
File intensive operations like`git clone`, `npm install`, `apt update`, `apt upgrade`, and more are all noticeably faster with WSL 2.
66
66
67
-
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.
67
+
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.
68
68
69
69
### Full system call compatibility
70
70
71
71
Linux binaries use system calls to perform functions such as accessing files, requesting memory, creating processes, and more. Whereas WSL 1 used a translation layer that was built by the WSL team, WSL 2 includes its own Linux kernel with full system call compatibility. Benefits include:
72
72
73
73
- A whole new set of apps that you can run inside of WSL, such as **[Docker](tutorials/wsl-containers.md)** and more.
74
74
75
-
- 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).
75
+
- 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).
76
76
77
77
## Exceptions for using WSL 1 rather than WSL 2
78
78
@@ -82,21 +82,21 @@ We recommend that you use WSL 2 as it offers faster performance and 100% system
82
82
- 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.
83
83
- A project which requires cross-compilation using both Windows and Linux tools on the same files.
84
84
- 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.
85
-
- 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](./connect-usb.md) for set up steps.
85
+
- 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](./connect-usb.md) for set up steps.
86
86
- WSL 2 does not include support for accessing serial ports. Learn more in the [FAQs](./faq.yml#can-i-access-the-gpu-in-wsl-2--are-there-plans-to-increase-hardware-support-) or in [WSL GitHub repo issue on serial support](https://github.com/microsoft/WSL/issues/4322).
87
87
- You have strict memory requirements
88
88
- 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](https://github.com/microsoft/WSL/issues/4166).
89
89
- For those using VirtualBox, be sure to use the latest version of both VirtualBox and WSL 2. See the [related FAQ](./faq.yml#will-i-be-able-to-run-wsl-2-and-other-3rd-party-virtualization-tools-such-as-vmware--or-virtualbox-).
90
-
- 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)](https://github.com/microsoft/WSL/issues/4150).
90
+
- 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)](https://github.com/microsoft/WSL/issues/4150).
91
91
92
92
> [!NOTE]
93
93
> Consider trying the VS Code [Remote WSL Extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) 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](tutorials/wsl-vscode.md).
94
94
95
95
## WSL in the Microsoft Store
96
96
97
-
WSL has lifted the update functionality out of the Windows OS Image into a package that is available via the Microsoft Store. This means faster updates and servicing as soon as they're available, rather than needing to wait for an update of your Windows operating system.
97
+
WSL has lifted the update functionality out of the Windows OS image into a package that is available via the Microsoft Store. This means faster updates and servicing as soon as they're available, rather than needing to wait for an update of your Windows operating system.
98
98
99
-
WSL was originally included in the Windows operating system as an optional component that need to be enabled in order to install a Linux distribution. WSL in the Store has the same user experience, and is the same product, but receives updates and servicing as a store package, rather than as an entire OS update. Beginning in Windows version 19044 or higher, running the `wsl.exe --install` command will install the WSL servicing update from the Microsoft Store. ([See the blog post announcing this update](https://devblogs.microsoft.com/commandline/the-windows-subsystem-for-linux-in-the-microsoft-store-is-now-generally-available-on-windows-10-and-11/)). If you are already using WSL, you can update to ensure that you're receiving the latest WSL features and servicing from the store by running `wsl.exe --update`.
99
+
WSL was originally included in the Windows operating system as an optional component that need to be enabled in order to install a Linux distribution. WSL in the Store has the same user experience, and is the same product, but receives updates and servicing as a store package, rather than as an entire OS update. Beginning in Windows version 19044 or higher, running the `wsl.exe --install` command will install the WSL servicing update from the Microsoft Store. ([See the blog post announcing this update](https://devblogs.microsoft.com/commandline/the-windows-subsystem-for-linux-in-the-microsoft-store-is-now-generally-available-on-windows-10-and-11)). If you are already using WSL, you can update to ensure that you're receiving the latest WSL features and servicing from the store by running `wsl.exe --update`.
100
100
101
101
> [!NOTE]
102
102
> If the Microsoft Store is inaccessible within your organization, you can still utilize this WSL version by appending `--web-download` to the `--update` command, such as `wsl --update --web-download`. You need to manually update WSL every time a new release becomes available using this method.
Copy file name to clipboardExpand all lines: WSL/disk-space.md
+28-3Lines changed: 28 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: How to manage WSL disk space
3
3
description: Learn how to check the amount of disk space available, expand the size of the Virtual Hard Disk (VHD), repair a VHD mounting or read-only error, and locate the .vhdx file and disk path for Linux distributions installed with WSL 2.
4
-
ms.date: 11/19/2024
4
+
ms.date: 02/05/2025
5
5
ms.topic: article
6
6
---
7
7
@@ -45,7 +45,32 @@ If you see that you are near to reaching the available amount of disk space allo
45
45
46
46
## How to expand the size of your WSL 2 Virtual Hard Disk
47
47
48
-
To expand the VHD size for a Linux distribution beyond the **default 1TB maximum** amount of allocated disk space, follow the steps below. *(For earlier WSL releases that have not yet been updated, this max default may be set to 512GB or 256GB).*
48
+
To expand the VHD size for a Linux distribution beyond the default 1TB maximum amount of allocated disk space, you can use the `wsl --manage` command or follow the manual steps below. (Earlier WSL releases max default may be set to 512GB or 256GB).
49
+
50
+
### Expand VHD size using `wsl --manage`
51
+
52
+
The `wsl --manage` command is only available to WSL releases 2.5 and higher.
53
+
54
+
To resize the allocated space on your virtual disk:
55
+
56
+
1. Terminate all WSL instances using the command `wsl.exe --shutdown`
57
+
58
+
2. Run `wsl --manage <distribution name> --resize <memory string>`. Supported memory strings are of the form `<Memory Value>B/M/MB/G/GB/T/TB`. Decimal values are currently unsupported (e.g. `2.5TB`).
59
+
60
+
Output should look similar to the following:
61
+
62
+
```bash
63
+
e2fsck 1.46.5 (30-Dec-2021)
64
+
Pass 1: Checking inodes, blocks, and sizes
65
+
resize2fs 1.46.5 (30-Dec-2021)
66
+
The operation completed successfully.
67
+
```
68
+
69
+
The virtual drive (ext4.vhdx) for this Linux distribution has now successfully been expanded to the new size.
70
+
71
+
### Manual expansion
72
+
73
+
To expand the VHD size for a Linux distribution using manual steps:
49
74
50
75
1. Terminate all WSL instances using the command: `wsl.exe --shutdown`
The filesystem on /dev/sdb is now 78643200 (4k) blocks long.
113
138
```
114
139
115
-
The virtual drive (ext4.vhdx) for this Linux distribution has now successfully been expanded to the new size.
140
+
The virtual drive (ext4.vhdx) for this Linux distribution has now successfully been expanded to the new size.
116
141
117
142
> [!IMPORTANT]
118
143
> 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](https://devblogs.microsoft.com/commandline/whats-new-for-wsl-in-windows-10-version-1903/#accessing-linux-files-from-windows).
Copy file name to clipboardExpand all lines: WSL/networking.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,10 @@ If you are building a networking app (for example an app running on a NodeJS or
64
64
65
65
If you want to access a networking app running on Windows (for example an app running on a NodeJS or SQL server) from your Linux distribution (ie Ubuntu), then you need to use the IP address of your host machine. While this is not a common scenario, you can follow these steps to make it work.
66
66
67
-
1. Obtain the IP address of your host machine by running this command from your Linux distribution: `ip route show | grep -i default | awk '{ print $3}'`
67
+
1. Obtain the IP address of your host machine by running this command from your Linux distribution:
68
+
```bash
69
+
ip route show | grep -i default | awk '{ print $3}'`
70
+
```
68
71
2. Connect to any Windows server using the copied IP address.
69
72
70
73
The picture below shows an example of this by connecting to a Node.js server running in Windows via curl.
Copy file name to clipboardExpand all lines: WSL/systemd.md
+16-5Lines changed: 16 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Use systemd to manage Linux services with WSL
3
3
description: Learn how to use systemd to manage Linux services with Windows Subsystem for Linux.
4
-
ms.date: 07/17/2024
4
+
ms.date: 01/13/2025
5
5
ms.topic: article
6
6
---
7
7
@@ -25,7 +25,10 @@ Systemd is [now the default for the current version of Ubuntu](https://canonical
25
25
26
26
To enable systemd for any other Linux distributions running on WSL 2 (changing the default from using the systemv init):
27
27
28
-
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](https://aka.ms/wslstorepage).)
28
+
1. Ensure that your WSL version is 0.67.6 or newer:
29
+
30
+
- to check, run `wsl --version`; if the command throws `Invalid command line option: --version` error, you must update WSL;
31
+
- to update, run `wsl --update` or [download the latest version from the Microsoft Store](https://aka.ms/wslstorepage).
29
32
30
33
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`.
31
34
@@ -36,11 +39,19 @@ To enable systemd for any other Linux distributions running on WSL 2 (changing t
36
39
systemd=true
37
40
```
38
41
39
-
4. Exit the Nano text editor (Ctrl + X, selectY 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.
42
+

43
+
44
+
4. Exit the Nano text editor (Ctrl + X, type Y to save your change and confirm with the `enter` key).
45
+
46
+
5. You will then need to close the Linux distribution. You can use the command`wsl.exe --shutdown`in PowerShell to restart all WSL instances.
47
+
48
+
6. Once you restart the Linux distribution, systemd will be running. You can verify it by using the command`systemctl status` to show the _running_ state and the command`systemctl list-unit-files --type=service`, which will show the status of any services associated with your Linux distribution.
40
49
41
-

50
+
If your Linux distribution is Debian/Ubuntu/Kali Rolling, you should not only have installed the systemd package, but also make sure the systemd-sysv package is installed.
42
51
43
-
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](wsl-config.md), including the difference between the `wsl.conf` (distribution-specific) and `.wslconfig` (global) config files, how to update automount settings, etc.
Copy file name to clipboardExpand all lines: WSL/troubleshooting.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ You can also:
63
63
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.
64
64
65
65
-**Error: This update only applies to machines with the Windows Subsystem for Linux.**
66
-
- 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`.
66
+
- To install the Linux kernel update MSI package, WSL is required and should be enabled first. If it fails, you will see the message: `This update only applies to machines with the Windows Subsystem for Linux`.
67
67
- There are three possible reason you see this message:
68
68
69
69
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.
0 commit comments