mirror of
https://github.com/microsoft/WSL.git
synced 2025-12-10 17:47:59 -06:00
fix: correct interop documentation (#12932)
* correct interop documentation
This commit is contained in:
parent
d5db6fcc72
commit
228ebef799
@ -2,8 +2,8 @@
|
||||
|
||||
The ability to launch Windows processes from Linux is controlled by 2 different levels of settings:
|
||||
|
||||
- The `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager\DistributionFlags` registry value, which control the settings for all Windows users (setting the lowest significance bit disables interop)
|
||||
- The `[interop]` section in [/etc/wsl.conf](https://learn.microsoft.com/windows/wsl/wsl-config#wslconf), which controls the setting for a given WSL distribution
|
||||
- The `HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LxssManager\DistributionFlags` registry value, which controls the settings for all Windows users (setting the lowest significance bit disables interop)
|
||||
- The `[interop]` section in [/etc/wsl.conf](https://learn.microsoft.com/windows/wsl/wsl-config#wslconf), which controls the setting for a given WSL distribution.
|
||||
|
||||
## binfmt interpreters for Windows executables
|
||||
|
||||
@ -11,7 +11,7 @@ To allow Windows process creation from Linux, WSL registers a [binfmt interprete
|
||||
|
||||
To perform the registration, WSL writes to `/proc/sys/fs/binfmt_misc` and creates a `WSLInterop` entry, which points to `/init`. For WSL1 registration, the entry is written by [init](init.md) for each distribution, for WSL2 [mini_init](mini_init.md) registers the binfmt interpreter at the virtual machine level.
|
||||
|
||||
Note: The `/init` executable is the entrypoint for different WSL processes ([init](init.md), [plan9](plan9.md), [localhost](localhost.md), etc). This executable looks at `argv[0]` to determine which logic to run. In the case of interop, `/init` will run the Windows process creation logic of its `argv[0]` value doesn't match any of the known entrypoints.
|
||||
Note: The `/init` executable is the entrypoint for different WSL processes ([init](init.md), [plan9](plan9.md), [localhost](localhost.md), etc). This executable looks at `argv[0]` to determine which logic to run. In the case of interop, `/init` will run the Windows process creation logic if its `argv[0]` value doesn't match any of the known entrypoints.
|
||||
|
||||
See: `WslEntryPoint()` in `src/linux/init.cpp`.
|
||||
|
||||
@ -19,7 +19,7 @@ See: `WslEntryPoint()` in `src/linux/init.cpp`.
|
||||
|
||||
When the user tries to execute a Windows process, the kernel will launch `/init` with the Windows process's command line as arguments.
|
||||
|
||||
To start a new Windows process `/init` needs to connect to an interop server. Interop servers are Linux processes that have an hvsocket connection to Windows processes (either [wsl.exe](wsl.exe.md) or [wslhost.exe](wslhost.exe.md) processes) and that can launch Windows executables.
|
||||
To start a new Windows process `/init` needs to connect to an interop server. Interop servers are special Linux processes that act as bridges between Linux and Windows. They maintain secure communication channels (through hvsocket connections) with Windows processes ([wsl.exe](wsl.exe.md) or [wslhost.exe](wslhost.exe.md)) to launch Windows executables.
|
||||
|
||||
Inside Linux, each [session leader](session-leader.md), and each instance of [init](init.md) has an associated interop server, which is serving via an unix socket under `/run/WSL`.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user