@samitouri / QOSAMI-WSL / commits / b9e1d704

Rename VirtioProxy networking mode to Consomme (#40873)

* 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>

Ben Hillis committed Jun 22, 2026 at 19:35 UTC b9e1d7044806c07c655dd7f507a6868ad4a184cb
28 files changed +217 -204
doc/docs/technical-documentation/localhost.md
+12 -1
@@ -11,4 +11,15 @@ When `wsl2.networkingMode` is set to NAT, `localhost` will watch for bound TCP p
11
12 In mirrored mode, `localhost` registers a BPF program to intercept calls to `bind()`, and forward the calls to Windows via [wslservice.exe](wslservice.exe.md) so Windows can route the network traffic directly to the WSL2 virtual machine.
13
14 -See `src/linux/localhost.cpp`.
\ No newline at end of file
14 +## Consomme networking
15 +
16 +When `wsl2.networkingMode` is set to `Consomme`, the VM is given a virtio-net adapter whose host side is backed by [Consomme][consomme], the user-mode NAT from the [OpenVMM][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.
17 +
18 +Bound guest ports are tracked and forwarded to the host, optionally via [wslrelay.exe](wslrelay.exe.md).
19 +
20 +See `src/windows/common/ConsommeNetworking.cpp`.
21 +
22 +See `src/linux/init/localhost.cpp`.
23 +
24 +[consomme]: https://github.com/microsoft/openvmm/tree/main/vm/devices/net/net_consomme/consomme
25 +[openvmm]: https://github.com/microsoft/openvmm
\ No newline at end of file
intune/en-US/WSL.adml
+1 -1
@@ -48,7 +48,7 @@
48 <string id="NetworkingModeNone"><!-- _locComment_text="{Locked}" -->None</string>
49 <string id="NetworkingModeNAT"><!-- _locComment_text="{Locked}" -->NAT</string>
50 <string id="NetworkingModeMirrored"><!-- _locComment_text="{Locked}" -->Mirrored</string>
51 - <string id="NetworkingModeVirtioProxy"><!-- _locComment_text="{Locked}" -->VirtioProxy</string>
51 + <string id="NetworkingModeVirtioProxy"><!-- _locComment_text="{Locked}" -->Consomme</string>
52
53 <string id="WSLContainer"><!-- _locComment_text='{Locked="WSL"}' -->WSL container</string>
54
localization/strings/en-US/Resources.resw
+3 -3
@@ -1130,9 +1130,9 @@ Attempting web download...</value>
1130 <data name="MessageConfigVirtio9pDisabled" xml:space="preserve">
1131 <value>wsl2.virtio9p is disabled, falling back to 9p with vsock transport.</value>
1132 </data>
1133 - <data name="MessageVirtioProxyRequiresVirtio" xml:space="preserve">
1134 - <value>VirtioProxy networking is not supported when wsl2.virtio is disabled; falling back to networkingMode {}.</value>
1135 - <comment>{Locked="wsl2.virtio"}{Locked="VirtioProxy"}{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
1133 + <data name="MessageConsommeRequiresVirtio" xml:space="preserve">
1134 + <value>Consomme networking is not supported when wsl2.virtio is disabled; falling back to networkingMode {}.</value>
1135 + <comment>{Locked="wsl2.virtio"}{Locked="Consomme"}{FixedPlaceholder="{}"}Command line arguments, file names and string inserts should not be translated</comment>
1136 </data>
1137 <data name="MessageSwiotlbKernelUnsupported" xml:space="preserve">
1138 <value>The running kernel is missing a patch that significantly improves virtio device performance. Update to a more recent WSL kernel to enable this optimization.</value>
src/linux/init/localhost.cpp
+1 -1
@@ -444,7 +444,7 @@ int RunPortTracker(int Argc, char** Argv)
444 return 1;
445 }
446
447 - if (NetworkingMode < LxMiniInitNetworkingModeNone || NetworkingMode > LxMiniInitNetworkingModeVirtioProxy)
447 + if (NetworkingMode < LxMiniInitNetworkingModeNone || NetworkingMode > LxMiniInitNetworkingModeConsomme)
448 {
449 std::cerr << "Invalid networking mode (" << NetworkingMode << ")\n";
450 return 1;
src/linux/init/util.cpp
+1 -1
@@ -1276,7 +1276,7 @@ try
1276 const auto& response = transaction.Receive<RESULT_MESSAGE<uint8_t>>();
1277 auto NetworkingMode = static_cast<LX_MINI_INIT_NETWORKING_MODE>(response.Result);
1278
1279 - THROW_ERRNO_IF(EINVAL, NetworkingMode < LxMiniInitNetworkingModeNone || NetworkingMode > LxMiniInitNetworkingModeVirtioProxy);
1279 + THROW_ERRNO_IF(EINVAL, NetworkingMode < LxMiniInitNetworkingModeNone || NetworkingMode > LxMiniInitNetworkingModeConsomme);
1280
1281 return NetworkingMode;
1282 }
src/linux/init/wslinfo.cpp
+2 -2
@@ -111,8 +111,8 @@ Return Value:
111 std::cout << "mirrored";
112 break;
113
114 - case LxMiniInitNetworkingModeVirtioProxy:
115 - std::cout << "virtioproxy";
114 + case LxMiniInitNetworkingModeConsomme:
115 + std::cout << "consomme";
116 break;
117
118 default:
src/shared/inc/lxinitshared.h
+1 -1
@@ -1307,7 +1307,7 @@ typedef enum _LX_MINI_INIT_NETWORKING_MODE
1307 LxMiniInitNetworkingModeNat = 1,
1308 LxMiniInitNetworkingModeBridged = 2,
1309 LxMiniInitNetworkingModeMirrored = 3,
1310 - LxMiniInitNetworkingModeVirtioProxy = 4
1310 + LxMiniInitNetworkingModeConsomme = 4
1311 } LX_MINI_INIT_NETWORKING_MODE,
1312 *PLX_MINI_INIT_NETWORKING_MODE;
1313
src/windows/WslcSDK/wslcsdk.cpp
+1 -1
@@ -435,7 +435,7 @@ try
435 runtimeSettings.CpuCount = internalType->cpuCount;
436 runtimeSettings.MemoryMb = internalType->memoryMb;
437 runtimeSettings.BootTimeoutMs = internalType->timeoutMS;
438 - runtimeSettings.NetworkingMode = WSLCNetworkingModeVirtioProxy;
438 + runtimeSettings.NetworkingMode = WSLCNetworkingModeConsomme;
439 runtimeSettings.FeatureFlags = ConvertFlags(internalType->featureFlags);
440 WI_SetFlag(runtimeSettings.FeatureFlags, WslcFeatureFlagsVirtioFs);
441 WI_SetFlag(runtimeSettings.FeatureFlags, WslcFeatureFlagsDnsTunneling);
src/windows/common/CMakeLists.txt
+2 -2
@@ -39,7 +39,7 @@ set(SOURCES
39 VTSupport.cpp
40 WindowsUpdateIntegration.cpp
41 WSLCContainerLauncher.cpp
42 - VirtioNetworking.cpp
42 + ConsommeNetworking.cpp
43 WSLCProcessLauncher.cpp
44 WslClient.cpp
45 WslCoreConfig.cpp
@@ -126,7 +126,7 @@ set(HEADERS
126 VTSupport.h
127 WindowsUpdateIntegration.h
128 WSLCContainerLauncher.h
129 - VirtioNetworking.h
129 + ConsommeNetworking.h
130 WSLCProcessLauncher.h
131 WslClient.h
132 WslCoreConfig.h
src/windows/common/ConsommeNetworking.cpp renamed
+38 -38
@@ -1,7 +1,7 @@
1 // Copyright (C) Microsoft Corporation. All rights reserved.
2
3 #include "precomp.h"
4 -#include "VirtioNetworking.h"
4 +#include "ConsommeNetworking.h"
5 #include "GuestDeviceManager.h"
6 #include "Stringify.h"
7 #include "stringshared.h"
@@ -9,14 +9,14 @@
9 using namespace wsl::core::networking;
10 using namespace wsl::shared;
11 using namespace wsl::windows::common::stringify;
12 -using wsl::core::VirtioNetworking;
12 +using wsl::core::ConsommeNetworking;
13
14 static constexpr auto c_eth0DeviceName = L"eth0";
15 static constexpr auto c_loopbackDeviceName = TEXT(LX_INIT_LOOPBACK_DEVICE_NAME);
16
17 -VirtioNetworking::VirtioNetworking(
17 +ConsommeNetworking::ConsommeNetworking(
18 GnsChannel&& gnsChannel,
19 - VirtioNetworkingFlags flags,
19 + ConsommeNetworkingFlags flags,
20 LPCWSTR dnsOptions,
21 std::shared_ptr<GuestDeviceManager> guestDeviceManager,
22 wil::shared_handle userToken,
@@ -30,7 +30,7 @@ VirtioNetworking::VirtioNetworking(
30 {
31 }
32
33 -VirtioNetworking::~VirtioNetworking()
33 +ConsommeNetworking::~ConsommeNetworking()
34 {
35 // Unregister the network notification callback to prevent it from using the GNS channel.
36 m_networkNotifyHandle.reset();
@@ -39,35 +39,35 @@ VirtioNetworking::~VirtioNetworking()
39 m_gnsChannel.Stop();
40 }
41
42 -void VirtioNetworking::Initialize()
42 +void ConsommeNetworking::Initialize()
43 {
44 // Initialize adapter state.
45 RefreshGuestConnection();
46
47 - if (WI_IsFlagSet(m_flags, VirtioNetworkingFlags::LocalhostRelay))
47 + if (WI_IsFlagSet(m_flags, ConsommeNetworkingFlags::LocalhostRelay))
48 {
49 SetupLoopbackDevice();
50 }
51
52 - THROW_IF_WIN32_ERROR(NotifyNetworkConnectivityHintChange(&VirtioNetworking::OnNetworkConnectivityChange, this, TRUE, &m_networkNotifyHandle));
52 + THROW_IF_WIN32_ERROR(NotifyNetworkConnectivityHintChange(&ConsommeNetworking::OnNetworkConnectivityChange, this, TRUE, &m_networkNotifyHandle));
53 }
54
55 -void VirtioNetworking::TraceLoggingRundown() noexcept
55 +void ConsommeNetworking::TraceLoggingRundown() noexcept
56 {
57 auto lock = m_lock.lock_exclusive();
58
59 - WSL_LOG("VirtioNetworking::TraceLoggingRundown", TRACE_NETWORKSETTINGS_OBJECT(m_networkSettings));
59 + WSL_LOG("ConsommeNetworking::TraceLoggingRundown", TRACE_NETWORKSETTINGS_OBJECT(m_networkSettings));
60 }
61
62 -void VirtioNetworking::FillInitialConfiguration(LX_MINI_INIT_NETWORKING_CONFIGURATION& message)
62 +void ConsommeNetworking::FillInitialConfiguration(LX_MINI_INIT_NETWORKING_CONFIGURATION& message)
63 {
64 - message.NetworkingMode = LxMiniInitNetworkingModeVirtioProxy;
65 - message.DisableIpv6 = WI_IsFlagClear(m_flags, VirtioNetworkingFlags::Ipv6);
64 + message.NetworkingMode = LxMiniInitNetworkingModeConsomme;
65 + message.DisableIpv6 = WI_IsFlagClear(m_flags, ConsommeNetworkingFlags::Ipv6);
66 message.EnableDhcpClient = false;
67 message.PortTrackerType = LX_MINI_INIT_PORT_TRACKER_TYPE::LxMiniInitPortTrackerTypeMirrored;
68 }
69
70 -void VirtioNetworking::StartPortTracker(wil::unique_socket&& socket)
70 +void ConsommeNetworking::StartPortTracker(wil::unique_socket&& socket)
71 {
72 WI_ASSERT(!m_gnsPortTrackerChannel.has_value());
73
@@ -81,16 +81,16 @@ void VirtioNetworking::StartPortTracker(wil::unique_socket&& socket)
81 [](const std::string&, bool) {}); // TODO: reconsider if InterfaceStateCallback is needed.
82 }
83
84 -void NETIOAPI_API_ VirtioNetworking::OnNetworkConnectivityChange(PVOID context, NL_NETWORK_CONNECTIVITY_HINT hint)
84 +void NETIOAPI_API_ ConsommeNetworking::OnNetworkConnectivityChange(PVOID context, NL_NETWORK_CONNECTIVITY_HINT hint)
85 try
86 {
87 - static_cast<VirtioNetworking*>(context)->RefreshGuestConnection();
87 + static_cast<ConsommeNetworking*>(context)->RefreshGuestConnection();
88 }
89 CATCH_LOG()
90
91 -uint16_t VirtioNetworking::HandlePortNotification(const SOCKADDR_INET& addr, int protocol, uint16_t guestPort, bool allocate) const
91 +uint16_t ConsommeNetworking::HandlePortNotification(const SOCKADDR_INET& addr, int protocol, uint16_t guestPort, bool allocate) const
92 {
93 - if (addr.si_family == AF_INET6 && WI_IsFlagClear(m_flags, VirtioNetworkingFlags::Ipv6))
93 + if (addr.si_family == AF_INET6 && WI_IsFlagClear(m_flags, ConsommeNetworkingFlags::Ipv6))
94 {
95 return 0;
96 }
@@ -118,7 +118,7 @@ uint16_t VirtioNetworking::HandlePortNotification(const SOCKADDR_INET& addr, int
118 }
119 });
120
121 - if (WI_IsFlagSet(m_flags, VirtioNetworkingFlags::LocalhostRelay) && (unspecified || loopback))
121 + if (WI_IsFlagSet(m_flags, ConsommeNetworkingFlags::LocalhostRelay) && (unspecified || loopback))
122 {
123 if (!loopback)
124 {
@@ -149,7 +149,7 @@ uint16_t VirtioNetworking::HandlePortNotification(const SOCKADDR_INET& addr, int
149 return hostPort;
150 }
151
152 -uint16_t VirtioNetworking::ModifyOpenPorts(
152 +uint16_t ConsommeNetworking::ModifyOpenPorts(
153 _In_ PCWSTR tag, _In_ const SOCKADDR_INET& hostAddress, _In_ uint16_t HostPort, _In_ uint16_t GuestPort, _In_ int protocol, _In_ bool isOpen) const
154 {
155 THROW_HR_IF_MSG(
@@ -194,7 +194,7 @@ uint16_t VirtioNetworking::ModifyOpenPorts(
194 return HostPort;
195 }
196
197 -HRESULT VirtioNetworking::MapPort(_In_ const SOCKADDR_INET& ListenAddress, _In_ USHORT GuestPort, _In_ int Protocol, _Out_ USHORT* AllocatedHostPort) const
197 +HRESULT ConsommeNetworking::MapPort(_In_ const SOCKADDR_INET& ListenAddress, _In_ USHORT GuestPort, _In_ int Protocol, _Out_ USHORT* AllocatedHostPort) const
198 try
199 {
200 RETURN_HR_IF(E_POINTER, AllocatedHostPort == nullptr);
@@ -208,7 +208,7 @@ try
208 }
209 CATCH_RETURN()
210
211 -HRESULT VirtioNetworking::UnmapPort(_In_ const SOCKADDR_INET& ListenAddress, _In_ USHORT GuestPort, _In_ int Protocol) const
211 +HRESULT ConsommeNetworking::UnmapPort(_In_ const SOCKADDR_INET& ListenAddress, _In_ USHORT GuestPort, _In_ int Protocol) const
212 try
213 {
214 RETURN_HR_IF(E_INVALIDARG, Protocol != IPPROTO_TCP && Protocol != IPPROTO_UDP);
@@ -219,7 +219,7 @@ try
219 }
220 CATCH_RETURN()
221
222 -void VirtioNetworking::RefreshGuestConnection()
222 +void ConsommeNetworking::RefreshGuestConnection()
223 {
224 // Query current networking information before acquiring the lock.
225 auto networkSettings = GetHostEndpointSettings();
@@ -243,20 +243,20 @@ void VirtioNetworking::RefreshGuestConnection()
243 appendOption(L"client_ip", networkSettings->PreferredIpAddress.AddressString);
244 std::wstring default_route = networkSettings->GetBestGatewayAddressString();
245 appendOption(L"gateway_ip", default_route);
246 - if (WI_IsFlagSet(m_flags, VirtioNetworkingFlags::Ipv6))
246 + if (WI_IsFlagSet(m_flags, ConsommeNetworkingFlags::Ipv6))
247 {
248 appendOption(L"client_ip_ipv6", networkSettings->PreferredIpv6Address.AddressString);
249 }
250
251 networking::DnsInfo currentDns{};
252 - if (WI_IsFlagSet(m_flags, VirtioNetworkingFlags::DnsTunneling))
252 + if (WI_IsFlagSet(m_flags, ConsommeNetworkingFlags::DnsTunneling))
253 {
254 currentDns = networking::HostDnsInfo::GetDnsTunnelingSettings(default_route);
255 }
256 else
257 {
258 wsl::core::networking::DnsSettingsFlags dnsFlags = networking::DnsSettingsFlags::IncludeVpn;
259 - WI_SetFlagIf(dnsFlags, networking::DnsSettingsFlags::IncludeIpv6Servers, WI_IsFlagSet(m_flags, VirtioNetworkingFlags::Ipv6));
259 + WI_SetFlagIf(dnsFlags, networking::DnsSettingsFlags::IncludeIpv6Servers, WI_IsFlagSet(m_flags, ConsommeNetworkingFlags::Ipv6));
260 currentDns = networking::HostDnsInfo::GetDnsSettings(dnsFlags);
261 }
262
@@ -294,7 +294,7 @@ void VirtioNetworking::RefreshGuestConnection()
294 }
295
296 UpdateIpv4Address(networkSettings->PreferredIpAddress);
297 - if (WI_IsFlagSet(m_flags, VirtioNetworkingFlags::Ipv6))
297 + if (WI_IsFlagSet(m_flags, ConsommeNetworkingFlags::Ipv6))
298 {
299 UpdateIpv6Address(networkSettings->PreferredIpv6Address);
300 }
@@ -307,9 +307,9 @@ void VirtioNetworking::RefreshGuestConnection()
307 m_networkSettings = std::move(networkSettings);
308 }
309
310 -void VirtioNetworking::SetupLoopbackDevice()
310 +void ConsommeNetworking::SetupLoopbackDevice()
311 {
312 - const auto* clientIp = WI_IsFlagSet(m_flags, VirtioNetworkingFlags::LoopbackClientIp) ? L"127.0.0.1" : L"169.254.73.250";
312 + const auto* clientIp = WI_IsFlagSet(m_flags, ConsommeNetworkingFlags::LoopbackClientIp) ? L"127.0.0.1" : L"169.254.73.250";
313 const auto deviceOptions =
314 std::format(L"client_ip={};client_mac=00:11:22:33:44:55;gateway_ip=169.254.73.249;netmask=255.255.255.248", clientIp);
315
@@ -344,7 +344,7 @@ void VirtioNetworking::SetupLoopbackDevice()
344 m_gnsChannel.SendNetworkDeviceMessage(loopbackType, ToJsonW(createLoopbackDevice).c_str());
345 }
346
347 -void VirtioNetworking::SendDefaultRoute(const std::wstring& gateway, hns::ModifyRequestType requestType)
347 +void ConsommeNetworking::SendDefaultRoute(const std::wstring& gateway, hns::ModifyRequestType requestType)
348 {
349 if (gateway.empty() || !m_adapterId.has_value())
350 {
@@ -363,7 +363,7 @@ void VirtioNetworking::SendDefaultRoute(const std::wstring& gateway, hns::Modify
363 m_gnsChannel.SendHnsNotification(ToJsonW(request).c_str(), m_adapterId.value());
364 }
365
366 -void VirtioNetworking::UpdateDefaultRoute(const std::wstring& gateway)
366 +void ConsommeNetworking::UpdateDefaultRoute(const std::wstring& gateway)
367 {
368 if (gateway == m_trackedDefaultRoute || !m_adapterId.has_value())
369 {
@@ -375,7 +375,7 @@ void VirtioNetworking::UpdateDefaultRoute(const std::wstring& gateway)
375 SendDefaultRoute(gateway, hns::ModifyRequestType::Add);
376 }
377
378 -void VirtioNetworking::UpdateDnsSettings(const networking::DnsInfo& dns)
378 +void ConsommeNetworking::UpdateDnsSettings(const networking::DnsInfo& dns)
379 {
380 if (dns == m_trackedDnsSettings || !m_adapterId.has_value())
381 {
@@ -391,7 +391,7 @@ void VirtioNetworking::UpdateDnsSettings(const networking::DnsInfo& dns)
391 m_gnsChannel.SendHnsNotification(ToJsonW(notification).c_str(), m_adapterId.value());
392 }
393
394 -void VirtioNetworking::UpdateIpv4Address(const networking::EndpointIpAddress& ipAddress)
394 +void ConsommeNetworking::UpdateIpv4Address(const networking::EndpointIpAddress& ipAddress)
395 {
396 if (ipAddress == m_trackedIpv4Address || ipAddress.AddressString.empty() || !m_adapterId.has_value())
397 {
@@ -409,9 +409,9 @@ void VirtioNetworking::UpdateIpv4Address(const networking::EndpointIpAddress& ip
409 m_gnsChannel.SendEndpointState(endpointProperties);
410 }
411
412 -void VirtioNetworking::SendIpv6Address(const networking::EndpointIpAddress& ipAddress, hns::ModifyRequestType requestType)
412 +void ConsommeNetworking::SendIpv6Address(const networking::EndpointIpAddress& ipAddress, hns::ModifyRequestType requestType)
413 {
414 - WI_ASSERT(WI_IsFlagSet(m_flags, VirtioNetworkingFlags::Ipv6));
414 + WI_ASSERT(WI_IsFlagSet(m_flags, ConsommeNetworkingFlags::Ipv6));
415
416 if (ipAddress.AddressString.empty() || !m_adapterId.has_value())
417 {
@@ -429,9 +429,9 @@ void VirtioNetworking::SendIpv6Address(const networking::EndpointIpAddress& ipAd
429 m_gnsChannel.SendHnsNotification(ToJsonW(request).c_str(), m_adapterId.value());
430 }
431
432 -void VirtioNetworking::UpdateIpv6Address(const networking::EndpointIpAddress& ipAddress)
432 +void ConsommeNetworking::UpdateIpv6Address(const networking::EndpointIpAddress& ipAddress)
433 {
434 - WI_ASSERT(WI_IsFlagSet(m_flags, VirtioNetworkingFlags::Ipv6));
434 + WI_ASSERT(WI_IsFlagSet(m_flags, ConsommeNetworkingFlags::Ipv6));
435
436 if (ipAddress == m_trackedIpv6Address || !m_adapterId.has_value())
437 {
@@ -443,7 +443,7 @@ void VirtioNetworking::UpdateIpv6Address(const networking::EndpointIpAddress& ip
443 SendIpv6Address(ipAddress, hns::ModifyRequestType::Add);
444 }
445
446 -void VirtioNetworking::UpdateMtu(std::optional<ULONG> mtu)
446 +void ConsommeNetworking::UpdateMtu(std::optional<ULONG> mtu)
447 {
448 if (!mtu || mtu.value() == m_networkMtu || !m_adapterId.has_value())
449 {
src/windows/common/ConsommeNetworking.h renamed
+11 -11
@@ -10,7 +10,7 @@
10
11 namespace wsl::core {
12
13 -enum class VirtioNetworkingFlags
13 +enum class ConsommeNetworkingFlags
14 {
15 None = 0x0,
16 LocalhostRelay = 0x1,
@@ -18,26 +18,26 @@ enum class VirtioNetworkingFlags
18 Ipv6 = 0x4,
19 LoopbackClientIp = 0x8,
20 };
21 -DEFINE_ENUM_FLAG_OPERATORS(VirtioNetworkingFlags);
21 +DEFINE_ENUM_FLAG_OPERATORS(ConsommeNetworkingFlags);
22
23 -class VirtioNetworking : public INetworkingEngine
23 +class ConsommeNetworking : public INetworkingEngine
24 {
25 public:
26 - VirtioNetworking(
26 + ConsommeNetworking(
27 GnsChannel&& gnsChannel,
28 - VirtioNetworkingFlags flags,
28 + ConsommeNetworkingFlags flags,
29 LPCWSTR dnsOptions,
30 std::shared_ptr<GuestDeviceManager> guestDeviceManager,
31 wil::shared_handle userToken,
32 std::wstring swiotlbConfig);
33
34 - ~VirtioNetworking();
34 + ~ConsommeNetworking() override;
35
36 // Note: This class cannot be moved because m_networkNotifyHandle captures a 'this' pointer.
37 - VirtioNetworking(const VirtioNetworking&) = delete;
38 - VirtioNetworking(VirtioNetworking&&) = delete;
39 - VirtioNetworking& operator=(const VirtioNetworking&) = delete;
40 - VirtioNetworking& operator=(VirtioNetworking&&) = delete;
37 + ConsommeNetworking(const ConsommeNetworking&) = delete;
38 + ConsommeNetworking(ConsommeNetworking&&) = delete;
39 + ConsommeNetworking& operator=(const ConsommeNetworking&) = delete;
40 + ConsommeNetworking& operator=(ConsommeNetworking&&) = delete;
41
42 // INetworkingEngine
43 void Initialize() override;
@@ -72,7 +72,7 @@ private:
72 GnsChannel m_gnsChannel;
73 std::optional<GnsPortTrackerChannel> m_gnsPortTrackerChannel;
74 std::shared_ptr<networking::NetworkSettings> m_networkSettings;
75 - VirtioNetworkingFlags m_flags = VirtioNetworkingFlags::None;
75 + ConsommeNetworkingFlags m_flags = ConsommeNetworkingFlags::None;
76 LPCWSTR m_dnsOptions = nullptr;
77 std::wstring m_swiotlbOption;
78 std::optional<GUID> m_localhostAdapterId;
src/windows/common/WSLCUserSettings.cpp
+2 -2
@@ -89,9 +89,9 @@ namespace details {
89 {
90 return WSLCNetworkingModeNAT;
91 }
92 - if (value == "virtioproxy")
92 + if (value == "consomme")
93 {
94 - return WSLCNetworkingModeVirtioProxy;
94 + return WSLCNetworkingModeConsomme;
95 }
96
97 return std::nullopt;
src/windows/common/WSLCUserSettings.h
+1 -1
@@ -92,7 +92,7 @@ namespace details {
92 DEFINE_SETTING_MAPPING(SessionCpuCount, uint32_t, uint32_t, 0, "session.cpuCount")
93 DEFINE_SETTING_MAPPING(SessionMemoryMb, std::string, uint32_t, 0, "session.memorySize")
94 DEFINE_SETTING_MAPPING(SessionStorageSizeMb, std::string, uint32_t, 1048576, "session.maxStorageSize")
95 - DEFINE_SETTING_MAPPING(SessionNetworkingMode, std::string, WSLCNetworkingMode, WSLCNetworkingModeVirtioProxy, "session.networkingMode")
95 + DEFINE_SETTING_MAPPING(SessionNetworkingMode, std::string, WSLCNetworkingMode, WSLCNetworkingModeConsomme, "session.networkingMode")
96 DEFINE_SETTING_MAPPING(SessionHostFileShareMode, std::string, HostFileShareMode, HostFileShareMode::VirtioFs, "session.hostFileShareMode")
97 DEFINE_SETTING_MAPPING(SessionDnsTunneling, bool, bool, true, "session.dnsTunneling")
98 DEFINE_SETTING_MAPPING(CredentialStore, std::string, CredentialStoreType, CredentialStoreType::WinCred, "credentialStore")
src/windows/common/WslCoreConfig.cpp
+8 -8
@@ -361,7 +361,7 @@ void wsl::core::Config::Initialize(_In_opt_ HANDLE UserToken)
361 case wsl::core::NetworkingMode::None:
362 case wsl::core::NetworkingMode::Nat:
363 case wsl::core::NetworkingMode::Mirrored:
364 - case wsl::core::NetworkingMode::VirtioProxy:
364 + case wsl::core::NetworkingMode::Consomme:
365 defaultNetworkingMode = static_cast<wsl::core::NetworkingMode>(setting.value());
366 break;
367
@@ -442,10 +442,10 @@ void wsl::core::Config::Initialize(_In_opt_ HANDLE UserToken)
442 VALIDATE_CONFIG_OPTION(!EnableVirtio, EnableVirtioFs, false);
443 VALIDATE_CONFIG_OPTION(!EnableVirtio, SwiotlbSizeBytes, 0);
444
445 - if (NetworkingMode == NetworkingMode::VirtioProxy)
445 + if (NetworkingMode == NetworkingMode::Consomme)
446 {
447 - NetworkingMode = (defaultNetworkingMode == NetworkingMode::VirtioProxy) ? NetworkingMode::None : NetworkingMode::Nat;
448 - EMIT_USER_WARNING(wsl::shared::Localization::MessageVirtioProxyRequiresVirtio(ToString(NetworkingMode)));
447 + NetworkingMode = (defaultNetworkingMode == NetworkingMode::Consomme) ? NetworkingMode::None : NetworkingMode::Nat;
448 + EMIT_USER_WARNING(wsl::shared::Localization::MessageConsommeRequiresVirtio(ToString(NetworkingMode)));
449 }
450 }
451
@@ -457,15 +457,15 @@ void wsl::core::Config::Initialize(_In_opt_ HANDLE UserToken)
457
458 // Compute a default swiotlb config only when a virtio device that requires bounce buffers is present.
459 // N.B. Must run after policy overrides so networking/fs modes reflect final values.
460 - if (SwiotlbSizeBytes == 0 && (EnableVirtioFs || EnableVirtio9p || (NetworkingMode == NetworkingMode::VirtioProxy)))
460 + if (SwiotlbSizeBytes == 0 && (EnableVirtioFs || EnableVirtio9p || (NetworkingMode == NetworkingMode::Consomme)))
461 {
462 SwiotlbSizeBytes = wsl::windows::common::helpers::ComputeDefaultSwiotlbConfig(MemorySizeBytes);
463 }
464
465 - if (NetworkingMode != NetworkingMode::Nat && NetworkingMode != NetworkingMode::Mirrored && NetworkingMode != NetworkingMode::VirtioProxy)
465 + if (NetworkingMode != NetworkingMode::Nat && NetworkingMode != NetworkingMode::Mirrored && NetworkingMode != NetworkingMode::Consomme)
466 {
467 VALIDATE_CONFIG_OPTION(
468 - (NetworkingMode != NetworkingMode::Nat && NetworkingMode != NetworkingMode::Mirrored && NetworkingMode != NetworkingMode::VirtioProxy),
468 + (NetworkingMode != NetworkingMode::Nat && NetworkingMode != NetworkingMode::Mirrored && NetworkingMode != NetworkingMode::Consomme),
469 EnableDnsTunneling,
470 false);
471 }
@@ -483,7 +483,7 @@ void wsl::core::Config::Initialize(_In_opt_ HANDLE UserToken)
483 }
484
485 // Load NAT configuration from the registry.
486 - // N.B. This must be done after all networking mode adjustments (e.g. VirtioProxy -> NAT fallback).
486 + // N.B. This must be done after all networking mode adjustments (e.g. Consomme -> NAT fallback).
487 if (NetworkingMode == wsl::core::NetworkingMode::Nat)
488 {
489 try
src/windows/common/WslCoreConfig.h
+7 -5
@@ -88,7 +88,7 @@ enum NetworkingMode
88 Nat = 1,
89 Bridged = 2,
90 Mirrored = 3,
91 - VirtioProxy = 4
91 + Consomme = 4
92 };
93
94 // Ensure the WslCoreConfig versions of the enum match the version that's used in mini init.
@@ -96,7 +96,7 @@ static_assert(static_cast<ULONG>(NetworkingMode::None) == LxMiniInitNetworkingMo
96 static_assert(static_cast<ULONG>(NetworkingMode::Nat) == LxMiniInitNetworkingModeNat);
97 static_assert(static_cast<ULONG>(NetworkingMode::Bridged) == LxMiniInitNetworkingModeBridged);
98 static_assert(static_cast<ULONG>(NetworkingMode::Mirrored) == LxMiniInitNetworkingModeMirrored);
99 -static_assert(static_cast<ULONG>(NetworkingMode::VirtioProxy) == LxMiniInitNetworkingModeVirtioProxy);
99 +static_assert(static_cast<ULONG>(NetworkingMode::Consomme) == LxMiniInitNetworkingModeConsomme);
100
101 constexpr auto ToString(NetworkingMode config) noexcept
102 {
@@ -110,8 +110,8 @@ constexpr auto ToString(NetworkingMode config) noexcept
110 return "Bridged";
111 case NetworkingMode::Mirrored:
112 return "Mirrored";
113 - case NetworkingMode::VirtioProxy:
114 - return "VirtioProxy";
113 + case NetworkingMode::Consomme:
114 + return "Consomme";
115 default:
116 return "Invalid";
117 }
@@ -122,7 +122,9 @@ const std::map<std::string, wsl::core::NetworkingMode, shared::string::CaseInsen
122 {ToString(NetworkingMode::Nat), NetworkingMode::Nat},
123 {ToString(NetworkingMode::Bridged), NetworkingMode::Bridged},
124 {ToString(NetworkingMode::Mirrored), NetworkingMode::Mirrored},
125 - {ToString(NetworkingMode::VirtioProxy), NetworkingMode::VirtioProxy}};
125 + {ToString(NetworkingMode::Consomme), NetworkingMode::Consomme},
126 + // Legacy alias: the Consomme networking mode was previously named "VirtioProxy".
127 + {"VirtioProxy", NetworkingMode::Consomme}};
128
129 enum class FirewallAction
130 {
src/windows/inc/WslCoreConfigInterface.h
+1 -1
@@ -55,7 +55,7 @@ enum NetworkingConfiguration
55 Nat = 1,
56 Bridged = 2,
57 Mirrored = 3,
58 - VirtioProxy = 4
58 + Consomme = 4
59 };
60
61 enum MemoryReclaimConfiguration
src/windows/libwsl/WslCoreConfigInterface.cpp
+1 -1
@@ -23,7 +23,7 @@ static_assert(NetworkingConfiguration::None == static_cast<int32_t>(wsl::core::N
23 static_assert(NetworkingConfiguration::Nat == static_cast<int32_t>(wsl::core::NetworkingMode::Nat));
24 static_assert(NetworkingConfiguration::Bridged == static_cast<int32_t>(wsl::core::NetworkingMode::Bridged));
25 static_assert(NetworkingConfiguration::Mirrored == static_cast<int32_t>(wsl::core::NetworkingMode::Mirrored));
26 -static_assert(NetworkingConfiguration::VirtioProxy == static_cast<int32_t>(wsl::core::NetworkingMode::VirtioProxy));
26 +static_assert(NetworkingConfiguration::Consomme == static_cast<int32_t>(wsl::core::NetworkingMode::Consomme));
27
28 static_assert(MemoryReclaimConfiguration::Disabled == static_cast<int32_t>(wsl::core::MemoryReclaimMode::Disabled));
29 static_assert(MemoryReclaimConfiguration::Gradual == static_cast<int32_t>(wsl::core::MemoryReclaimMode::Gradual));
src/windows/service/exe/HcsVirtualMachine.cpp
+16 -16
@@ -17,7 +17,7 @@ Abstract:
17 #include <string>
18 #include <string_view>
19 #include "hcs_schema.h"
20 -#include "VirtioNetworking.h"
20 +#include "ConsommeNetworking.h"
21 #include "NatNetworking.h"
22 #include "wslsecurity.h"
23 #include "wslutil.h"
@@ -156,10 +156,10 @@ HcsVirtualMachine::HcsVirtualMachine(_In_ const WSLCSessionSettings* Settings)
156 #endif
157
158 // Compute a swiotlb device-options token sized to fit this VM's RAM, used by the kernel
159 - // command line, virtiofs shares, and the VirtioProxy virtio-net adapter.
159 + // command line, virtiofs shares, and the Consomme virtio-net adapter.
160 // Only needed when a virtio device that requires bounce buffers will be attached.
161 ULONG64 swiotlbSizeBytes = 0;
162 - if (FeatureEnabled(WslcFeatureFlagsVirtioFs) || m_networkingMode == WSLCNetworkingModeVirtioProxy)
162 + if (FeatureEnabled(WslcFeatureFlagsVirtioFs) || m_networkingMode == WSLCNetworkingModeConsomme)
163 {
164 swiotlbSizeBytes = helpers::ComputeDefaultSwiotlbConfig(static_cast<UINT64>(Settings->MemoryMb) * _1MB);
165 }
@@ -309,7 +309,7 @@ HcsVirtualMachine::HcsVirtualMachine(_In_ const WSLCSessionSettings* Settings)
309 // Create and start compute system
310 m_computeSystem = hcs::CreateComputeSystem(m_vmIdString.c_str(), json.c_str());
311
312 - if (FeatureEnabled(WslcFeatureFlagsVirtioFs) || m_networkingMode == WSLCNetworkingModeVirtioProxy)
312 + if (FeatureEnabled(WslcFeatureFlagsVirtioFs) || m_networkingMode == WSLCNetworkingModeConsomme)
313 {
314 m_guestDeviceManager = std::make_shared<::GuestDeviceManager>(m_vmIdString, m_vmId);
315 }
@@ -437,7 +437,7 @@ try
437 // The DNS hvsocket is only allocated for NAT mode.
438 THROW_HR_IF(E_INVALIDARG, (FeatureEnabled(WslcFeatureFlagsDnsTunneling) && m_networkingMode == WSLCNetworkingModeNAT) != (DnsSocket != nullptr));
439
440 - // The check still applies to virtio proxy because the host virtio proxy uses the same Windows DNS APIs.
440 + // The check still applies to Consomme because the host Consomme NAT uses the same Windows DNS APIs.
441 if (FeatureEnabled(WslcFeatureFlagsDnsTunneling))
442 {
443 const auto result = wsl::core::networking::DnsResolver::LoadDnsResolverMethods();
@@ -481,20 +481,20 @@ try
481 std::move(dnsSocketHandle),
482 nullptr);
483 }
484 - else if (m_networkingMode == WSLCNetworkingModeVirtioProxy)
484 + else if (m_networkingMode == WSLCNetworkingModeConsomme)
485 {
486 - wsl::core::VirtioNetworkingFlags flags = wsl::core::VirtioNetworkingFlags::Ipv6;
486 + wsl::core::ConsommeNetworkingFlags flags = wsl::core::ConsommeNetworkingFlags::Ipv6;
487 if (FeatureEnabled(WslcFeatureFlagsDnsTunneling))
488 {
489 - WI_SetFlag(flags, wsl::core::VirtioNetworkingFlags::DnsTunneling);
489 + WI_SetFlag(flags, wsl::core::ConsommeNetworkingFlags::DnsTunneling);
490 }
491
492 if (!FeatureEnabled(WslcFeatureFlagsPortRelayWslRelay))
493 {
494 - WI_SetFlag(flags, wsl::core::VirtioNetworkingFlags::LocalhostRelay);
494 + WI_SetFlag(flags, wsl::core::ConsommeNetworkingFlags::LocalhostRelay);
495 }
496
497 - m_networkEngine = std::make_unique<wsl::core::VirtioNetworking>(
497 + m_networkEngine = std::make_unique<wsl::core::ConsommeNetworking>(
498 wsl::core::GnsChannel(std::move(gnsSocketHandle)), flags, nullptr, m_guestDeviceManager, m_userToken, m_swiotlbOption);
499 }
500 else
@@ -714,10 +714,10 @@ try
714
715 std::lock_guard lock(m_lock);
716
717 - auto* virtioNet = dynamic_cast<wsl::core::VirtioNetworking*>(m_networkEngine.get());
718 - RETURN_HR_IF(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), virtioNet == nullptr);
717 + auto* consommeNet = dynamic_cast<wsl::core::ConsommeNetworking*>(m_networkEngine.get());
718 + RETURN_HR_IF(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), consommeNet == nullptr);
719
720 - return virtioNet->MapPort(CreateListenAddress(ListenAddress, HostPort), GuestPort, Protocol, AllocatedHostPort);
720 + return consommeNet->MapPort(CreateListenAddress(ListenAddress, HostPort), GuestPort, Protocol, AllocatedHostPort);
721 }
722 CATCH_RETURN()
723
@@ -728,10 +728,10 @@ try
728
729 std::lock_guard lock(m_lock);
730
731 - auto* virtioNet = dynamic_cast<wsl::core::VirtioNetworking*>(m_networkEngine.get());
732 - RETURN_HR_IF(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), virtioNet == nullptr);
731 + auto* consommeNet = dynamic_cast<wsl::core::ConsommeNetworking*>(m_networkEngine.get());
732 + RETURN_HR_IF(HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED), consommeNet == nullptr);
733
734 - return virtioNet->UnmapPort(CreateListenAddress(ListenAddress, HostPort), GuestPort, Protocol);
734 + return consommeNet->UnmapPort(CreateListenAddress(ListenAddress, HostPort), GuestPort, Protocol);
735 }
736 CATCH_RETURN()
737
src/windows/service/exe/WslCoreVm.cpp
+15 -15
@@ -23,7 +23,7 @@ Abstract:
23 #include "MirroredNetworking.h"
24 #include "WslCoreFirewallSupport.h"
25 #include "DnsResolver.h"
26 -#include "VirtioNetworking.h"
26 +#include "ConsommeNetworking.h"
27
28 #include <TraceLoggingProvider.h>
29
@@ -545,8 +545,8 @@ void WslCoreVm::Initialize(const GUID& VmId, const wil::shared_handle& UserToken
545 message->MemoryReclaimMode = static_cast<LX_MINI_INIT_MEMORY_RECLAIM_MODE>(m_vmConfig.MemoryReclaim);
546 message->EnableDebugShell = m_vmConfig.EnableDebugShell;
547 message->EnableSafeMode = m_vmConfig.EnableSafeMode;
548 - // Virtio proxy forwards DNS via the host proxy, so the dedicated DNS hvsocket is only used by NAT and Mirrored modes.
549 - message->EnableDnsTunneling = m_vmConfig.EnableDnsTunneling && m_vmConfig.NetworkingMode != NetworkingMode::VirtioProxy;
548 + // Consomme forwards DNS via the host proxy, so the dedicated DNS hvsocket is only used by NAT and Mirrored modes.
549 + message->EnableDnsTunneling = m_vmConfig.EnableDnsTunneling && m_vmConfig.NetworkingMode != NetworkingMode::Consomme;
550 message->DefaultKernel = m_defaultKernel;
551 message->KernelModulesDeviceId = m_kernelModulesDeviceId;
552 message.WriteString(message->HostnameOffset, wsl::windows::common::filesystem::GetLinuxHostName());
@@ -573,7 +573,7 @@ void WslCoreVm::Initialize(const GUID& VmId, const wil::shared_handle& UserToken
573 const auto startTime = std::chrono::steady_clock::now();
574
575 // For NAT networking, ensure the network can be created. If creating the network fails, fall back to
576 - // virtio proxy networking mode.
576 + // Consomme networking mode.
577 wsl::windows::common::hcs::unique_hcn_network natNetwork;
578 if (m_vmConfig.NetworkingMode == NetworkingMode::Nat)
579 {
@@ -584,9 +584,9 @@ void WslCoreVm::Initialize(const GUID& VmId, const wil::shared_handle& UserToken
584 if (!natNetwork)
585 {
586 EMIT_USER_WARNING(wsl::shared::Localization::MessageNetworkInitializationFailedFallback2(
587 - ToString(m_vmConfig.NetworkingMode), ToString(NetworkingMode::VirtioProxy)));
587 + ToString(m_vmConfig.NetworkingMode), ToString(NetworkingMode::Consomme)));
588
589 - m_vmConfig.NetworkingMode = NetworkingMode::VirtioProxy;
589 + m_vmConfig.NetworkingMode = NetworkingMode::Consomme;
590 }
591 }
592
@@ -604,16 +604,16 @@ void WslCoreVm::Initialize(const GUID& VmId, const wil::shared_handle& UserToken
604 m_networkingEngine = std::make_unique<wsl::core::NatNetworking>(
605 m_system.get(), std::move(natNetwork), std::move(gnsChannel), m_vmConfig, std::move(dnsTunnelingSocket));
606 }
607 - else if (m_vmConfig.NetworkingMode == NetworkingMode::VirtioProxy)
607 + else if (m_vmConfig.NetworkingMode == NetworkingMode::Consomme)
608 {
609 - wsl::core::VirtioNetworkingFlags flags =
610 - wsl::core::VirtioNetworkingFlags::Ipv6 | wsl::core::VirtioNetworkingFlags::LoopbackClientIp;
611 - WI_SetFlagIf(flags, wsl::core::VirtioNetworkingFlags::LocalhostRelay, m_vmConfig.EnableLocalhostRelay);
612 - WI_SetFlagIf(flags, wsl::core::VirtioNetworkingFlags::DnsTunneling, m_vmConfig.EnableDnsTunneling);
613 - // NAT may have fallen back to virtio proxy after the early-config message; drop the unused DNS hvsocket.
609 + wsl::core::ConsommeNetworkingFlags flags =
610 + wsl::core::ConsommeNetworkingFlags::Ipv6 | wsl::core::ConsommeNetworkingFlags::LoopbackClientIp;
611 + WI_SetFlagIf(flags, wsl::core::ConsommeNetworkingFlags::LocalhostRelay, m_vmConfig.EnableLocalhostRelay);
612 + WI_SetFlagIf(flags, wsl::core::ConsommeNetworkingFlags::DnsTunneling, m_vmConfig.EnableDnsTunneling);
613 + // NAT may have fallen back to Consomme after the early-config message; drop the unused DNS hvsocket.
614 dnsTunnelingSocket.reset();
615
616 - m_networkingEngine = std::make_unique<wsl::core::VirtioNetworking>(
616 + m_networkingEngine = std::make_unique<wsl::core::ConsommeNetworking>(
617 std::move(gnsChannel), flags, LX_INIT_RESOLVCONF_FULL_HEADER, m_guestDeviceManager, m_userToken, m_swiotlbOption);
618 }
619 else if (m_vmConfig.NetworkingMode == NetworkingMode::Bridged)
@@ -1978,7 +1978,7 @@ bool WslCoreVm::IsDnsTunnelingSupported() const
1978 {
1979 WI_ASSERT(
1980 m_vmConfig.NetworkingMode == NetworkingMode::Nat || m_vmConfig.NetworkingMode == NetworkingMode::Mirrored ||
1981 - m_vmConfig.NetworkingMode == NetworkingMode::VirtioProxy);
1981 + m_vmConfig.NetworkingMode == NetworkingMode::Consomme);
1982
1983 return SUCCEEDED_LOG(wsl::core::networking::DnsResolver::LoadDnsResolverMethods());
1984 }
@@ -2975,7 +2975,7 @@ void WslCoreVm::ValidateNetworkingMode()
2975 EMIT_USER_WARNING(Localization::MessageLocalhostForwardingNotSupportedMirroredMode());
2976 }
2977
2978 - // The DnsResolver support check still applies to virtio proxy because the host virtio proxy uses the same Windows DNS APIs.
2978 + // The DnsResolver support check still applies to Consomme because the host Consomme NAT uses the same Windows DNS APIs.
2979 if (m_vmConfig.EnableDnsTunneling && !IsDnsTunnelingSupported())
2980 {
2981 // Since DNS tunneling is enabled by default, only show the warning if the user explicitly asked for it.
src/windows/service/inc/WSLCShared.idl
+2 -2
@@ -143,7 +143,7 @@ typedef enum _WSLCNetworkingMode
143 {
144 WSLCNetworkingModeNone,
145 WSLCNetworkingModeNAT,
146 - WSLCNetworkingModeVirtioProxy
146 + WSLCNetworkingModeConsomme
147 } WSLCNetworkingMode;
148
149 typedef enum _WSLCFeatureFlags
@@ -154,7 +154,7 @@ typedef enum _WSLCFeatureFlags
154 WslcFeatureFlagsGPU = 4,
155 WslcFeatureFlagsVirtioFs = 8,
156 WslcFeatureFlagsDebug = 16,
157 - WslcFeatureFlagsPortRelayWslRelay = 32, // Use the wslrelay-based localhost port relay in VirtioProxy networking mode.
157 + WslcFeatureFlagsPortRelayWslRelay = 32, // Use the wslrelay-based localhost port relay in Consomme networking mode.
158 } WSLCFeatureFlags;
159
160 cpp_quote("#define WSLCFeatureFlagsValid (WslcFeatureFlagsDnsTunneling | WslcFeatureFlagsEarlyBootDmesg | WslcFeatureFlagsGPU | WslcFeatureFlagsVirtioFs | WslcFeatureFlagsDebug | WslcFeatureFlagsPortRelayWslRelay)")
src/windows/wslcsession/WSLCVirtualMachine.cpp
+6 -6
@@ -314,7 +314,7 @@ void WSLCVirtualMachine::Initialize()
314 Mount(m_initChannel, modulesDevice.c_str(), "", "ext4", "ro", WSLC_MOUNT::KernelModules);
315
316 // Discover the per-VM guest capabilities (currently the hv_pci swiotlb pool) and forward them
317 - // to the service so virtio device-options (virtiofs shares, VirtioProxy networking) can include
317 + // to the service so virtio device-options (virtiofs shares, Consomme networking) can include
318 // the swiotlb token.
319 ReadGuestCapabilities();
320
@@ -367,8 +367,8 @@ void WSLCVirtualMachine::ConfigureNetworking()
367 std::vector<WSLCProcessFd> fds;
368 fds.emplace_back(WSLCProcessFd{.Fd = -1, .Type = WSLCFdType::WSLCFdTypeDefault});
369
370 - // Virtio proxy forwards DNS via the host proxy, so the DNS channel and /gns args are only needed for NAT mode.
371 - const bool enableDnsTunneling = FeatureEnabled(WslcFeatureFlagsDnsTunneling) && m_networkingMode != WSLCNetworkingModeVirtioProxy;
370 + // Consomme forwards DNS via the host proxy, so the DNS channel and /gns args are only needed for NAT mode.
371 + const bool enableDnsTunneling = FeatureEnabled(WslcFeatureFlagsDnsTunneling) && m_networkingMode != WSLCNetworkingModeConsomme;
372 if (enableDnsTunneling)
373 {
374 fds.emplace_back(WSLCProcessFd{.Fd = -1, .Type = WSLCFdType::WSLCFdTypeDefault});
@@ -455,7 +455,7 @@ WSLCNetworkingMode WSLCVirtualMachine::NetworkingMode() const
455 bool WSLCVirtualMachine::UseWslRelayPortForwarding() const
456 {
457 return m_networkingMode == WSLCNetworkingModeNAT ||
458 - (m_networkingMode == WSLCNetworkingModeVirtioProxy && FeatureEnabled(WslcFeatureFlagsPortRelayWslRelay));
458 + (m_networkingMode == WSLCNetworkingModeConsomme && FeatureEnabled(WslcFeatureFlagsPortRelayWslRelay));
459 }
460
461 void WSLCVirtualMachine::WatchForExitedProcesses(wsl::shared::SocketChannel& Channel)
@@ -976,7 +976,7 @@ void WSLCVirtualMachine::MapPort(VMPortMapping& Mapping)
976
977 MapRelayPort(Mapping.BindAddress.si_family, Mapping.HostPort(), Mapping.VmPort->Port(), false);
978 }
979 - else if (m_networkingMode == WSLCNetworkingModeVirtioProxy)
979 + else if (m_networkingMode == WSLCNetworkingModeConsomme)
980 {
981 USHORT allocatedHostPort = 0;
982 auto result = m_vm->MapVirtioNetPort(
@@ -1023,7 +1023,7 @@ void WSLCVirtualMachine::UnmapPort(VMPortMapping& Mapping)
1023 {
1024 MapRelayPort(Mapping.BindAddress.si_family, Mapping.HostPort(), Mapping.VmPort->Port(), true);
1025 }
1026 - else if (m_networkingMode == WSLCNetworkingModeVirtioProxy)
1026 + else if (m_networkingMode == WSLCNetworkingModeConsomme)
1027 {
1028 THROW_IF_FAILED(m_vm->UnmapVirtioNetPort(
1029 Mapping.HostPort(), Mapping.VmPort->Port(), Mapping.Protocol, Mapping.BindingAddressString().c_str()));
src/windows/wslsettings/LibWsl.cs
+1 -1
@@ -52,7 +52,7 @@ namespace LibWsl
52 Nat = 1,
53 Bridged = 2,
54 Mirrored = 3,
55 - VirtioProxy = 4
55 + Consomme = 4
56 }
57
58 public enum MemoryReclaimMode
test/windows/NetworkTests.cpp
+52 -52
@@ -101,7 +101,7 @@ bool TryLoadWinhttpProxyMethods() noexcept
101 } \
102 }
103
104 -#define VIRTIOPROXY_TEST_ONLY() \
104 +#define CONSOMME_TEST_ONLY() \
105 { \
106 }
107
@@ -163,7 +163,7 @@ public:
163
164 namespace NetworkTests {
165
166 -class VirtioProxyTests;
166 +class ConsommeTests;
167
168 class NetworkTests
169 {
@@ -171,7 +171,7 @@ class NetworkTests
171
172 friend class MirroredTests;
173 friend class BridgedTests;
174 - friend class VirtioProxyTests;
174 + friend class ConsommeTests;
175
176 struct IpAddress
177 {
@@ -1802,7 +1802,7 @@ class NetworkTests
1802 WINDOWS_11_TEST_ONLY();
1803 __fallthrough;
1804 case wsl::core::NetworkingMode::Mirrored:
1805 - case wsl::core::NetworkingMode::VirtioProxy:
1805 + case wsl::core::NetworkingMode::Consomme:
1806 if (!LxsstuVmMode())
1807 {
1808 LogSkipped("This test is only applicable to WSL2");
@@ -4911,9 +4911,9 @@ class BridgedTests
4911 }
4912 };
4913
4914 -class VirtioProxyTests
4914 +class ConsommeTests
4915 {
4916 - WSL_TEST_CLASS(VirtioProxyTests)
4916 + WSL_TEST_CLASS(ConsommeTests)
4917
4918 std::optional<WslConfigChange> m_config;
4919
@@ -4923,7 +4923,7 @@ class VirtioProxyTests
4923
4924 if (LxsstuVmMode())
4925 {
4926 - m_config.emplace(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
4926 + m_config.emplace(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
4927 }
4928
4929 return true;
@@ -4940,9 +4940,9 @@ class VirtioProxyTests
4940
4941 WSL2_TEST_METHOD(SmokeTest)
4942 {
4943 - VIRTIOPROXY_TEST_ONLY();
4943 + CONSOMME_TEST_ONLY();
4944
4945 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
4945 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
4946
4947 // Verify that we have a working connection
4948 NetworkTests::GuestClient(L"tcp-connect:bing.com:80");
@@ -4950,9 +4950,9 @@ class VirtioProxyTests
4950
4951 WSL2_TEST_METHOD(InternetConnectivityV4)
4952 {
4953 - VIRTIOPROXY_TEST_ONLY();
4953 + CONSOMME_TEST_ONLY();
4954
4955 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
4955 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
4956
4957 if (!NetworkTests::HostHasInternetConnectivity(AF_INET))
4958 {
@@ -4965,9 +4965,9 @@ class VirtioProxyTests
4965
4966 WSL2_TEST_METHOD(InternetConnectivityV6)
4967 {
4968 - VIRTIOPROXY_TEST_ONLY();
4968 + CONSOMME_TEST_ONLY();
4969
4970 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
4970 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
4971
4972 if (!NetworkTests::HostHasInternetConnectivity(AF_INET6))
4973 {
@@ -4982,9 +4982,9 @@ class VirtioProxyTests
4982
4983 WSL2_TEST_METHOD(Configuration)
4984 {
4985 - VIRTIOPROXY_TEST_ONLY();
4985 + CONSOMME_TEST_ONLY();
4986
4987 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
4987 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
4988
4989 const auto state = NetworkTests::GetInterfaceState(L"eth0");
4990 VERIFY_IS_FALSE(state.V4Addresses.empty());
@@ -5007,9 +5007,9 @@ class VirtioProxyTests
5007
5008 WSL2_TEST_METHOD(ValidateMacAddress)
5009 {
5010 - VIRTIOPROXY_TEST_ONLY();
5010 + CONSOMME_TEST_ONLY();
5011
5012 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5012 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5013
5014 // eth0 should have wsldevicehost's default client MAC. Update if that default changes.
5015 VERIFY_ARE_EQUAL(GetMacAddress(L"eth0"), std::wstring(L"00:00:00:00:01:00"));
@@ -5017,9 +5017,9 @@ class VirtioProxyTests
5017
5018 WSL2_TEST_METHOD(GuestPortIsReleased)
5019 {
5020 - VIRTIOPROXY_TEST_ONLY();
5020 + CONSOMME_TEST_ONLY();
5021
5022 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5022 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5023
5024 // Make sure the VM doesn't time out
5025 WslKeepAlive keepAlive;
@@ -5045,9 +5045,9 @@ class VirtioProxyTests
5045
5046 WSL2_TEST_METHOD(LoopbackGuestToHost)
5047 {
5048 - VIRTIOPROXY_TEST_ONLY();
5048 + CONSOMME_TEST_ONLY();
5049
5050 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5050 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5051
5052 // Verify guest can connect to host on loopback (TCP only, UDP not supported)
5053 NetworkTests::VerifyLoopbackGuestToHost(L"127.0.0.1", IPPROTO_TCP);
@@ -5059,9 +5059,9 @@ class VirtioProxyTests
5059
5060 WSL2_TEST_METHOD(UdpBindDoesNotPreventTcpBind)
5061 {
5062 - VIRTIOPROXY_TEST_ONLY();
5062 + CONSOMME_TEST_ONLY();
5063
5064 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5064 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5065
5066 auto tcpPort = NetworkTests::BindGuestPort(L"TCP4-LISTEN:1234", true);
5067 auto udpPort = NetworkTests::BindGuestPort(L"UDP4-LISTEN:1234", true);
@@ -5069,9 +5069,9 @@ class VirtioProxyTests
5069
5070 WSL2_TEST_METHOD(HostUdpBindDoesNotPreventGuestTcpBind)
5071 {
5072 - VIRTIOPROXY_TEST_ONLY();
5072 + CONSOMME_TEST_ONLY();
5073
5074 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5074 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5075
5076 auto udpPort = NetworkTests::BindHostPort(2345, SOCK_DGRAM, IPPROTO_UDP, true);
5077 auto tcpPort = NetworkTests::BindGuestPort(L"TCP4-LISTEN:2345", true);
@@ -5079,36 +5079,36 @@ class VirtioProxyTests
5079
5080 WSL2_TEST_METHOD(PortZeroBindIsTracked)
5081 {
5082 - VIRTIOPROXY_TEST_ONLY();
5082 + CONSOMME_TEST_ONLY();
5083
5084 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5084 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5085
5086 NetworkTests::VerifyPortZeroBindIsTracked();
5087 }
5088
5089 WSL2_TEST_METHOD(PortZeroRebindSucceeds)
5090 {
5091 - VIRTIOPROXY_TEST_ONLY();
5091 + CONSOMME_TEST_ONLY();
5092
5093 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5093 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5094
5095 NetworkTests::VerifyPortZeroRebindSucceeds();
5096 }
5097
5098 WSL2_TEST_METHOD(HttpProxySimple)
5099 {
5100 - VIRTIOPROXY_TEST_ONLY();
5100 + CONSOMME_TEST_ONLY();
5101 WINHTTP_PROXY_TEST_ONLY();
5102
5103 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .autoProxy = true}));
5103 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .autoProxy = true}));
5104 NetworkTests::VerifyHttpProxySimple();
5105 }
5106
5107 WSL2_TEST_METHOD(ConfigurationV6)
5108 {
5109 - VIRTIOPROXY_TEST_ONLY();
5109 + CONSOMME_TEST_ONLY();
5110
5111 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5111 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5112
5113 if (!NetworkTests::HostHasInternetConnectivity(AF_INET6))
5114 {
@@ -5181,10 +5181,10 @@ class VirtioProxyTests
5181
5182 WSL2_TEST_METHOD(GuestPortIsReleasedV6)
5183 {
5184 - VIRTIOPROXY_TEST_ONLY();
5184 + CONSOMME_TEST_ONLY();
5185 WINDOWS_11_TEST_ONLY();
5186
5187 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5187 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5188
5189 // Make sure the VM doesn't time out
5190 WslKeepAlive keepAlive;
@@ -5210,9 +5210,9 @@ class VirtioProxyTests
5210
5211 WSL2_TEST_METHOD(ConfigurationV6DnsServers)
5212 {
5213 - VIRTIOPROXY_TEST_ONLY();
5213 + CONSOMME_TEST_ONLY();
5214
5215 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
5215 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
5216
5217 if (!NetworkTests::HostHasInternetConnectivity(AF_INET6))
5218 {
@@ -5235,62 +5235,62 @@ class VirtioProxyTests
5235
5236 WSL2_TEST_METHOD(DnsResolutionBasic)
5237 {
5238 - VIRTIOPROXY_TEST_ONLY();
5238 + CONSOMME_TEST_ONLY();
5239
5240 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = false}));
5240 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = false}));
5241 NetworkTests::VerifyDnsResolutionBasic();
5242 }
5243
5244 WSL2_TEST_METHOD(DnsResolutionDig)
5245 {
5246 - VIRTIOPROXY_TEST_ONLY();
5246 + CONSOMME_TEST_ONLY();
5247
5248 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = false}));
5248 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = false}));
5249 NetworkTests::VerifyDnsResolutionDig();
5250 }
5251
5252 WSL2_TEST_METHOD(DnsResolutionRecordTypes)
5253 {
5254 - VIRTIOPROXY_TEST_ONLY();
5254 + CONSOMME_TEST_ONLY();
5255
5256 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = false}));
5256 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = false}));
5257 NetworkTests::VerifyDnsResolutionRecordTypes();
5258 }
5259
5260 WSL2_TEST_METHOD(DnsResolutionBasicDnsTunneling)
5261 {
5262 - VIRTIOPROXY_TEST_ONLY();
5262 + CONSOMME_TEST_ONLY();
5263 DNS_TUNNELING_TEST_ONLY();
5264
5265 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = true}));
5265 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = true}));
5266 NetworkTests::VerifyDnsResolutionBasic();
5267 }
5268
5269 WSL2_TEST_METHOD(DnsResolutionDigDnsTunneling)
5270 {
5271 - VIRTIOPROXY_TEST_ONLY();
5271 + CONSOMME_TEST_ONLY();
5272 DNS_TUNNELING_TEST_ONLY();
5273
5274 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = true}));
5274 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = true}));
5275 NetworkTests::VerifyDnsResolutionDig();
5276 }
5277
5278 WSL2_TEST_METHOD(DnsResolutionRecordTypesDnsTunneling)
5279 {
5280 - VIRTIOPROXY_TEST_ONLY();
5280 + CONSOMME_TEST_ONLY();
5281 DNS_TUNNELING_TEST_ONLY();
5282
5283 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = true}));
5283 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = true}));
5284 NetworkTests::VerifyDnsResolutionRecordTypes();
5285 }
5286
5287 - // Verifies that virtio proxy + dnsTunneling points resolv.conf at the gateway, not the hvsocket listener IP.
5287 + // Verifies that Consomme + dnsTunneling points resolv.conf at the gateway, not the hvsocket listener IP.
5288 WSL2_TEST_METHOD(DnsTunnelingResolvConfUsesGateway)
5289 {
5290 - VIRTIOPROXY_TEST_ONLY();
5290 + CONSOMME_TEST_ONLY();
5291 DNS_TUNNELING_TEST_ONLY();
5292
5293 - m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy, .dnsTunneling = true}));
5293 + m_config->Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme, .dnsTunneling = true}));
5294
5295 const auto state = NetworkTests::GetInterfaceState(L"eth0");
5296 VERIFY_IS_TRUE(state.Gateway.has_value());
test/windows/PluginTests.cpp
+1 -1
@@ -684,7 +684,7 @@ class PluginTests
684 ConfigurePlugin(PluginTestType::WslcImagePull);
685
686 {
687 - auto session = CreateWslcSession(L"plugin-wslc-pull-test", WSLCNetworkingModeVirtioProxy);
687 + auto session = CreateWslcSession(L"plugin-wslc-pull-test", WSLCNetworkingModeConsomme);
688
689 // Load the registry and debian images.
690 LoadTestImage(*session, "debian:latest");
test/windows/PolicyTests.cpp
+5 -5
@@ -261,7 +261,7 @@ class PolicyTest
261
262 WSL2_TEST_METHOD(CustomNetworkingMode)
263 {
264 - WslConfigChange config(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
264 + WslConfigChange config(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
265
266 {
267 auto revert = SetPolicy(c_allowCustomNetworkingModeUserSetting, 1);
@@ -284,8 +284,8 @@ class PolicyTest
284 ValidateWarnings(L"");
285
286 // Validate that no warnings are shown if the default networking mode is set to the same value as .wslconfig.
287 - auto revertDefault = SetPolicy(c_defaultNetworkingMode, static_cast<DWORD>(wsl::core::NetworkingMode::VirtioProxy));
288 - config.Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::VirtioProxy}));
287 + auto revertDefault = SetPolicy(c_defaultNetworkingMode, static_cast<DWORD>(wsl::core::NetworkingMode::Consomme));
288 + config.Update(LxssGenerateTestConfig({.networkingMode = wsl::core::NetworkingMode::Consomme}));
289 ValidateWarnings(L"");
290 }
291 }
@@ -414,10 +414,10 @@ class PolicyTest
414 }
415
416 {
417 - auto revert = SetPolicy(c_defaultNetworkingMode, static_cast<DWORD>(wsl::core::NetworkingMode::VirtioProxy));
417 + auto revert = SetPolicy(c_defaultNetworkingMode, static_cast<DWORD>(wsl::core::NetworkingMode::Consomme));
418 WslShutdown();
419
420 - VERIFY_ARE_EQUAL(LxsstuLaunchWsl(L"wslinfo --networking-mode | grep -iF 'virtioproxy'"), 0u);
420 + VERIFY_ARE_EQUAL(LxsstuLaunchWsl(L"wslinfo --networking-mode | grep -iF 'consomme'"), 0u);
421 }
422 }
423
test/windows/UnitTests.cpp
+3 -3
@@ -2147,7 +2147,7 @@ Error code: Wsl/InstallDistro/WSL_E_DISTRO_NOT_FOUND
2147 validateWarnings(L"NoEqual", std::format(L"wsl: Expected '=' in {}:21\r\n", wslConfigPath));
2148 validateWarnings(
2149 L"networkingMode=InvalidMode",
2150 - std::format(L"wsl: Invalid value 'InvalidMode' for config key 'wsl2.networkingMode' in {}:2 (Valid values: Bridged, Mirrored, Nat, None, VirtioProxy)\r\n", wslConfigPath),
2150 + std::format(L"wsl: Invalid value 'InvalidMode' for config key 'wsl2.networkingMode' in {}:2 (Valid values: Bridged, Consomme, Mirrored, Nat, None, VirtioProxy)\r\n", wslConfigPath),
2151 L"[wsl2]\n");
2152 validateWarnings(
2153 L"networkingMode=a\\m", std::format(L"wsl: Invalid escaped character: 'm' in {}:2\r\n", wslConfigPath), L"[wsl2]\n");
@@ -2166,7 +2166,7 @@ Error code: Wsl/InstallDistro/WSL_E_DISTRO_NOT_FOUND
2166 validateWarnings(L"debugConsole=", std::format(L"wsl: Invalid boolean value '' for key 'wsl2.debugConsole' in {}:21\r\n", wslConfigPath));
2167 validateWarnings(
2168 L"networkingMode=",
2169 - std::format(L"wsl: Invalid value '' for config key 'wsl2.networkingMode' in {}:21 (Valid values: Bridged, Mirrored, Nat, None, VirtioProxy)\r\n", wslConfigPath));
2169 + std::format(L"wsl: Invalid value '' for config key 'wsl2.networkingMode' in {}:21 (Valid values: Bridged, Consomme, Mirrored, Nat, None, VirtioProxy)\r\n", wslConfigPath));
2170
2171 validateWarnings(
2172 L"ipv6=true\nipv6=false",
@@ -3563,7 +3563,7 @@ Error code: Wsl/InstallDistro/WSL_E_DISTRO_NOT_FOUND
3563 {NetworkingConfiguration::Nat, NetworkingConfiguration::Nat},
3564 {NetworkingConfiguration::Bridged, NetworkingConfiguration::Bridged},
3565 {NetworkingConfiguration::Mirrored, NetworkingConfiguration::Mirrored},
3566 - {NetworkingConfiguration::VirtioProxy, NetworkingConfiguration::VirtioProxy},
3566 + {NetworkingConfiguration::Consomme, NetworkingConfiguration::Consomme},
3567 };
3568
3569 // tuple: WslConfigSetting, expectedValue, actualValue
test/windows/WSLCTests.cpp
+21 -21
@@ -54,7 +54,7 @@ class WSLCTests
54
55 // The WSLC SDK tests use this same storage to reduce pull overhead.
56 m_storagePath = std::filesystem::current_path() / "test-storage";
57 - m_defaultSessionSettings = GetDefaultSessionSettings(c_testSessionName, true, WSLCNetworkingModeVirtioProxy);
57 + m_defaultSessionSettings = GetDefaultSessionSettings(c_testSessionName, true, WSLCNetworkingModeConsomme);
58 m_defaultSession = CreateSession(m_defaultSessionSettings);
59
60 wil::unique_cotaskmem_array_ptr<WSLCImageInformation> images;
@@ -782,7 +782,7 @@ class WSLCTests
782 // Validate that PullImage() fails appropriately when the session runs out of space.
783 {
784 auto settings = GetDefaultSessionSettings(L"wslc-pull-image-out-of-space", false);
785 - settings.NetworkingMode = WSLCNetworkingModeVirtioProxy;
785 + settings.NetworkingMode = WSLCNetworkingModeConsomme;
786 settings.MemoryMb = 1024;
787 auto session = CreateSession(settings);
788
@@ -3169,9 +3169,9 @@ class WSLCTests
3169 {
3170 auto result = ExpectCommandResult(session.get(), {"/bin/grep", "-iF", "nameserver ", "/etc/resolv.conf"}, 0);
3171
3172 - if (mode == WSLCNetworkingModeVirtioProxy)
3172 + if (mode == WSLCNetworkingModeConsomme)
3173 {
3174 - // Virtio proxy points resolv.conf at the eth0 gateway.
3174 + // Consomme points resolv.conf at the eth0 gateway.
3175 ExpectCommandResult(
3176 session.get(),
3177 {"/bin/sh",
@@ -3205,15 +3205,15 @@ class WSLCTests
3205 ValidateNetworking(WSLCNetworkingModeNAT, true);
3206 }
3207
3208 - TEST_METHOD(VirtioProxyNetworking)
3208 + TEST_METHOD(ConsommeNetworking)
3209 {
3210 - ValidateNetworking(WSLCNetworkingModeVirtioProxy);
3210 + ValidateNetworking(WSLCNetworkingModeConsomme);
3211 }
3212
3213 - TEST_METHOD(VirtioProxyNetworkingWithDnsTunneling)
3213 + TEST_METHOD(ConsommeNetworkingWithDnsTunneling)
3214 {
3215 WINDOWS_11_TEST_ONLY();
3216 - ValidateNetworking(WSLCNetworkingModeVirtioProxy, true);
3216 + ValidateNetworking(WSLCNetworkingModeConsomme, true);
3217 }
3218
3219 // DNS test helpers
@@ -3399,9 +3399,9 @@ class WSLCTests
3399 ValidatePortMapping(WSLCNetworkingModeNAT);
3400 }
3401
3402 - TEST_METHOD(PortMappingVirtioProxy)
3402 + TEST_METHOD(PortMappingConsomme)
3403 {
3404 - ValidatePortMapping(WSLCNetworkingModeVirtioProxy);
3404 + ValidatePortMapping(WSLCNetworkingModeConsomme);
3405 }
3406
3407 WSLC_TEST_METHOD(StuckVmTermination)
@@ -7962,17 +7962,17 @@ class WSLCTests
7962 RunPortMappingsTest(*session, "host", false);
7963 }
7964
7965 - WSLC_TEST_METHOD(PortMappingsVirtioProxy)
7965 + WSLC_TEST_METHOD(PortMappingsConsomme)
7966 {
7967 - auto [restore, session] = SetupPortMappingsTest(WSLCNetworkingModeVirtioProxy);
7967 + auto [restore, session] = SetupPortMappingsTest(WSLCNetworkingModeConsomme);
7968
7969 RunPortMappingsTest(*session, "bridge", true);
7970 RunPortMappingsTest(*session, "host", true);
7971 }
7972
7973 - WSLC_TEST_METHOD(PortMappingsVirtioProxyWslRelay)
7973 + WSLC_TEST_METHOD(PortMappingsConsommeWslRelay)
7974 {
7975 - auto [restore, session] = SetupPortMappingsTest(WSLCNetworkingModeVirtioProxy, WslcFeatureFlagsPortRelayWslRelay);
7975 + auto [restore, session] = SetupPortMappingsTest(WSLCNetworkingModeConsomme, WslcFeatureFlagsPortRelayWslRelay);
7976
7977 RunPortMappingsTest(*session, "bridge", false);
7978 RunPortMappingsTest(*session, "host", false);
@@ -7980,7 +7980,7 @@ class WSLCTests
7980
7981 WSLC_TEST_METHOD(PortMappingsAdvanced)
7982 {
7983 - auto [restore, session] = SetupPortMappingsTest(WSLCNetworkingModeVirtioProxy);
7983 + auto [restore, session] = SetupPortMappingsTest(WSLCNetworkingModeConsomme);
7984
7985 // Helper to resolve the first non-loopback IPv4 address on an active host adapter.
7986 auto getHostAdapterIpv4 = []() -> std::optional<std::string> {
@@ -11137,7 +11137,7 @@ class WSLCTests
11137
11138 // Phase 1: Create a session and inject a container with a corrupt WSLC metadata label via docker CLI.
11139 {
11140 - auto settings = GetDefaultSessionSettings(c_sessionName, false, WSLCNetworkingModeVirtioProxy);
11140 + auto settings = GetDefaultSessionSettings(c_sessionName, false, WSLCNetworkingModeConsomme);
11141 settings.StoragePath = storagePath.c_str();
11142 auto session = CreateSession(settings);
11143
@@ -11160,7 +11160,7 @@ class WSLCTests
11160 // Phase 2: Create a new session pointing to the same storage with a warning callback.
11161 auto warningCallback = Microsoft::WRL::Make<CapturingWarningCallback>();
11162
11163 - auto settings2 = GetDefaultSessionSettings(c_sessionName, false, WSLCNetworkingModeVirtioProxy);
11163 + auto settings2 = GetDefaultSessionSettings(c_sessionName, false, WSLCNetworkingModeConsomme);
11164 settings2.StoragePath = storagePath.c_str();
11165
11166 const auto sessionManager2 = OpenSessionManager();
@@ -11195,7 +11195,7 @@ class WSLCTests
11195
11196 // Phase 1: Create a session with a VHD volume, then get the VHD path.
11197 {
11198 - auto settings = GetDefaultSessionSettings(c_sessionName, false, WSLCNetworkingModeVirtioProxy);
11198 + auto settings = GetDefaultSessionSettings(c_sessionName, false, WSLCNetworkingModeConsomme);
11199 settings.StoragePath = storagePath.c_str();
11200 auto session = CreateSession(settings);
11201
@@ -11228,7 +11228,7 @@ class WSLCTests
11228 {
11229 auto warningCallback = Microsoft::WRL::Make<CapturingWarningCallback>();
11230
11231 - auto settings = GetDefaultSessionSettings(c_sessionName, false, WSLCNetworkingModeVirtioProxy);
11231 + auto settings = GetDefaultSessionSettings(c_sessionName, false, WSLCNetworkingModeConsomme);
11232 settings.StoragePath = storagePath.c_str();
11233
11234 const auto sessionManager = OpenSessionManager();
@@ -11266,7 +11266,7 @@ class WSLCTests
11266 // This bypasses our CreateVolume validation, leaving a volume that WSLCGuestVolumeImpl::Open will reject when the next
11267 // session recovers it.
11268 {
11269 - auto settings = GetDefaultSessionSettings(c_sessionName, false, WSLCNetworkingModeVirtioProxy);
11269 + auto settings = GetDefaultSessionSettings(c_sessionName, false, WSLCNetworkingModeConsomme);
11270 settings.StoragePath = storagePath.c_str();
11271 auto session = CreateSession(settings);
11272
@@ -11293,7 +11293,7 @@ class WSLCTests
11293 {
11294 auto warningCallback = Microsoft::WRL::Make<CapturingWarningCallback>();
11295
11296 - auto settings = GetDefaultSessionSettings(c_sessionName, false, WSLCNetworkingModeVirtioProxy);
11296 + auto settings = GetDefaultSessionSettings(c_sessionName, false, WSLCNetworkingModeConsomme);
11297 settings.StoragePath = storagePath.c_str();
11298
11299 const auto sessionManager = OpenSessionManager();
test/windows/wslc/WSLCCLISettingsUnitTests.cpp
+2 -2
@@ -305,7 +305,7 @@ class WSLCCLISettingsUnitTests
305 VERIFY_ARE_EQUAL(0u, s.Get<Setting::SessionCpuCount>());
306 VERIFY_ARE_EQUAL(0u, s.Get<Setting::SessionMemoryMb>());
307 VERIFY_ARE_EQUAL(1048576u, s.Get<Setting::SessionStorageSizeMb>());
308 - VERIFY_ARE_EQUAL(static_cast<int>(WSLCNetworkingModeVirtioProxy), static_cast<int>(s.Get<Setting::SessionNetworkingMode>()));
308 + VERIFY_ARE_EQUAL(static_cast<int>(WSLCNetworkingModeConsomme), static_cast<int>(s.Get<Setting::SessionNetworkingMode>()));
309 VERIFY_ARE_EQUAL(static_cast<int>(HostFileShareMode::VirtioFs), static_cast<int>(s.Get<Setting::SessionHostFileShareMode>()));
310 VERIFY_IS_TRUE(s.Get<Setting::SessionDnsTunneling>());
311 VERIFY_ARE_EQUAL(static_cast<int>(PortRelayType::VirtioNet), static_cast<int>(s.Get<Setting::SessionPortRelay>()));
@@ -372,7 +372,7 @@ class WSLCCLISettingsUnitTests
372 VERIFY_ARE_EQUAL(
373 Loc::WSLCUserSettings_Warning_InvalidValue(L"credentialStore", s.SettingsFilePath().wstring(), 3), s.GetWarnings()[1].Message);
374 // Values still fall back to built-in defaults.
375 - VERIFY_ARE_EQUAL(static_cast<int>(WSLCNetworkingModeVirtioProxy), static_cast<int>(s.Get<Setting::SessionNetworkingMode>()));
375 + VERIFY_ARE_EQUAL(static_cast<int>(WSLCNetworkingModeConsomme), static_cast<int>(s.Get<Setting::SessionNetworkingMode>()));
376 VERIFY_ARE_EQUAL(static_cast<int>(CredentialStoreType::WinCred), static_cast<int>(s.Get<Setting::CredentialStore>()));
377 }
378