-
-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The selected WSL distribution cannot be reached via the WSL virtual switch. #588
Comments
Just ran into this earlier after a lengthy period since last using usbip(-win) alongside a Kali WSL2 install. Worked flawlessly a month or two ago, but I am blaming myself here since in the meantime I have installed and setup the Windows Subsystem for Android (WSA) preview beta and as far as I can tell, it uses the same virtual networking method as WSL does, including creating a duplicate vSwitch for another vEthernet adapter. WSA uses the names (WSL Core) on the virtual devices and WSL is still using (WSL) named adapters. I can run both simultaneously and can even throw a virtualbox layer on it and get crazy with NAT and four virtual boxes + kali + Android all running and pinging each other. I am confident my local network settings are in order, but I am clueless about the way |
WSA could be the reason cause this issue showed up right after I installed WSA. Sadly I cant test it because of some important data. |
That is helpful for me then because I suspected it was the way Hyper-V is handling the vHardware setup on first run. The first time I installed WSA it also worked fine, but it had renamed and reassigned my original vEthernet (WSL) adapter that Windows alone has control over and won't retain any settings after restart. It's a problem because we can't do UDP over the WSL adapter and is related to why we have to re-roll a new local on a random subnet each time we restart WSL. It creates a whole new adapter each time. But anyway, last time it technically made changes I could not see or undo even if I wanted to and I had just a (WSL Core) virtual network setup. Right now I have both original WSL and WSL Core. WSA is presumably doing the exact same thing and right now, in such early beta, as long as they can exist with each other there isn't gonna be any focus on outlier niche things like sharing USB devices over TCP/IP with WSL2 lol. |
This is happening to me too, I have latest WSL and WSA (saw that maybe that's the problem..?), first I tried reinstalling my distribution, then all of WSL, and usbpid-win, still not working, it was working a few weeks ago... but I did mess around with WSA recently aswell... How can I get it working again? |
Sadly, I tried manually correcting this by way of Terminal, netsh and regedit and could not entirely fix the issue. Ultimately I was able to return network settings to a pre-WSA state, but my registry hacks caused my ControlPanelUI (settings.exe displayed via taskbar and tray) to lose my Ethernet Adapter entirely along with real-time traffic stats. It worked fine, Win 11 UI just forgot it was there and it was a blank space with no sub-menus. I gave up and did a system restore from an older clone. WSA seems to be the issue when setup alongside a pre-existing WSL2 install. Unfortunately the virtual adapter and switch are protected and locked down to the system account keeping everyone but Windows from making and viewing and controlling any changes. Makes sense from a security standpoint and sandboxing with a guarantee you have a clean env, but is worthless for doing debugging. |
I've had this problem as well. I did the following to resolve it
After these, the USB support withing WSL started working again. (I hope this helps) |
Reinstalling the driver doesn't help me.
on windows side I have this error in system log:
|
Are you certain the device you are trying to attach is supported? Also, have you tried detaching it all and then using the |
What do you mean by "device is supported"? It is shared with usbipd service on host side if you meant that. And reinstalling the driver removes the sharing, so you have to share it again. USB pass-through worked fine few months ago, but now all |
https://github.com/dorssel/usbipd-win/wiki/Tested-Devices That's what I meant by supported. Not every device works with the Windows daemon. Passthrough and this are very different things. Also make sure that the distro and kernel that had it working with passthrough are the same WSL2 distro and kernel. |
This is now a known issue. The "auto-switch-detection" simply looks for the first adapter containing the word "WSL". Apparently, the WSA "WSL Core" switch comes first, and that is (of course) not reachable from WSL. This code will be refactored, also to include the upcoming "mirrored" mode (see #714). Until then: just do not use the "WSL convenience command |
I'm having trouble running this in WSL I get the following
I had linux-tools-standard-WSL2 installed, switched to linux-cloud-tools-standard-WSL2 both had the same issue... |
See instructions in https://github.com/dorssel/usbipd-win/wiki/WSL-support#usbip-client-tools |
Again, really sorry for wasting your time, but now I'm getting this error:
|
Did you actually bind device 1-1? What is the output of |
In PS or WSL? WSL:
PowerShell:
|
"Not shared". You need to bind the device first, as per the main README. |
Ok, I did that, and now it shows as shared, but when I try to attach from within WSL, I get this error.
|
@yodaluca23 |
It looks like the issue in my case was some broken system state, after in-place upgrade that refreshed system components, everything works again, even the wsl remote commands from windows host on win11 23h2 and wsa installed |
Is there any ETA for this update? |
This issue/comments have been very helpful - thanks to all for the details. Adding a note because I believe this impacts more than just WSL customers who also have WSA (which was how I interpreted the conclusions from the comments here and related issue #136). My Windows 11 + WSL environment (never installed WSA) includes the following interfaces according to
I was running into the same errors about the WSL virtual switch - which makes sense because the root risk is apparently re-use of the string |
I also have the problem on win11 23h2 when i set the “networkingMode=mirrored". |
4.0.0 has been released, which should resolve this issue. Could you confirm? |
Assume you're looking for a confirmation from the original reporter, but can confirm that 4.0.0 and its README addressed the "selected WSL distribution cannot be reached via the WSL virtual switch" error for me (Win11 + WSL 2). Really appreciate the fix/doc updates and simplifications they deliver, @dorssel ! Note: I uninstalled 3.2.0 and installed 4.0.0 using MSI file from releases because the
Edit: |
@darrenhearn |
@yodaluca23
|
I tried it again and didn't get the warning, I ran the command anyway... OutPut:
|
These last results are what is expected. It does a quick check if the address can be reached, with a timeout of 1 second. For some reason, you got the earlier warning because it didn't respond within that 1 second. It is indeed spurious. |
With the current confirmations, I'll close this issue as resolved. |
winget install usbipd solved my problem |
About 2 weeks ago I managed to make my pl2303 USB to serial adapter work on wsl with usbipd. Today I want to try another device but sadly to find out it doesn't work anymore. I tried another distribution (
Debian
actually), but have no luck.Here's some information that I think might be helpful:
Both ip addr and subnet mask looks fine, and I can ping my wsl virtual machine from the host. I also checked firewall rules, but everything looks normal. Another issue mentioned the
-d
flag, which is definitely not my case.By the way, may I request a
verbose
mode similar to ssh so that I can know what is actually going on?The text was updated successfully, but these errors were encountered: