Skip to content

Fork of the Linux kernel used in Windows Subsystem for Linux 2 (WSL2) that enables Bluetooth support, complete with a CI pipeline for building the kernel image.

License

Notifications You must be signed in to change notification settings

dathpo/wsl2-linux-kernel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Readme (fork)

The default WSL2 Linux kernel comes without Bluetooth support. The aim of this fork is to provide a kernel image with Bluetooth support.

To build a custom kernel image:

  1. Open WSL, run uname -r and note down the kernel version
  2. Within the WSL kernel git repository, check out the branch that matches the version. The branches start with linux-msft-wsl-
  3. Cherry-pick and push the commit that adds a CI pipeline YAML file and enables Bluetooth options
  4. Once the CI pipeline is complete, download the job artifact, which contains the kernel image, bzImage
  5. Copy bzImage to C:\bzImage
  6. Create a file, C:\Users\<USER>\.wslconfig and write the following to it:
[wsl2]
kernel=C:\\bzImage
  1. In Windows, disable Bluetooth to allow the adapter to be attached to WSL
  2. In WSL, install the dependencies to use Bluetooth: sudo apt install dbus rfkill bluez
  3. From PowerShell, run wsl --shutdown to force loading new kernel
  4. Run usbipd list to find the Bluetooth adapter
  5. Run usbipd attach -b <BUS_ID> --wsl -a on the Bluetooth adapter to attach it to WSL

Introduction

The WSL2-Linux-Kernel repo contains the kernel source code and configuration files for the WSL2 kernel.

Reporting Bugs

If you discover an issue relating to WSL or the WSL2 kernel, please report it on the WSL GitHub project. It is not possible to report issues on the WSL2-Linux-Kernel project.

If you're able to determine that the bug is present in the upstream Linux kernel, you may want to work directly with the upstream developers. Please note that there are separate processes for reporting a normal bug and a security bug.

Feature Requests

Is there a missing feature that you'd like to see? Please request it on the WSL GitHub project.

If you're able and interested in contributing kernel code for your feature request, we encourage you to submit the change upstream.

Build Instructions

Instructions for building an x86_64 WSL2 kernel with an Ubuntu distribution are as follows:

  1. Install the build dependencies:
    $ sudo apt install build-essential flex bison dwarves libssl-dev libelf-dev
  2. Build the kernel using the WSL2 kernel configuration:
    $ make KCONFIG_CONFIG=Microsoft/config-wsl

Install Instructions

Please see the documentation on the .wslconfig configuration file for information on using a custom built kernel.

About

Fork of the Linux kernel used in Windows Subsystem for Linux 2 (WSL2) that enables Bluetooth support, complete with a CI pipeline for building the kernel image.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 98.4%
  • Assembly 0.9%
  • Shell 0.3%
  • Makefile 0.2%
  • Python 0.1%
  • Perl 0.1%