-
Notifications
You must be signed in to change notification settings - Fork 846
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 Kernel Add Bluetooth Support to microsoft-standard-WSL2 #12234
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done. If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it! Open similar issues:
Closed similar issues:
|
/feature |
Diagnostic information
|
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done. If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here Once completed please upload the output files to this Github issue. Click here for more info on logging |
/emailed-logs |
Diagnostic information
|
Did you build a custom kernel with this config? CONFIG_BT=y which Bluetooh adapter/brand is it? Build custom kernel:
Finally:
Check again. |
You could try this ad-hoc community project. Instructions in readme. This is a fork of the official kernal repo with necessary edits to enable building a BT enabled kernal. It is itself meant to be forked by yourself as per the instructions. This enables you to kick off a GitHub action for your target kernel that will build that kernel with BT support and spit it out in the GithHub artifacts for the run. I don't necessarily condone downloading precompiled kernels from random sources....but if you happen to be running WSL 5.15.153.1 (I believe the latest stable. You can check via I yolo'ed this and have working BT in WSL, even inside a devcontainer (docker wrapper) running on top of WSL. And I am also doing home assistant dev! I did have some issues getting the container part to work properly. The kernel alone is not enough. You need this in your
Your container needs to be bound to dbus properly for BT to work inside of it, as well as having the BT-enabled kernel. Here, I have a reference to Ubuntu, which is what I'm using, so change as necessary. Otherwise, even if WSL can see Bluetooth, the container won't. You are battling two issues: WSL BT support and docker configuration -- and I can at least say that I personally got into a state of confusion about which one of these I was dealing with at a given time. It was very finicky trying to find the working mount configuration, and the ones I found online did not work. It only worked for me with the fully qualified After all of this, I am able to consistently get a dev instance of home assistant running via devcontainer-on-wsl that has full access to the BT hardware, and demonstrably works in discovering and connecting to them via home assistant integrations. All that said, whilst there is support for building a special kernel, do we have any indication as to why it's not enabled by default and if that default will change in the future? There's a lot of headbanging around this topic, which I also went through, so it seems like there is a problem & community need for a more straightforward route. I think a lot of that demand is coming from the fact that the reality of the BT space is many projects and libs rely on dbus (e.g. Bluez), which is Linux only. So anyone touching dev around BT on Windows may opt for WSL, and that's when the headaches start. This is a small group of people but one with a clear and concentrated need. It would be great if there was a way to make the path easier! This thread comes up for people searching around similar issues so please feel free to ask me any questions about how I got it working. |
The default WSL2 Linux kernel comes without Bluetooth support. Provide a kernel with Bluetooth support. Reference implementations: - https://github.com/dathpo/wsl2-linux-kernel/tree/develop-5.15.y?tab=readme-ov-file#readme-fork Upstream Issue: - microsoft/WSL/issues/12234 Signed-off-by: Bernd Eichelberger <46166740+4-FLOSS-Free-Libre-Open-Source-Software@users.noreply.github.com>
The default WSL2 Linux kernel comes without Bluetooth support. Provide a kernel with Bluetooth support. Reference implementations: - https://github.com/dathpo/wsl2-linux-kernel/tree/develop-5.15.y?tab=readme-ov-file#readme-fork Upstream Issue: - microsoft/WSL/issues/12234 Signed-off-by: Bernd Eichelberger <46166740+4-FLOSS-Free-Libre-Open-Source-Software@users.noreply.github.com>
Fixes #82 The default WSL2 Linux kernel comes without Bluetooth support. Provide a kernel with Bluetooth support. Reference implementations: - https://github.com/dathpo/wsl2-linux-kernel/tree/develop-5.15.y?tab=readme-ov-file#readme-fork Upstream Issue: - microsoft/WSL/issues/12234 Signed-off-by: Bernd Eichelberger <46166740+4-FLOSS-Free-Libre-Open-Source-Software@users.noreply.github.com>
You'll also need the
This is (currently) |
I am trying to use the development environment for Home Assistant in VS Code using Docker Desktop. The Integration I am working on requires bluetooth connection to a piece of hardware. So the easiest way to get that working would be to pass a USB Bluetooth adapter to WSL.
That much works but once the USB bluetooth adapter is recognized by the container it wont load the bluetooth drivers/module because the WSL kernel does not have those enabled.
Once the USB bluetooth device is passed to the WSL container it should be able to use it.
Tried to build a custom kernel for using with WSL & Docker but didn't get it working.
(docker/for-win#14284)
The text was updated successfully, but these errors were encountered: