Skip to content

feat(wsl-setup): explicitly enable WSL interop in wsl.conf#17801

Open
mfrw wants to merge 1 commit into
4.0from
mfrw/wsl-interop
Open

feat(wsl-setup): explicitly enable WSL interop in wsl.conf#17801
mfrw wants to merge 1 commit into
4.0from
mfrw/wsl-interop

Conversation

@mfrw

@mfrw mfrw commented Jun 25, 2026

Copy link
Copy Markdown
Member

Add an [interop] section to the wsl.conf shipped by wsl-setup, pinning
both interop keys explicitly:

[interop]
enabled=true
appendWindowsPath=true

This is needed for WSL to spawn a windows process.

Implemented as a file-search-replace overlay on the upstream Fedora
wsl-setup component (anchored on the [boot] systemd line) to keep
divergence minimal. Promotes wsl-setup from an inline entry in
components.toml to a dedicated comp.toml since it now carries an overlay.

Signed-off-by: Muhammad Falak R Wani falakreyaz@gmail.com

@mfrw mfrw requested a review from a team as a code owner June 25, 2026 05:13
Copilot AI review requested due to automatic review settings June 25, 2026 05:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR explicitly enables WSL interop in the /etc/wsl.conf shipped by the wsl-setup component. It adds an [interop] section (enabled=true, appendWindowsPath=true) via a file-search-replace overlay on the upstream Fedora wsl-setup component, anchored on the existing [boot] systemd=true line to keep divergence minimal. Because the component now carries an overlay, it is promoted from an inline entry in components.toml to a dedicated wsl-setup.comp.toml.

Changes:

  • Add a dedicated wsl-setup.comp.toml with a file-search-replace overlay that appends an [interop] section to wsl.conf, and remove the inline [components.wsl-setup] entry from components.toml.
  • Re-render the spec/config: wsl.conf gains the [interop] section, and wsl-setup.spec bumps Release 1213 with a new changelog entry.
  • Refresh locks/wsl-setup.lock input-fingerprint to reflect the new component config.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
base/comps/wsl-setup/wsl-setup.comp.toml New dedicated component file with the file-search-replace overlay that appends the [interop] section.
base/comps/components.toml Removes the now-redundant inline [components.wsl-setup] entry.
specs/w/wsl-setup/wsl.conf Rendered config output now contains the [interop] section.
specs/w/wsl-setup/wsl-setup.spec rpmautospec Release bump (1213) and new changelog entry.
locks/wsl-setup.lock Updated input-fingerprint reflecting the new overlay config.

# this line deliberately keeps the overlay in lockstep with upstream: if Fedora
# changes the [boot] body the overlay fails loudly at render time rather than
# silently dropping the interop config.
regex = 'systemd=true'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

regexes are generally the last resort. Can this not be appended to the end of the file?

@mfrw mfrw Jun 26, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, let me use file-prepend-lines here.
IMHO, the only file overlay functions i am aware of are:
[file-prepend-lines, file-search-replace, file-add, file-remove, file-rename]
https://github.com/microsoft/azure-linux-dev-tools/blob/main/docs/user/reference/config/overlays.md#file-overlays

What do you suggest, should we add another function file-append-lines ?

[components.wsl-setup]

# Explicitly enable WSL interop in the shipped /etc/wsl.conf. Interop (and
# Windows PATH appending) is enabled by default in WSL, but pinning both keys

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do other WSL images (from other distros) do? Do they do this as well? If so, should we be pushing this upstream to Fedora?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is actually supposed to be a default, but for some versions of WSL it does not work.
I took insipiration from this WSL github issue: microsoft/WSL#13872 (comment)

Add an [interop] section to the wsl.conf shipped by wsl-setup, pinning
both interop keys explicitly:

  [interop]
  enabled=true
  appendWindowsPath=true

This is needed for WSL to spawn a windows process.

Implemented as a file-search-replace overlay on the upstream Fedora
wsl-setup component (anchored on the [boot] systemd line) to keep
divergence minimal. Promotes wsl-setup from an inline entry in
components.toml to a dedicated comp.toml since it now carries an overlay.

Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com>
@mfrw mfrw force-pushed the mfrw/wsl-interop branch from 2af7946 to f0a7e9d Compare June 26, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants