Commit Graph

671 Commits

Author SHA1 Message Date
Ben Hillis
7370bf2bb5 virito net: revert to previous DNS behavior while we debug an issue with DNS over TCP (#14532)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-25 13:30:35 -07:00
Blue
8338ecaf52 Localization change from build: 142847827 (#14525)
Co-authored-by: WSL localization <noreply@microsoft.com>
2026-03-25 08:23:15 -07:00
Feng Wang
83d59d4b4a Fix: Fail and warn the user when --uninstall is given parameters (#14524)
Fail and warn the user when --uninstall is given parameters.
2026-03-25 13:08:56 +08:00
Ben Hillis
2b51002705 test: remove duplicated DNS test coverage (#14522)
* test: remove duplicated DNS test coverage

* format source

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-24 19:22:36 -07:00
Ben Hillis
dd88ff737c test: Add arm64 test distro support (#14500)
* test: Add arm64 test distro support

* update unit test baseline

* more test baseline updates

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-23 11:20:03 -07:00
Blue
763fcbec3c Update localization and notice scripts to target the branch that the pipeline is running on (#14492) 2026-03-20 13:46:49 -07:00
Feng Wang
61e6b9aa86 Fix wsl stuck when misconfigured cifs mount presents (#14466)
* detach terminal before running mount -a

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* use _exit on error before execv in child process to avoid unintentional resource release

* Add regression test

* Fix clang format issue

* fix all clang format issue

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* resolve ai comments

* move test to unit test

* Fix string literal

* Overwrite fstab to resolve pipeline missing file issue

---------

Co-authored-by: Feng Wang <wangfen@microsoft.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2.7.1
2026-03-20 12:45:46 -07:00
Ben Hillis
d7ff5b9631 Refactor: trim unnecessary DLL deps from COMMON_LINK_LIBRARIES (#14426)
* Refactor: trim unnecessary DLL deps from COMMON_LINK_LIBRARIES

- Split MSI/Wintrust install functions from wslutil.cpp into install.cpp
- Remove MI.lib, wsldeps.lib, msi.lib, Wintrust.lib, computecore.lib,
  computenetwork.lib, Iphlpapi.lib from COMMON_LINK_LIBRARIES
- Add per-target MSI_LINK_LIBRARIES, HCS_LINK_LIBRARIES, SERVICE_LINK_LIBRARIES
- Delay-load msi.dll and WINTRUST.dll for wsl.exe and wslg.exe
- Result: wslhost, wslrelay, wslcsdk, testplugin lose msi/wintrust startup imports;
  wsl.exe and wslg.exe defer msi/wintrust loading until actually needed;
  wslservice is the only target that imports computecore/computenetwork/Iphlpapi

* minor fixes to install.cpp that were caught during PR

* move to wsl::windows::common::install namespace

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-19 12:45:58 -07:00
Ben Hillis
6425aa8acc test: disable LoopbackExplicit due to OS build 29555 regression (#14477)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-19 05:45:56 +00:00
Ben Hillis
c5fb4aa639 Enable DNS tunneling for VirtioProxy networking mode (#14461)
- Allow VirtioProxy to keep EnableDnsTunneling=true in config, but clear
  socket-specific options (BestEffortDnsParsing, DnsTunnelingIpAddress)
- Suppress dedicated DNS tunneling hvsocket for VirtioProxy; tunneling
  is handled through the VirtioNetworking device host instead
- Set DnsTunneling flag on VirtioNetworkingFlags so the device host
  knows to tunnel DNS
- Expand SWIOTLB kernel cmdline to cover VirtioFs and VirtioProxy
- Bump DeviceHost package to 1.1.39-0
- Add VirtioProxy DNS test coverage for tunneling on/off
- Skip GuestPortIsReleasedV6 on Windows 10

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-18 15:31:04 -07:00
Carlos Nihelton
df38f2cc47 Moves all Ubuntu distros to the tar-based format (#14463)
* Move all supported Ubuntu images to the new format

We backported the build pipeline so all current LTSes come out in the new tar-based format

* Remove the appx based distros

All WSL users can run tar-based distros by now, right?
There is no benefit in maintaining both formats.
2026-03-17 16:24:51 -07:00
Ben Hillis
20201136f2 Update Microsoft.WSL.DeviceHost to version 1.1.39-0 (#14460)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-17 12:19:10 -07:00
Andre Muezerie
65a8dd660f Add iptables to list of apps to install in WSL (#14459)
There were instructions already on how to install tcpdump in WSL, but
iptables are also needed for the log collection to be complete, so this
PR adds instructions on how to also install iptables.

Co-authored-by: Andre Muezerie <andremue@linux.microsoft.com>
2026-03-17 11:48:50 -07:00
Daman Mulye
ef8e1c8dba Track bind syscall when port is 0 (#14333)
* Initial work

* .

* pr feedback and add unit test

* minor tweaks an fix use after free in logging statement

* implement PR feedback

* hopefully final pr feedback

* pr feedback in test function

* Address PR feedback: add try/catch to TrackPort and PortZeroBind queue push

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-13 17:00:57 -07:00
Ben Hillis
7cd9ed9603 virtio networking: add support for ipv6 (#14350)
* VirtioProxy: Add IPv6 address, gateway, and route support

- Add PreferredIpv6Address field and GetBestGatewayV6* methods to NetworkSettings
- Extend GetHostEndpointSettings() to discover IPv6 unicast address and gateway
- Add UpdateIpv6Address() using ModifyGuestEndpointSettingRequest<IPAddress>
- Push IPv6 default route to guest via UpdateDefaultRoute(AF_INET6)
- Remove AF_INET6 early return in ModifyOpenPorts, use INETADDR_PORT()
- Add EndpointRoute::DefaultRoute() static factory
- Pass client_ip_ipv6 in devicehost options (not yet parsed by devicehost)
- Remove gateway_ip from devicehost options (only needed for DHCP)
- Include IPv6 DNS servers in non-tunneling DNS settings
- Add ConfigurationV6 and DnsResolutionAAAA tests

* cleanup and add more ipv6 tests

* added test coverage and minor updates

* clang format

* pr feedback

* format source

* pr feedback

* test fixes

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-13 16:36:21 -07:00
Ben Hillis
81dc9a3004 virtiofs: update logic so querying virtiofs mount source does not require a call to the service (#14380)
* virtiofs: update logic so querying virtiofs mount source does not require a call to the service

* more pr feedback

* use std::filesystem::read_symlink

* pr feedback and use canonical path in virtiofs symlink

* make sure canonical path is always used

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-13 10:18:34 -07:00
Ben Hillis
e5cb458e67 Ship initrd.img in MSI using build-time generation via powershell script (#14424)
* Ship initrd.img in MSI using build-time generation via tar.exe

Replace the install-time CreateInitrd/RemoveInitrd custom actions with a
build-time step that generates initrd.img using the Windows built-in
tar.exe (libarchive/bsdtar) and ships it directly in the MSI.

The install-time approach had a race condition: wsl.exe could launch
before the CreateInitrd custom action completed, causing
ERROR_FILE_NOT_FOUND for initrd.img.

Changes:
- Add CMake custom command to generate initrd.img via tar.exe --format=newc
- Add initrd.img as a regular file in the MSI tools component
- Remove CreateInitrd/RemoveInitrd custom actions from WiX, DllMain,
  and wslinstall.def
- Remove CreateCpioInitrd helper and its tests (no longer needed)
- Update pipeline build targets to build initramfs instead of init

* pr feedback

* more pr feedback

* switch to using a powershell script instead of tar.exe

* powershell script feedback

* hopefully final pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-12 20:42:24 -07:00
Blue
24c3a9adf7 Notice change from build: 141806547 (#14423)
Co-authored-by: WSL notice <noreply@microsoft.com>
2026-03-11 23:11:29 -07:00
Ben Hillis
515e790002 Fix CVE-2026-26127: bump .NET runtime from 10.0.0 to 10.0.4 (#14421)
Addresses Dependabot alerts #10 and #11. The Microsoft.NETCore.App.Runtime
packages (win-x64 and win-arm64) at version 10.0.0 are vulnerable to a
denial of service via out-of-bounds read when decoding malformed Base64Url
input (CVSS 7.5 High). Bumped to 10.0.4 which includes the fix.

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-11 16:39:21 -07:00
AlmaLinux Autobot
2e75df3247 chore(distributions): Almalinux auto-update - 20260311 14:52:02 (#14404)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-11 09:05:42 -07:00
Ben Hillis
3167b72018 test: enable virtiofs tests and enable WSLG during testing (#14387)
* test: enable virtiofs tests and enable WSLG during testing

* test fix

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-10 12:34:56 -07:00
Ben Hillis
218b71be67 Resolve and pass gateway MAC address to virtio net device (#14386)
Use ResolveIpNetEntry2 to look up the host gateway's MAC address and
pass it as the gateway_mac device option to the virtio net adapter.
This allows the guest to see the real gateway MAC instead of the
default consomme address.

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-09 14:51:25 -07:00
Ben Hillis
f3024dc5c6 build: ensure dependency graph of Linux binaries includes shared headers (#14374)
* build: ensure dependency graph of Linux binaries includes shared headers

* pr feedback

* pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-09 11:16:54 -07:00
Blue
456a5cfe45 Localization change from build: 141225222 (#14360)
Co-authored-by: WSL localization <noreply@microsoft.com>
2026-03-05 06:51:07 -08:00
Scott Bradnick
c6b609c13a Update SLE15SP7 [QU3] (#14353) 2026-03-04 13:43:35 -08:00
Blue
7cadd55247 Localization change from build: 141137626 (#14352)
Co-authored-by: WSL localization <noreply@microsoft.com>
2026-03-04 08:26:09 -08:00
Ben Hillis
8c220dc083 Fix grammar, typos, and formatting in docs and source (#14286)
* Fix localization text, Intune capitalization, ADMX indentation, unused import

- distributions/validate.py: Remove unused 'import base64'
- en-US/en-GB Resources.resw: Fix word order 'the list distribution' -> 'the distribution list' in MessageCouldFetchDistributionList
- en-US/en-GB Resources.resw: Remove trailing space from MessageCorruptedDistroRegistration value
- intune/en-US/WSL.adml: Fix 'For Linux' -> 'for Linux' capitalization (5 occurrences) to match official product name
- intune/WSL.admx: Fix inconsistent 3-space indent to 4-space on AllowWSL1 and CustomKernelUserSettingConfigurable policies

* Fix grammar, typos, and formatting in docs and source code

- WmiService.h: Fix duplicated word 'of of' -> 'is of' in WQL comment
- drvfs.md: Fix 'which tell' -> 'which tells' (subject-verb agreement), double space, second 'tell' -> 'tells'
- systemd.md: Fix 'tries synchronizes' -> 'tries to synchronize'
- wslhost.exe.md: Fix 'processes terminates' -> 'process terminates'
- boot-process.md: Add missing 'in' preposition, fix C:/ -> C:\, fix lowercase 'linux' to 'Linux' (4 occurrences), fix misplaced parenthesis
- init.md: Fix double space before hvsocket backtick
- session-leader.md: Fix heading level ## -> ### to match sibling section
- CONTRIBUTING.md: Fix double period after bold security notice
- debugging.md: Fix missing word 'be' in 'can enabled', fix 'process' -> 'processes'
- index.md: Add missing period at end of sentence
- technical-documentation/index.md: Fix 'API's' -> 'APIs' (remove incorrect apostrophe)
- relay.md: Fix lowercase 'linux' to 'Linux' (3 occurrences)
- localhost.md: Fix lowercase 'linux' to 'Linux'
- plan9.md: Fix lowercase 'linux' to 'Linux'

* update errormessages testcase

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-03 18:13:59 -08:00
Ben Hillis
6747ae808a tools: update deploy-to-host.ps1 to automatically detect host arch (#14343)
* tools: update deploy-to-host.ps1 to automatically detect host architecture

* pr feedback

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-03-03 17:13:58 -08:00
Blue
21cb15e009 Localization change from build: 141093872 (#14345)
Co-authored-by: WSL localization <noreply@microsoft.com>
2026-03-03 13:49:17 -08:00
Andy Sterland
32329bb35c Add vs info to settings (#14169)
* Initial commit to add a page to the OOBE experience for the Visual Studio integration with WSL.

* Updated link for C++ to the landing page for Linux dev.

* Reverting accidental commit of UserConfig.cmake.sample.

* Revert accidental change

* Revert "cleanup: fix UserConfig.cmake.sample in master branch (#14076)"

This reverts commit 4b23185dfe.

* Reapply "cleanup: fix UserConfig.cmake.sample in master branch (#14076)"

This reverts commit d97e2753bb.

* revert

* revert

* Tidying whitespace

* Tidying whitespace

* Tidying whitespace

* Tidying whitespace

* Tidying whitespace

* Update src/windows/wslsettings/Views/OOBE/ShellPage.xaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/windows/wslsettings/Activation/ProtocolActivationHandler.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-03-03 14:45:00 -05:00
Arch Linux Technical User
8c659b56f9 archlinux: Release 2026.03.01.160197 (#14324)
This is an automated release [1].

[1] https://gitlab.archlinux.org/archlinux/archlinux-wsl/-/blob/main/.gitlab-ci.yml
2026-03-02 11:37:35 -08:00
Dimitris Chatzis
26bf49db1e Refactor: Use TryParse in view models for safer numeric input parsing (#14323)
* Refactor: Use TryParse in view models for safer numeric input parsing

Replaces parsing logic with TryParse across view models to prevent overflow/format crashes from invalid user input. Specifically fixes the VM Idle Timeout crash reported in #14312, while improving stability for other numeric settings.

* Fix crash when opening Optional Features settings page
2026-03-02 10:14:20 -08:00
Ben Hillis
756c77319a Fix FindIDL.cmake to correctly reference IDL_P variable instead of empty IDL_C var (#14298)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-02-26 17:40:32 -08:00
Ben Hillis
e01a672880 Fix 4 code bugs: substr off-by-one, HANDLE* cast, TOCTOU GetLastError, sun_path overflow (#14297)
Bug 1 - LxssHttpProxy.cpp: IPv6 substr extraction used wrong length
  calculation. substr(openBracket+1, closeBracket-1) is incorrect when
  openBracket > 0; fixed to substr(openBracket+1, closeBracket-openBracket-1).
  Also fixed empty-address guard to check closeBracket (not closeBracket-1).

Bug 2 - LxssUserSession.cpp: Two instances of reinterpret_cast<HANDLE*> in
  ScopedMultiRelay construction should be reinterpret_cast<HANDLE> (without
  the pointer). Other identical callsites in the same file already use the
  correct cast.

Bug 3 - LxssUserSession.cpp: GetLastError() was called unconditionally after
  CreateFileW, even on success. A stale ERROR_SHARING_VIOLATION from a prior
  API call could cause a false throw. Fixed to only check GetLastError() when
  CreateFileW fails (!vhd).

Bug 4 - plan9.cpp: sun_path bounds check used > instead of >= leaving no room
  for null terminator. Also added a post-split check to ensure the child name
  fits after splitting parent/child for long paths.

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-02-26 17:03:32 -08:00
Blue
55e04d5ff1 Disable the process creation cursor animation by default (#14293) 2026-02-26 15:40:34 -08:00
ssparach
63fa9f3e13 Accessibility Bug Fix: After selecting from the navigation list, keyboard focus is not transferred to page content (#14289)
* bug fix

* Update src/windows/wslsettings/Views/Settings/OptionalFeaturesPage.xaml.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/windows/wslsettings/Views/Settings/NetworkingPage.xaml.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/windows/wslsettings/Views/Settings/MemAndProcPage.xaml.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/windows/wslsettings/Views/Settings/FileSystemPage.xaml.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/windows/wslsettings/Views/Settings/DeveloperPage.xaml.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-26 14:10:17 -08:00
Ben Hillis
d23a5c492e Add automount.cgroups to WSL_CONF_KEYS in validate-modern.py (#14285)
Fixes #13993

The validate-modern.py script was missing the 'automount.cgroups' setting
from WSL_CONF_KEYS, causing validation errors when distributions include
this setting in their /etc/wsl.conf files.

Note: windowsterminal.enabled was already present in the
wsl-distribution.conf validation list.

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-02-25 17:57:09 -08:00
Dimitris Chatzis
cb35b511cc Mask NetworkManager-wait-online.service during boot (#14272)
* Mask NetworkManager-wait-online.service during boot

Fixes #13772. Similar to PR #13611, this masks NetworkManager-wait-online.service to prevent 60-second timeouts during boot since WSL interfaces are unmanaged by NetworkManager. Also added the service to the discouraged units list in validate-modern.py and added a unit test.

* Addressed Copilot feedback

* Fix
2026-02-25 17:39:56 -08:00
Ben Hillis
2856dc3d88 Enable VS 2026 solution generation and improve ARM64 developer experience (#14283)
- Auto-detect host architecture when TARGET_PLATFORM and CMAKE_GENERATOR_PLATFORM are unset, defaulting to ARM64 on ARM64 hosts
- Fix trailing '|' in platform regex that made the else branch unreachable
- Refactor Visual Studio detection to prefer VS2022 and fall back to VS2026 with a clang-format warning- Document x64 .NET 6.0 runtime setup required for WiX on ARM64

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-02-25 17:32:22 -08:00
Ben Hillis
d28ae62c0e cleanup: minor DuplicateHandle helper hygene (#14276)
* cleanup: minor DuplicateHandle helper hygene

* pr feedback

* Permissions -> DesiredAccess

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-02-25 13:22:20 -08:00
Ben Hillis
6e6f4116b9 Revert "Enable detection cmake script for Visual Studio 2026 and pre-release …" (#14268)
This reverts commit 893b5a3d33.
2026-02-24 17:48:34 -08:00
Scott Bradnick
a439794b8b Update SLE16.0 [QU1] (#14227) 2026-02-18 12:38:32 -08:00
Ben Hillis
a27d4725f7 virtionet: improve state tracking (#14215)
* virtionet: improve state tracking

* remove unused var

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-02-13 12:10:12 -08:00
Copilot
107fe52413 Fix excessive screen updates in progress indicators (#14206)
* Initial plan

* Fix excessive screen updates during wsl --export

Only update progress display when file size actually changes, preventing
unnecessary screen redraws and reducing CPU/GPU overhead.

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

* Address code review: initialize previousSize to 0 instead of -1

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

* Complete fix for excessive screen updates during wsl --export

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

* Clean up: remove codeql symlink and add to gitignore

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

* Revert .gitignore to original state

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

* Compare MB values instead of raw bytes to prevent unnecessary redraws

When file size grows in sub-MB increments, comparing raw bytes causes
redraws even though the displayed MB value hasn't changed. Now we
calculate and compare the MB value directly, ensuring the progress
indicator only updates when the displayed value actually changes.

Also initialize previousSizeMB to -1 to ensure initial progress is
always shown (even when starting at 0 MB).

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

* Cache string in UpdateProgress instead of caching values in caller

Move the duplicate string check into ConsoleProgressIndicator::UpdateProgress()
itself. This provides a more general solution that prevents printing the same
string twice for any caller, not just the file size case. The comparison now
happens at the string level, which handles all formatting variations and makes
the fix more maintainable.

Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: benhillis <17727402+benhillis@users.noreply.github.com>
2026-02-12 16:34:01 -08:00
Ben Hillis
31ecc4940c virtioproxy: update setting of m_networkSettings to under the lock (#14210)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-02-12 15:39:58 -08:00
Ben Hillis
66822ce4ce Update Microsoft.WSL.DeviceHost with virtiofs and virtio networking (#14198)
improvements.

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-02-12 13:05:45 -08:00
Carlos Nihelton
4b0d4a6d62 Update DistributionInfo.json due release of Ubuntu-24.04.4 (#14202) 2026-02-12 10:21:06 -08:00
Andy Sterland
893b5a3d33 Enable detection cmake script for Visual Studio 2026 and pre-release versions of Visual Studio (#14160)
* Updating to support VS2026 and insiders builds

* Updated max ver (exclusive) to 19.0

* Fix command for vswhere to include prerelease

---------

Co-authored-by: Ben Hillis <benhillis@gmail.com>
2026-02-11 17:54:55 -08:00
JohnMcPMS
0f7ed1041b Add Clang requirement to vswhere usage (#14187) 2026-02-09 13:40:28 -08:00
Ben Hillis
ae39345d90 Minor follow-up initrd feedback items (#14186)
Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2026-02-09 13:39:29 -08:00