* Rename VirtioProxy networking mode to Consomme Rename the VirtioProxy networking mode to Consomme across the C++/IDL/Linux symbols and the networking engine class/files (VirtioNetworking -> ConsommeNetworking). The .wslconfig networkingMode parser still accepts the legacy "virtioproxy" string as an alias. Adds a docs section linking to OpenVMM's consomme project, where the name comes from. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Address PR feedback: scrub remaining virtio proxy refs, doc path, locked string Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1.6 KiB
Localhost
localhost is a WSL2 Linux process, created by mini_init. Its role is to forward network traffic between the WSL2 virtual machine, and Windows.
NAT networking
When wsl2.networkingMode is set to NAT, localhost will watch for bound TCP ports, and relay the network traffic to Windows via wslrelay.exe
Mirrored networking
In mirrored mode, localhost registers a BPF program to intercept calls to bind(), and forward the calls to Windows via wslservice.exe so Windows can route the network traffic directly to the WSL2 virtual machine.
Consomme networking
When wsl2.networkingMode is set to Consomme, the VM is given a virtio-net adapter whose host side is backed by Consomme, the user-mode NAT from the OpenVMM project. The guest sees a normal network (a DHCP-assigned address, a default gateway, and working DNS), but rather than going through a host NAT or bridge, its raw Ethernet frames are parsed by a user-mode process on the host and translated into ordinary host sockets. Because all traffic flows through standard host sockets, host networking policies (firewall, VPN routing, proxy settings) apply just as they would for any other host application.
Bound guest ports are tracked and forwarded to the host, optionally via wslrelay.exe.
See src/windows/common/ConsommeNetworking.cpp.
See src/linux/init/localhost.cpp.