Skip to content

Commit

Permalink
Resolve issues Nov 23 (#1848)
Browse files Browse the repository at this point in the history
* Reorganize, reword config doc

* fix hostname command

* Clarify to resolve #1722

* Add systemd and ipv6 to comparison table

* Update prereqs for docker

* Fix based on issue 1793

* Add more context to address issue 1795

* Resolve issue 1798

* Add note about hostname flag IP differences

* Add note about terminate command

* Fix hardcoded links

* Fix links

* Editorial fixes

* Remove repeated anchor links

* Fix firewall config link
  • Loading branch information
mattwojo authored Nov 15, 2023
1 parent 03ea549 commit 5e6050d
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 83 deletions.
6 changes: 5 additions & 1 deletion WSL/compare-versions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Comparing WSL Versions
description: WSL 2 provides the benefits of WSL 1, but uses an actual Linux kernel, rather than a translation layer like WSL 1, resulting in faster performance.
ms.date: 10/04/2022
ms.date: 11/10/2023
ms.topic: conceptual
ms.custom: seo-windows-dev
---
Expand All @@ -26,11 +26,15 @@ Feature | WSL 1 | WSL 2
Full Linux Kernel| ❌ |✅
Full system call compatibility| ❌ | ✅
Performance across OS file systems| ✅ | ❌
systemd support| ❌ | ✅
IPv6 support| ❌ | ✅

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](ms-settings:windowsupdate). For builds lower than 14393, WSL is not supported at all.

