Sysprogs forums › Forums › VisualGDB › Could not identify WSL2 Network Interface
Tagged: WSL2
- This topic has 7 replies, 4 voices, and was last updated 4 months ago by support.
-
AuthorPosts
-
November 16, 2023 at 02:41 #34988codefrogParticipant
VisualGDB stopped working last night, literally overnight.
Attempting to build an existing project, or create a new project, I get an error box “Could not identify the WSL2 network interface. No network interfaces with the (WSL) tag found.”
ifconfig reports this as one of the adapters
Ethernet adapter vEthernet (WSL (Hyper-V firewall)):
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::7cf3:1b6:5265:a75b%23
IPv4 Address. . . . . . . . . . . : 172.17.240.1
Subnet Mask . . . . . . . . . . . : 255.255.240.0
Default Gateway . . . . . . . . . :
I suspect that last night a Windows Update changed the default tag of the WSL vEthernet Adapter from “(WSL)” to “(WSL (Hyper-V firewall))” and that VisualGDB 5.9 / 6.0b3 is not able to cope with that.
* Is there an immediate fix for VisualGDB?
* Is there a workaround to change Windows’ name of the adapter?
* Should I be looking at rolling back the windows update?thanks
November 16, 2023 at 03:38 #34989codefrogParticipantSuuuuuper hacky workaround:
C:\Program Files (x86)\Sysprogs\VisualGDB\VisualGDBCore.dll contains the wide-string which is used to match the vEthernet adapter tag :
"(WSL)"
in wide character format at hex address 0xA388DA
00A388D0 00 31 00 36 00 7D 00 00 0D 20 00 28 00 57 00 53 .1.6.}... .(.W.S
00A388E0 00 4C 00 29 00 00 13 45 00 6D 00 70 00 74 00 79 .L.)...E.m.p.t.y
I changed the trailing ( to a space : “(WSL)” -> “(WSL ”
00A388D0 00 31 00 36 00 7D 00 00 0D 20 00 28 00 57 00 53 .1.6.}... .(.W.S
00A388E0 00 4C 00 20 00 00 13 45 00 6D 00 70 00 74 00 79 .L. ...E.m.p.t.y
…and now it works.
I assume that the code is searching a list of adapters for one whose name starts with
(WSL)
But Microsoft helpfully renamed from “(WSL)” to “(WSL (Hyper-V firewall))” and the “(WSL)” string search fails.
November 16, 2023 at 03:41 #34990codefrogParticipantAnd actually changing it from “(WSL)” to “(WSL” – truncating it to 4 characters – would have been even better (maybe?) so it would match either old or new format.
November 16, 2023 at 19:28 #34994supportKeymasterHi,
Thanks very much for pointing it out. We usually try to keep regular expressions and search strings in a separate file (%VISUALGDB_DIR%\Rules\RegularExpressions.xml) to facilitate exactly this kind of hotpatching, but the “(WSL)” rule wasn’t stored there yet.
Feel free to try this build: VisualGDB-6.0.4.5016.msi. We have updated the rule to match both new and old name, moved it to RegularExpression.xml (RegularExpressionCollection/Other/WSLInterfaceName), so it can be easily edited in case it changes again.
June 20, 2024 at 07:23 #35740kellac1ParticipantIs this still an issue? I am seeing the same error on my machine when trying to use WSL as an option to debug.
ipconfig shows
Ethernet adapter vEthernet (WSL):
(%VISUALGDB_DIR%)\Rules\RegularExpressions.xml have the following.
<Other>
<!-- <TimestampServerURL>http://timestamp.verisign.com/scripts/timstamp.dll</TimestampServerURL> -->
<TimestampServerURL>http://timestamp.comodoca.com/authenticode</TimestampServerURL>
<WSLInterfaceName> \(WSL (\(|\))</WSLInterfaceName>
</Other>
Why does it still not find the interface?
Any help would be appreciated. Thank you.
June 20, 2024 at 11:17 #35741supportKeymasterHi,
It should not be an issue anymore. Either way, you can try creating a new C# console application (using .Net framework, not .Net Core) with the following code:
var rg = new Regex(@" \(WSL (\(|\))"); var ifaces = NetworkInterface.GetAllNetworkInterfaces().Where(iface => rg.IsMatch(iface.Name)).ToArray();
Does it find the one-and-only WSL interface?
July 10, 2024 at 18:18 #35789urosgParticipantThis issue still persists where the interface name does not have a “description” inside brackets.
So for example the default regex will identify:
vEthernet (WSL (Hyper-V firewall))
but will not identify:
vEthernet (WSL)
This regex should identify either:
@" \(WSL (\(|\))|\(WSL\)"
July 23, 2024 at 14:51 #35816supportKeymasterOK, thanks very much for pointing this out. It turns out, when we moved the regex to the XML file and extended it to handle the (WSL (…)) syntax, it ended up with a typo, that still passed the test cases by coincidence.
We have updated the regex to
\(WSL(| \(.*\))\)
, covering both short and extended form.Feel free to update to this build: VisualGDB-6.0.103.5202.msi
-
AuthorPosts
- You must be logged in to reply to this topic.