23 Commits

Author SHA1 Message Date
Pooja Trivedi
901ec06ae8 Implement Stop Container 2025-12-08 19:46:23 -05:00
Blue
4c20e2c4e9
Implement container state management (#13821)
* Implement CreateContainer method

* Build fixes

* Implement CreateContainer method

* Update src/windows/wslaservice/exe/WSLAContainer.cpp

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

* Fix nerdctl host networking parameter

* Prototype CreateContainer()

* Format

* Format

* Start writing tests

* Fix various issues

* Add new files

* Test cleanup

* Test cleanup

* Prepare for PR

* Fix ARM build

* Add copyright header

* Update cmakelists.txt

* Use ifdefs

* Format

* ifdef ARM64

* Install the test .vhd in the MSI

* Update the stdin test

* Format

* Refactor the session creation logic to match the new WSLA API

* Prepare for review

* Apply PR feedback

* Use early return

* Save state

* Implement container state management

* Format

* Implement open

* Implement Delete() and proper sync logic

* Format

* Handle nerdctl inspect failures

* Format

* Fix logic error in poll

* Format

---------

Co-authored-by: Pooja Trivedi <trivedipooja@microsoft.com>
Co-authored-by: Pooja Trivedi <poojatrivedi@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-05 15:33:44 -08:00
Blue
844acd07d5
Refactor the session creation logic to match the new API (#13814)
* Implement CreateContainer method

* Build fixes

* Implement CreateContainer method

* Update src/windows/wslaservice/exe/WSLAContainer.cpp

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

* Fix nerdctl host networking parameter

* Prototype CreateContainer()

* Format

* Format

* Start writing tests

* Fix various issues

* Add new files

* Test cleanup

* Test cleanup

* Prepare for PR

* Fix ARM build

* Add copyright header

* Update cmakelists.txt

* Use ifdefs

* Format

* ifdef ARM64

* Install the test .vhd in the MSI

* Update the stdin test

* Format

* Refactor the session creation logic to match the new WSLA API

* Prepare for review

* Apply PR feedback

* Use early return

---------

Co-authored-by: Pooja Trivedi <trivedipooja@microsoft.com>
Co-authored-by: Pooja Trivedi <poojatrivedi@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-04 03:17:15 +00:00
Blue
1266d8b56a
Enable the CreateContainer stdin test (#13818)
* Enable the CreateContainer stdin test

* Prepare for review
2025-12-03 16:01:00 -08:00
Blue
2a41fe20e3
Initial implementation for CreateContainer() (#13791)
* Implement CreateContainer method

* Build fixes

* Implement CreateContainer method

* Update src/windows/wslaservice/exe/WSLAContainer.cpp

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

* Fix nerdctl host networking parameter

* Prototype CreateContainer()

* Format

* Format

* Start writing tests

* Fix various issues

* Add new files

* Test cleanup

* Test cleanup

* Prepare for PR

* Fix ARM build

* Add copyright header

* Update cmakelists.txt

* Use ifdefs

* Format

* ifdef ARM64

* Install the test .vhd in the MSI

* Update the stdin test

* Format

* Update src/windows/wslaservice/exe/WSLAContainer.cpp

Co-authored-by: Pooja Trivedi <poojatrivedi@gmail.com>

* Update src/windows/wslaservice/inc/wslaservice.idl

Co-authored-by: Pooja Trivedi <poojatrivedi@gmail.com>

* Update test/windows/WSLATests.cpp

Co-authored-by: Pooja Trivedi <poojatrivedi@gmail.com>

* Update src/windows/common/WSLAContainerLauncher.cpp

Co-authored-by: Pooja Trivedi <poojatrivedi@gmail.com>

* Apply PR feedback

* Format

---------

Co-authored-by: Pooja Trivedi <trivedipooja@microsoft.com>
Co-authored-by: Pooja Trivedi <poojatrivedi@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-12-02 14:40:16 -08:00
Ben Hillis
03dae7bf8a WSLA: Implement viritoproxy networking mode
This change implements the VirtioProxy networking mode for WSLA.
This required moving the VirtioProxy and GnsChannel classes into the common library (with NatNetworking).

DNS tunneling is currently not supported with this networking mode, so an error is returned.
With this change I have updated the default networking move of 'wsl.exe --wsla' to also use
VirtioProxy networking mode.
2025-12-01 12:58:40 -08:00
Blue
9a0f8251b8
Implement WSLASession::FormatVirtualDisk (#13753)
* Implement WSLASession::FormatVirtualDisk

* Require absolute paths

* Merge
2025-11-21 11:15:45 -08:00
Blue
50bfffa09d
Add termination callback support and rethink ownership model to match the new API (#13747)
* Move TerminationCallback to the new API

* Remove support for UserSession level VirtualMachines and rework reference management

* Remove session reference from the VM
2025-11-20 15:17:39 -08:00
Kevin Vega
911a3aa758
Add crash dump collection (#13741) 2025-11-20 09:21:20 -08:00
Blue
f0d257f760
Remove the old API - phase 3: Move remaining flags out of WSLAApi.h (#13736)
* Remove the old API - phase 2

* Format
2025-11-18 15:05:39 -08:00
Blue
f24f9299fe
Remove the old API - phase 2: Remove the GPU methods (#13735)
* Remove the old wslaclient.dll based API and port tests

* Format

* Remove the old API - phase 2
2025-11-18 11:41:23 -08:00
Blue
5bd90738c0
Remove the old API - phase 1 (#13733)
* Remove the old wslaclient.dll based API and port tests

* Format
2025-11-17 15:09:55 -08:00
Blue
14257f99de
Move the logic to mount the root VHD & basic filesystems to the service (#13726) 2025-11-14 16:58:58 -08:00
Blue
c1a3e6174c
Implement WSLAProcess (#13694)
* wsla: Prototype new process waitpid() model

* Save state

* Save state

* Save state

* Save state

* Save state

* Wire everything

* Format

* Save state

* Save state

* Redesign process launcher

* Port tests

* Port tests

* Move shell to new API

* Format

* Port more tests

* Add copyright header

* Prepare for PR

* Fix tests

* PR feedback

* Fix termination issue + add more negative tests

* Fix termination issue + add more negative tests

* Format
2025-11-13 18:10:00 -08:00
Blue
5585e4210b
wsla: Add service API definition and stub methods (#13659)
* wsla: Add service API definition

* Explicitely mark API's to be deleted in the future

* Add TODOs and session storage path

* Update src/windows/wslaservice/inc/wslaservice.idl

Co-authored-by: Pooja Trivedi <poojatrivedi@gmail.com>

* Update comments

* PR feedback

* Use an object for containers

* Update API definition

* Add stub methods

---------

Co-authored-by: Pooja Trivedi <poojatrivedi@gmail.com>
2025-11-07 11:46:42 -08:00
Pooja Trivedi
34e673fc20
WSLAUserSession and WSLASession changes (#13677)
* Add WSLASession creation and tracking in WSLAUserSession
* Wire up WSLASession to contain and create WSLAVirtualMachine

Co-authored-by: Pooja Trivedi <trivedipooja@microsoft.com>
2025-11-06 09:42:48 -05:00
Blue
1a6cbe560b
Fix various issues with the interactive shell (#13634)
* Save state

* Save state

* Save state

* Save state

* Save state

* Save state

* Save state

* Save state

* Save state

* Cleanup for review

* Update ServiceMain.cpp comment

* Remove duplicated definitions from wslservice.idl

* poc: Prototype interactive shell improvments

* Format

* Merge

* Save state

* Correctly configure terminal

* Format

* PR feedback
2025-10-31 17:18:34 -07:00
Blue
8b62d5a662
Implement DNS tunelling support for WSLA (#13651) 2025-10-30 15:24:04 -07:00
Blue
cedbb94d36
Create structure for WSLASession COM class & implementation (#13638)
* Create structure for WSLASession COM class & implementation

* Fix COM security pointer

* Add missing files

* Add copyright header

* Update src/windows/wslaservice/exe/WSLASession.cpp

Co-authored-by: Pooja Trivedi <poojatrivedi@gmail.com>

---------

Co-authored-by: Pooja Trivedi <poojatrivedi@gmail.com>
2025-10-28 14:44:33 -07:00
Blue
451a7e103a
wsla: Create wslaservice.exe (#13623)
* Save state

* Save state

* Save state

* Save state

* Save state

* Save state

* Save state

* Save state

* Save state

* Cleanup for review

* Update ServiceMain.cpp comment

* Remove duplicated definitions from wslservice.idl
2025-10-23 17:44:57 -07:00
Blue
f2bd6d60bc
wsla: Implement kernel module support (#13522)
* wsla: Implement kernel module support

* Expand tests

* Fix non-dev paths

* Skip disk permission change on read-only disks
2025-09-26 14:04:17 -07:00
Blue
7e7bc436df
wsla: Implement writeable overlayfs support for GPU mounts (#13518)
* Merge User/oneblue/prototype lsw to a feature/wsl-for-apps (#13278)

* Save state

* Save state

* Save state

* Get the VM booting

* VM booting

* Disk mounting

* CreateLinuxProcess

* Move to a proper API

* Implement env

* Progress on fd

* Redesign fork model

* Add process wait & signal

* Include nuget package

* Format

* Format

* Format

* Cleanup

* Format

* Format

* Format

* Fix nuspec

* Implement VM termination

* Add lsw dll

* Implement termination callbacks

* Save state

* Various fixes in API header

* Save state

* Test coverage

* Don't block all signals by default

* Writeable overlay

* Add struct keyword

* rename WslCreateVirualMachine -> WslCreateVirtualMachine

* rename Environmnent -> Environment

* rename HandleToUlong -> HandleToULong

* ensure correct amount of memory is used to create the LSW VM

* Adjust LSWVirtualMachine::AttachDisk so it does not require caller to have elevated permission

* Add missing struct keyword

* PR feedback

* PR review

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Implement WSL for apps TCP port forwarding  (#13299)

* Merge User/oneblue/prototype lsw to a feature/wsl-for-apps (#13278)

* Save state

* Save state

* Save state

* Get the VM booting

* VM booting

* Disk mounting

* CreateLinuxProcess

* Move to a proper API

* Implement env

* Progress on fd

* Redesign fork model

* Add process wait & signal

* Include nuget package

* Format

* Format

* Format

* Cleanup

* Format

* Format

* Format

* Fix nuspec

* Implement VM termination

* Add lsw dll

* Implement termination callbacks

* Save state

* Various fixes in API header

* Save state

* Test coverage

* Don't block all signals by default

* Writeable overlay

* Add struct keyword

* rename WslCreateVirualMachine -> WslCreateVirtualMachine

* rename Environmnent -> Environment

* rename HandleToUlong -> HandleToULong

* ensure correct amount of memory is used to create the LSW VM

* Adjust LSWVirtualMachine::AttachDisk so it does not require caller to have elevated permission

* Add missing struct keyword

* PR feedback

* PR review

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Save state

* Progress

* Save state

* Move tests to socat

* Increase test coverage

* More test coverage

* Cleanup before PR

* Cleanup before PR

* Refresh branch

* Update comment

* Only run LSW tests on wsl2

* Fix missing '.0' in flight-stage.yml

* Revert "Fix missing '.0' in flight-stage.yml"

This reverts commit 9b3e9ae38f5086b201f2100bf4196a7afe14d9eb.

* PR suggestions

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>

* Various fixes and improvements to the WSLA VM logic (#13338)

* Various fixes in the WSLA VM logic

* Update tests

* Fix ARM build

* LF

* Disable Firewall in WSLA VM config (#13345)

* Disable Firewall in WSLA VM config

* Add a version check

* Update setup-vm-for-tests.ps1 to include WSLA dll (#13362)

* Implement WSLA API's to query installed components, and install them when needed (#13363)

* Save state

* Save state

* Add tests

* Finalize tests

* Remove test logic

* Implement WSLA API to unmount & detach disks (#13364)

* Implement WSLA API to unmount & detach disks

* Add WSL2_TEST_ONLY();

* Fix wslg path

* Extend WslWaitForLinuxProcess test coverage (#13366)

* Add pipeline logic to publish nuget packages in the nightly pipeline (#13337)

* Add pipeline logic to publish nuget packages in the nightly pipeline

* Yaml

* Remove condition

* Fix version number

* Fix path

* Fix path

* Add support for using Linux files as processes' file descriptors (#13382)

* Save state

* Save state

* Add support for using Linux files as processes' file descriptors

* Cosmetics

* Missing return

* Signal the VM termination event to unblock any pending call when the service stops (#13389)

* Implement WSLA API to mount and unmount Windows folders via plan9 (#13393)

* Implement WSLA API to mount and unmount Windows folders via plan9

* Better handle when the folder is manually unmounted from the guest

* Add a test case to cover non plan9 mounts

* Update test

* wsla: do not leak fd's to user processes (#13406)

* Remove leftover logline in WSLA init (#13407)

* Implement WSLA GPU support (#13400)

* Implement WSLA GPU support

* Spelling

* Fix remaining typos

* More typos

* Merge

* Remove extra logline

* wsla: Refactor API to define `wsl` prefix on all types (#13410)

* Implement WSLA GPU support

* Spelling

* Fix remaining typos

* More typos

* Merge

* Remove extra logline

* Save state

* Reduce enum name

* Format

* Merge

* Fix merge

* Prepare for PR

* Update nuspec

* Pipeline update

* Implement WSL package version check (#13457)

* wsla: Mount the target on / when the chroot flag is set (#13455)

* wsla: Mount the target on / when the chroot flag is set

* Reuse existing helper

* wsa: Signa wsaclient.dll when building for release (#13466)

* wsa: Signal wsaclient.dll when building for release

* Typo

* Debug

* Debug

* Explicitely set targets to be built

* Build bundle

* Build tests before msipackage

* Build tests before msipackage

* Simplify

* Simplify

* wsla: Use a mount timeout when mounting a disk (#13471)

* Add an option to put a nuget suffix in the release pipeline parameters (#13474)

* Add an option to put a nuget suffix in the release pipeline parameters

* Yaml

* Yaml

* Yaml

* wsla: Implement writeable overlayfs support for GPU mounts

* Cleanup

* Typo

* Conflicts

---------

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
2025-09-25 11:36:44 -07:00
Blue
e6e380e556 wsla: Refactor API to define wsl prefix on all types (#13410)
* Implement WSLA GPU support

* Spelling

* Fix remaining typos

* More typos

* Merge

* Remove extra logline

* Save state

* Reduce enum name

* Format

* Merge

* Fix merge

* Prepare for PR

* Update nuspec

* Pipeline update
2025-09-24 17:27:41 -07:00