For more info on the latest WSL 2 updates, see the [Windows Command Line blog](https://devblogs.microsoft.com/commandline/), including [Systemd support is now available in WSL](https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/) and [WSL September 2023 update](https://devblogs.microsoft.com/commandline/windows-subsystem-for-linux-september-2023-update/) for more info on IPv6 support.

> [!NOTE]
> WSL 2 will work with [VMware 15.5.5+](https://blogs.vmware.com/workstation/2020/05/vmware-workstation-now-supports-hyper-v-mode.html) and [VirtualBox 6+](https://www.virtualbox.org/wiki/Changelog-6.0). Learn more in our [FAQs.](./faq.yml#will-i-be-able-to-run-wsl-2-and-other-3rd-party-virtualization-tools-such-as-vmware--or-virtualbox-)
Expand Down
4 changes: 2 additions & 2 deletions WSL/disk-space.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: How to manage WSL disk space
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.
ms.date: 01/12/2023
ms.date: 11/10/2023
ms.topic: article
---

Expand Down Expand Up @@ -69,7 +69,7 @@ To expand the VHD size for a Linux distribution beyond the **default 1TB maximum
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.
6. You will need to convert the **Virtual size** to megabytes. For example, if **Virtual size: 512 GB**, this is equal to **512000 MB**. The new value you enter must be greater than this original value. To double the virtual size of 512 GB to 1024 GB, you would enter the value in MB as: **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:

Expand Down
29 changes: 10 additions & 19 deletions WSL/enterprise.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
---
title: Set up Windows Subsystem for Linux for your company
description: Resources and instructions on how to best use the Windows Subsystem for Linux in an Enterprise environment.
ms.date: 10/14/2023
ms.date: 11/15/2023
ms.topic: article
---

# Enterprise environment: Set up Windows Subsystem for Linux for your company

This guidance is intended for IT Administrators or Security Analysts responsible for setting up enterprise work environments with the goal of distributing software across multiple machines and maintaining a consistent level of security settings across those work machines.

Many companies use [Microsoft Intune]( https://learn.microsoft.com/mem/intune/) and [Microsoft Defender]( https://learn.microsoft.com/microsoft-365/security/defender/) to manage these security settings. However, setting up WSL and accessing Linux distributions in this context requires some specific setup. This guidance provides what you need to know to enable the secure use of Linux with WSL in an enterprise environment.
Many companies use [Microsoft Intune](/mem/intune/) and [Microsoft Defender](/microsoft-365/security/defender/) to manage these security settings. However, setting up WSL and accessing Linux distributions in this context requires some specific setup. This guidance provides what you need to know to enable the secure use of Linux with WSL in an enterprise environment.

* [Recommended setup](#enterprise-set-up-recommendations)
* [Microsoft Defender for Endpoint (MDE) integration](#enable-microsoft-defender-for-endpoint-mde-integration)
* [Configure settings with Intune](#configure-recommended-settings-with-intune)
* [Advanced networking controls](#use-advanced-networking-features-and-controls)
* [Creating a custom WSL image](#creating-a-custom-wsl-image)
* [Distributing a WSL image](#distributing-your-wsl-image)
* [Update and patch Linux distributions and packages](#update-and-patch-linux-distributions-and-packages)
* [Windows file system access](#windows-file-system-access)

## Enterprise set up recommendations
## Recommended Enterprise set up with Microsoft Defender for Endpoint, Intune, and Advanced Networking Controls

There are a variety of ways to set up a secure enterprise environment, but we recommend the following for setting up a secure environment that utilizes WSL.

Expand All @@ -35,21 +26,21 @@ To get started ensure that all enterprise devices have the following minimum ver

### Enable Microsoft Defender for Endpoint (MDE) integration

[Microsoft Defender for Endpoint](https://learn.microsoft.com/microsoft-365/security/defender-endpoint/microsoft-defender-endpoint) is an enterprise endpoint security platform designed to help enterprise networks prevent, detect, investigate, and respond to advanced threats. MDE now integrates with WSL as a [WSL plugin](./wsl-plugins.md), which allows security teams to see and continuously monitor for security events in all running WSL distributions with Defender for Endpoint while minimally impacting performance on developer workloads.
[Microsoft Defender for Endpoint](/microsoft-365/security/defender-endpoint/microsoft-defender-endpoint) is an enterprise endpoint security platform designed to help enterprise networks prevent, detect, investigate, and respond to advanced threats. MDE now integrates with WSL as a [WSL plugin](./wsl-plugins.md), which allows security teams to see and continuously monitor for security events in all running WSL distributions with Defender for Endpoint while minimally impacting performance on developer workloads.

Please visit [the MDE plugin for WSL docs page](https://aka.ms/mdeplugindocs) to learn more on how to get started.
See [Microsoft Defender for Endpoint plug-in for WSL](/microsoft-365/security/defender-endpoint/mde-plugin-wsl) to learn more about how to get started.

### Configure recommended settings with Intune

[Microsoft Intune](https://learn.microsoft.com/mem/intune/fundamentals/what-is-intune) is a cloud-based endpoint management solution. It manages user access to organizational resources and simplifies app and device management across your many devices, including mobile devices, desktop computers, and virtual endpoints. You can use Microsoft Intune to manage devices inside of your organization, which now also includes managing access to WSL and its key security settings.
[Microsoft Intune](/mem/intune/fundamentals/what-is-intune) is a cloud-based endpoint management solution. It manages user access to organizational resources and simplifies app and device management across your many devices, including mobile devices, desktop computers, and virtual endpoints. You can use Microsoft Intune to manage devices inside of your organization, which now also includes managing access to WSL and its key security settings.

Please visit [the WSL Intune docs page](./intune.md) to see how you can get started with enabling these, and the recommended settings.
See [Intune settings for WSL](./intune.md) for guidance on using InTune to manage WSL as a Windows component and the recommended settings.

### Use advanced networking features and controls

Starting from Windows 11 22H2 and WSL 2.0.9 or later, Windows firewall rules will automatically apply to WSL. This ensures that the firewall rules set on the Windows host will automatically apply to all WSL distros by default. To customize the firewall settings for WSL, please visit [the Hyper-V firewall docs](https://learn.microsoft.com/windows/security/operating-system-security/network-security/windows-firewall/hyper-v-firewall).
Starting from Windows 11 22H2 and WSL 2.0.9 or later, Windows firewall rules will automatically apply to WSL. This ensures that the firewall rules set on the Windows host will automatically apply to all WSL distributions by default. For guidance on customizing the firewall settings for WSL, visit [Configure Hyper-V firewall](/windows/security/operating-system-security/network-security/windows-firewall/hyper-v-firewall).

Additionally, there are user configurable settings that we recommend users enable in Enterprise scenarios by setting [these settings under `[wsl2]` in the `.wslconfig` file](./wsl-config.md#configuration-setting-for-wslconfig).
Additionally, we recommend configuring [settings under `[wsl2]` in the `.wslconfig` file](/windows/wsl/wsl-config#configuration-setting-for-wslconfig) to suite your specific Enterprise scenario.

#### Mirrored mode networking

Expand Down Expand Up @@ -81,7 +72,7 @@ Distribute the WSL image from a share or storage device by running wsl --import

## Update and patch Linux distributions and packages

Using Linux configuration manager tools is strongly recommended for monitoring and managing Linux user space. There are a host of Linux configuration managers to choose from. Check out this [blog post](http://www.craigloewen.com/blog/2019/12/04/running-puppet-quickly-in-wsl2/) on how to install Puppet in WSL 2.
Using Linux configuration manager tools is strongly recommended for monitoring and managing Linux user space. There are a host of Linux configuration managers to choose from. See this blog post on [Running Puppet quickly in WSL 2](http://www.craigloewen.com/blog/2019/12/04/running-puppet-quickly-in-wsl2/).

## Windows file system access

Expand Down
6 changes: 3 additions & 3 deletions WSL/intune.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Intune settings
description: Available settings in Intune for the Windows Subsystem for Linux (WSL)
ms.date: 10/14/2023
ms.date: 11/15/2023
ms.topic: article
---

Expand Down Expand Up @@ -36,11 +36,11 @@ This will allow you to configure WSL to ensure that users are only using the lat

## Control WSL commands

`AllowDebugShell` and `AllowDiskMount` control whether users can run the `wsl --debug-shell` and `wsl --mount` commands. You can [learn more about mounting disks in WSL with the mount command here](./wsl2-mount-disk.md).
`AllowDebugShell` and `AllowDiskMount` control whether users can run the `wsl --debug-shell` and `wsl --mount` commands. Learn more about how to [Mount a disk in WSL 2](./wsl2-mount-disk.md) using the `wsl --mount` command.

## Control access to WSL settings in `.wslconfig`

The last group of settings that end with `*UserSettingConfigurable` control access to WSL advanced settings in `.wslconfig`. When these are set to disabled then users will only be able to use the default value for that setting, and not able to configure it to custom values. To [learn more about these settings please see the advanced settings doc page](./wsl-config.md#configuration-setting-for-wslconfig).
The last group of settings that end with `*UserSettingConfigurable` control access to WSL advanced settings in `.wslconfig`. When these are set to disabled then users will only be able to use the default value for that setting, and not able to configure it to custom values. Learn more about [Configuration setting for .wslconfig](./wsl-config.md#configuration-setting-for-wslconfig), including a list of settings that can be configured globally for all Linux distributions running with WSL 2.

## Full list of available settings

Expand Down
Loading

0 comments on commit 5e6050d

Please sign in to comment.