Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSL/wsl-config.md: rewrite lead for clarity #2021

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions WSL/wsl-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ adobe-target: true

# Advanced settings configuration in WSL

The [wsl.conf](#wslconf) and [.wslconfig](#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.
The [`wsl.conf`](#wslconf) and [`.wslconfig`](#wslconfig) files are used to configure advanced settings in WSL that will be applied [every time WSL is (re)launched](#the-8-second-rule-for-configuration-changes). They differ in scope, what they configure, whether they are available for the WSL version you are running and where they are stored.

## What is the difference between wsl.conf and .wslconfig?
| Aspect | `.wslconfig` | `wsl.conf` |
|:---|:---|:---|
| Scope | Global (affects all installed WSL distributions) | Local (affects a distribution only) |
| Configures | The virtual machine powering WSL 2 (RAM, kernel to boot, number of CPUs, etc.) | Distributions in WSL (boot options, DrvFs automounts, networking, interoperability with the Windows system, what user to run as) |
| Available for | Only WSL 2 | Both WSL 1 and 2 |
| Location | `%UserProfile%\.wslconfig`, outside of a WSL distribution | `/etc/wsl.conf`, while inside a WSL distribution |

You can configure the settings for your installed Linux distributions that will automatically be applied every time you launch WSL in two ways, by using:

- **[.wslconfig](#wslconfig)** to configure **global settings** across all installed distributions running on WSL 2.
- **[wsl.conf](#wslconf)** to configure **local settings** per-distribution for each Linux distribution running on WSL 1 or WSL 2.

Both file types are used for configuring WSL settings, but the location where the file is stored, the scope of the configuration, the type of options that can be configured, and the version of WSL running your distribution all impact which file type to choose.

WSL 1 and WSL 2 run with different architecture and 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). [Check which version of WSL you are running.](./install.md#check-which-version-of-wsl-you-are-running)
If you are unsure of which version of WSL you running, refer to [Check which version of WSL you are running](./install.md#check-which-version-of-wsl-you-are-running).

## The 8 second rule for configuration changes

Expand Down