-
Notifications
You must be signed in to change notification settings - Fork 822
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
WSL2: Ubuntu 18.04 Serial devices are no longer mounted properly #4322
Comments
It’s clearly called out in the FAQ that there is currently no support for USB in WSL2. I’d like to toss my voice in here that this should be a priority feature for WSL2. One of the big benefits of WSL2 is the opportunity to run Docker natively instead of on Docker for Windows. It is notoriously hard to get access to USB devices in Docker on non-Linux systems. I commonly use Docker for creating tool-chain images, but this falls apart when you’re working with embedded devices, where you need to connect to a USB device or serial port in order to flash/debug on device. If I can run a docker container natively and access USB ports with WSL2, I can make an extremely strong argument for switching from Mac to Windows. |
up |
so that why I cannot see my usb device in ubuntu.hurmmm |
It would be really nice if someone could chime in letting us know if this is even technically feasible. |
would love to know |
what a pity! i gotta roll back to wsl 1. Hopefully, usb support comes up soom for wsl2 |
Can I have the detailed step to roll back from WSL2 to WSL1 ? EDIT my current build number is below 18917 and should be WSL1, right ? But the USB COM PORT is not recognized in WSL env. My current os version:
|
I thought you could have WSL1 and WSL2 installed side by side? |
@rubberduck203 it's not clear to me how to check which WSL version we are running. It is not described in the app store. From online information I have found:
You can install both version if your build is higher than 18917. |
@tleroy-dev If your system supports WSL2, you can choose WSL1 or WSL2 per distro.
The normal recommendation is to use WSL2 for installation of all new WSL distros. Note, this doesn't affect your current installed WSL distros, if you have any already they will stay on WSL1.
If you want to manually upgrade a distro to WSL2 or "downgrade" it to WSL1, you can use
|
@bburky Thanks for your response.
From that documentation, it looks like the wsl.exe command works only on build higher than 1903, older version use wslconfig.exe. Result of equivalent :
It's in french in my case (system default), it does not output the version specifically, I guess from what I have described earlier, being on a pre-WSL2 build (17134) , only WSL 1 is enabled in my case. |
@tleroy-dev Yes, sounds like you're definitely on WSL1 then. |
I have opened a new ticket for my problem under WSL 1 (#5203) |
Any news regarding USB devices support in WSL2? |
Just upgraded to WSL2 for the native Docker integration, but frustrated that I can't continue to do Arduino development natively in WSL anymore without switching back and forth between WSL versions... any updates here? |
Same frustation and same behavior here... |
I'm also working with embedded system build environment, really need this too! |
This is a huge blocker as well. Using WSL1 as a workaround, but there needs to be some way to get USB->Serial working on WSL2. |
Any updates on this? This is a showstopper for moving to WSL for embedded Linux development. There are issues with buildroot + WSL1 so that's not an option either. |
I guess I can forget about installing Home Assistant under WSL2 anytime soon. My HUSBZB-1-USB-HUB won't mount. |
Another vote for this, being able to attach serial over usb embedded devices to my docker containers would be a game changer |
Bummer! I was happy to setup WSL 2 & install Ubuntu to build my project on linux. However i couldn't flash or access the serial/COM USB port from WSL 2. This feature is a huge blocker. Can you pull-in the device access support from WSL 1 immediately? |
I could really do with this to flash an embedded serial device. |
Arduino CIO here, as Arduino, we would like to contribute in making this happen. Allowing developers to work with WSL and Arduino boards would be fanstastic. As of now, our arduino-cli inside WSL does not allow people to see the list of the boards. Mainly related to #3099 and the closed one: #1929. Thank you for your great work! |
This would be the solution I think and has been available in VirtualBox and KVM for years. Even through a command I should be happy with because it will be scriptable then. I've switched to Linux full-time and virtualize Windows in kvm in case I need it because it seems that that gives me more options. |
just an idea: |
The answer is in the post by @dobromyslov
|
Despite the finality of the most recent response, I don't think this issue is settled at all. I have followed all of the steps outlined here. I can see and attach my USB to serial adapter in PowerShell:
I can see the USB device in WSL:
But when I list my TTY devices, I get:
However, as seen above, this device is assigned to COM8 in Windows, so I would expect to see it as ttyS8 in WSL. Unfortunately, it isn't listed. As I read it, this is literally the exact same issue that was initially posted about here 3+ years ago. I am running WSL2 on Windows 10, Ubuntu 20.04, Linux Core is 5.10.106.1. |
It will appear as |
I have exact same problem, have you found any solution yet? Please help me. |
@ackshooerry I also use prolific serial adapters, but from what I've tried the driver isn't included by default in the kernel. I did rebuild the kernel once and got my prolific adapters to work, but have since just bought FTDI USB serial cables as they work out of the box. Not sure if you did rebuild the kernel, or if that is these drivers are now included by default (last I tried was a few months ago). |
+1 Same issue - following the Pi pico install. $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2e8a:0003 Raspberry Pi RP2 Boot
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
$ ls -l /dev/ttyU*
ls: cannot access '/dev/ttyU*': No such file or directory
$ ls -l /dev/ttyS*
crw------- 1 root root 4, 64 Jan 14 10:08 /dev/ttyS0
crw------- 1 root root 4, 65 Jan 14 10:08 /dev/ttyS1
crw------- 1 root root 4, 66 Jan 14 10:08 /dev/ttyS2
crw------- 1 root root 4, 67 Jan 14 10:08 /dev/ttyS3
$ dmesg | grep tty
# no output |
+1 here as well. Can't get my Prolific device to show up as |
FWIW USBIP has worked wonders here.. windows> esptool.py erase_flash
"Access denied" # for a variety of devices; no other processes were using the devices & my terminal was elevated... installed USBIP & attach device to WSL $ uname -a
Linux pc 5.15.90.1-microsoft-standard-WSL2 #1 SMP Fri Jan 27 02:56:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
$ ls -lah /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Mar 30 04:37 /dev/ttyUSB0
$ dmesg | grep tty
[ 928.571117] usb 1-1: ch341-uart converter now attached to ttyUSB0
$ esptool erase_flash # 💩
A fatal error occurred: ESP8266 ROM does not support function erase_flash.
$ esptool --help | awk '/^esptool.py/ {print $2}'
v2.8
# dockerage? sure, why not.
$ docker run --rm -t -i --device=/dev/ttyUSB0 espressif/idf esptool.py erase_flash
Chip erase completed successfully in 13.9s
^ writing requires sudo apparently. |
This has been open for four years, rattling my inbox nonstop. Microsoft devs either needs to confirm that this is an intended major-feature removal and close the issue, or classify it as a major regression with known workaround (USBIP). The silence on such a key feature is unacceptable, and the level disrespect towards the developer community shown through four years of silence is unbelievable. Can we please have a triage statement from devs on where this issue stands, or at least what would be required from the community to develop a POR fix? |
We really need this feature |
Just a note: Not everyone here has the skillset and/or motivation to jump through hoops installing usbipd-win, build their own USB/IP-enabled WSL 2 kernel, and try to get them to talk to each other. I'm not even a developer... I'm just a regular guy who would like their USB dongle to actually work after installing Home Assistant. Currently, using it as VMWare VM on Win11. |
My guess is that Microsoft is using this as a lever to get people to upgrade to Win11 https://learn.microsoft.com/en-us/windows/wsl/connect-usb
|
Even if it is, in both cases once you have a compatible kernel, you still need to use the |
I agree, but the point is, I'd be surprised if full USB support ever came to Win10, even if it eventually arrives for Win11. Yes, I am cynical but I do have reasons... |
Of course it is. Who actually believes Microsoft is interested in Linux for the sake of advancing the free software community? |
I have read the entire thread, and I also join the bandwagon and ask if we can please get any timeline or news regarding this feature. The USBIPD is a nice workaround, but no replacement for native USB forwarding and multi-device auto-attaching which is present in VMware and VirtualBox. |
I've now installed VMWare, and it works perfectly well for my needs (Docker and access to USB devices) Sadly, it appears WSL1 and WSL2 are a waste of time for different reasons. |
I contributed to this thread with one of the earliest complaints. I think
it was nearly two years ago. It's sad to see that Microsoft cares so
little about this issue and it's confusing to me why they would
de-prioritize it. Back then, I came to the same conclusion as you and just
installed linux on VirtualBox.
…On Thu, Jul 6, 2023 at 3:54 AM bwims ***@***.***> wrote:
I've now installed VMWare, and it works perfectly well for my needs
(Docker and access to USB devices)
EVEN BETTER, it uses NAT and DHCP to get a SENSIBLE IP address!
Sadly, it appears WSL1 and WSL2 are a waste of time for different reasons.
—
Reply to this email directly, view it on GitHub
<#4322 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AETCO5RJFRV25ZLLWWYWPPDXO2KNXANCNFSM4IFGB36Q>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I was enjoying WSL but I gave up and moved to Linux completely. I still have Windows installed on another partition since some tools are Windows only, but most Windows applications that use serial port are so simple that run fine under Wine on Linux. |
This guide will walk through the steps necessary to connect a USB device to a Linux distribution running on WSL 2 using the USB/IP open-source project, usbipd-win. |
Still workaround. This feature should be built in WSL. |
I also gave up on windows and just use linux full time. https://www.codeweavers.com/crossover has been helpful in running any last software that regular wine didn't work with. |
I actually followed the steps here https://learn.microsoft.com/en-us/windows/wsl/connect-usb and I had it working for both windows 10 and 11 from what I can remember. I haven't needed to connect my FTDI serial to USB converter to WSL2 for a while and I just followed my notes and it's no longer working. I can attach the device to WSL2, but it no longer shows up in /dev/ttyUSB0 anymore. How do I fix that? |
@crose72 - You'll want/need to check the usbipd repo, likely. Note that there are a number of issues with some specific serial chips, like this one, many of which stem from the default kernel not containing certain drivers - you may need to compile one yourself. |
@Clockwork-Muse so it was working in July 2023 with my FTDI to USB, and I didn't change anything about my WSL2 setup so why would it just stop working? |
I'm the wrong person to ask, unfortunately. |
@Clockwork-Muse no worries, I'll try your suggestion all the same. Are there any FTDI to USB devices that you know work? If so I wouldn't mind getting one of those as a quick solution. |
It seems that we have a solution for the issue of @crose72 (and mine): dorssel/usbipd-win#948 (comment) |
Your Windows build number: Microsoft Windows [Version 10.0.18932.1000]
What you're doing and what's happening:
This works under WSL1 flawlessy, it no longer works in WSL2
in WSL2 we can clearly see it is not connected or configured
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3
The text was updated successfully, but these errors were encountered: