WSL Bridge - Packet Diagram #8224
Replies: 7 comments 6 replies
-
It was suggested to view WSL switch configuruation and mapping to use commands with mixed result and maybe others can post means to map. I expected to see mapping of MAC of vNIC of Ubuntu Instance to map to MAC of some defined bridge interface.. but did not see that. Windows Admin Powershell
PS C:\WINDOWS\system32> get-hnsnetwork ActivityId : B3FFFB67-59A6-4954-9CBD-7048C9C33DBD ActivityId : 2A1EFB9A-258A-40EE-8201-044D4ABB5E40 PS C:\WINDOWS\system32>` WSL Instance side List of NICs from OS perspective Windows IP Configuration Host Name . . . . . . . . . . . . : laptop Ethernet adapter Ethernet: Media State . . . . . . . . . . . : Media disconnected Unknown adapter OpenVPN Wintun: Media State . . . . . . . . . . . : Media disconnected Ethernet adapter vEthernet (Default Switch): Connection-specific DNS Suffix . : Ethernet adapter Ethernet 5: Media State . . . . . . . . . . . : Media disconnected Unknown adapter NETGEAR-VPN: Media State . . . . . . . . . . . : Media disconnected Wireless LAN adapter Local Area Connection* 2: Media State . . . . . . . . . . . : Media disconnected Wireless LAN adapter Local Area Connection* 3: Media State . . . . . . . . . . . : Media disconnected Ethernet adapter Ethernet 2: Media State . . . . . . . . . . . : Media disconnected Wireless LAN adapter Wi-Fi: Connection-specific DNS Suffix . : local Ethernet adapter Bluetooth Network Connection: Media State . . . . . . . . . . . : Media disconnected Questions:
Thanks for responses |
Beta Was this translation helpful? Give feedback.
-
Update: After reboot , which I avoid like plague now due to the steps needed to get things back working with WSL, I have several weird things happen that may add needed color to above thread
|
Beta Was this translation helpful? Give feedback.
-
So after windows update came out.. did my normal set aside block of 30 min post update to do the "get WSL networking to work again" dance. As usual after reboot the NIC devices "Bridge"(bridge device), and "WSL" (HyperV Virtual external switch with mgmt bound and set to bridge to Gb NIC) were missing. Try routeine:
But ... all above.. normal poking in dark to get things working. But this time ... it is not working no matter which setups I try. When start WSL services up / restart along each step.. Pinging 8.8.8.8 with 32 bytes of data: Is there any registry key / ini file / command to figure out what WSL thinks is binding adapter is using... so I can correct it? |
Beta Was this translation helpful? Give feedback.
-
I am not trying to manage them. I am trying to get WSL to launch. When WSL configures itself I think it creates a binding to the bridge. But this bridge is not stable, goes away after reboot???? Not sure... but end result is I can start WSL services, but cannot launch the WSL instance .. the only output is that the interface is missing. What my post is asking is, what are the tools (registry keys, commands, etc...) to map how the WSL VM instance and its NIC maps to the bridge which maps to the HV Vswitch which bridges to a physical interface. In knowing that , I would hope to root cause why every reboot creates this discombobulated state. |
Beta Was this translation helpful? Give feedback.
-
Thanks... that was an important peice in that I now can see configuration events. From the reboot this AM there is over 360... so I just attached a few to see if I can pick apart where WSL can no longer start, and how to remediate (as noted removing windows feature no longer is fixing it, nor is remove / adding "WSL" HV switch). I am trying to find below litany of NIC and adapter IDs... within the registry or where I can see current vs what WSL references so maybe I can correct `C:\WINDOWS\system32> Get-WinEvent -ProviderName Microsoft-Windows-Hyper-V-VmSwitch ProviderName: Microsoft-Windows-Hyper-V-VmSwitch TimeCreated Id LevelDisplayName Message 4/13/2022 1:09:13 PM 232 Information NIC 9C49CC71-180E-480E-9434-B76BEA2ED675 (Friendly Name: Default Switch) successfully connected to port E7E8C081-7D10-4584-A6F4-751F36687B4F (Friendly Name: Container NIC 2ba129ba) on switch C08CB7B8-9B3C-408E-8E30... |
Beta Was this translation helpful? Give feedback.
-
I tried to make heads or tails of that tool output. I did a full removal of "ubuntu" and WSL (windows feature). Did a reinstall .. and .. I still have consistent error: ' Press any key to continue... ' Attached is output from file. The tool lacks any help and I googled around and did not find anything to help. All the devices it lists... are these the current set of NICs... (VPN , physical etc..) or is this just a bunch of orphaned WSL ones never cleaned up. Documentation on tool : https://docs.microsoft.com/en-us/virtualization/windowscontainers/kubernetes/common-problems My notes: The rest of the file is a bunch of Partition ID with associated what seems to be almost DMA / NIC ID to bridge Ex:' My guess: I need to figure out.. via some other means.. when WSL loads up.. what "NIC" it is trying to bind to. And then find that key in the registry and change it for current bridge that binds to HyperV switch "WSL" |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Version
Version 10.0.22000.556 (Windows 11)
WSL Version
Kernel Version
5.10.102.1
Distro Version
Ubuntu 20.04
Other Software
No response
Repro Steps
Related thread: https://docs.microsoft.com/en-us/answers/questions/788964/wsl-with-bridging-windows-11.html
Question:
WSL.
TOday I can get it to work with HyperV switch "WSL" binding to Gb NIC (with mgmt so base OS works), then enable bridging WSL virtual adapter to Gb NIC.. Total hack job but.. WSL then routes and so does OS. But.. this is 1) Brittle and has to be recomfigured each reboot 2) Is more of poking in the dark then tactically setting up packet paths 3) Does not afford configuration profiles where how I connect (Gb, vs Wifi, vs VPN Virtual adapter) based on where I have to work with laptop.
If someone can explain the data path and connection logic, as well as to "WSL is hidden HyperV guest" and if so.. WHy are we hiding this? What can we do at a command prompt to effect the environment?
Expected Behavior
I link WSL to a logical interface:
"Bridge" adapter -> to do L2 bridging to a given NIC, or, Bridge to hyperV switch, which then offloads communication under known HyperV connection setup.... such as link to interface, or internal etc..
I want to run a command, and get back "how is WSL connected" .. the vNIC is listed, and return back is to what device / NIC that the Windows OS controls.
Actual Behavior
It is hidden.
No commands exist to list what the virtual WSL host is connecting to
No means to track down links and so configuration
No means to change profile of bindings as host connections change: Ex: three profiles based on which "NIC" I have to link the WSL intance to.
Diagnostic Logs
Attached are images of trying to poke in the dark... to get things to work, as well as control with best practices.
Beta Was this translation helpful? Give feedback.
All reactions