|
1 |
| -# Windows-WSL2-Kernel-build-script |
2 |
| -## Build the latest released kernel from Microsoft's GitHub Page |
3 |
| - |
4 |
| -### Purpose |
5 |
| - - Build the latest Microsoft WSL2 kernel release to link to your current distros. |
6 |
| - |
7 |
| -### Supported Distros: |
8 |
| - - Ubuntu |
9 |
| - |
10 |
| -#### Supported architecture |
11 |
| - - x86_x64 |
12 |
| - |
13 |
| -### Install info |
14 |
| - - Run the below command in your WSL window |
15 |
| - ``` |
16 |
| - wget -qO build-kernel https://wsl2.optimizethis.net; sudo bash build-kernel |
17 |
| - ``` |
18 |
| - |
19 |
| - - The new kernel will be located in the root build directory |
20 |
| - - The filename will be: `vmlinux` |
21 |
| - - Place the file `vmlinux` into a folder inside Windows `%USERPROFILE%` |
22 |
| - - I placed mine into the folder I created called `%USERPROFILE%\WSL2\vmlinux` |
23 |
| - |
24 |
| - - Create a file called `%USERPROFILE%\.wslconfig` |
25 |
| - |
26 |
| - - Visit the below website for instructions on how to link the kernel to WSL2 |
27 |
| - - https://learn.microsoft.com/en-us/windows/wsl/wsl-config |
28 |
| - - You can also check out my person script that I use as well for ideas. |
29 |
| - |
30 |
| - My personal [.wslconfig](https://github.com/slyfox1186/windows-wsl2-kernel-build-script/blob/main/.wslconfig) file |
| 1 | +# Custom WSL2 Linux Kernel |
| 2 | + |
| 3 | +This repository is forked from the excellent [Windows WSL2 Kernel Build Script |
| 4 | +repo by |
| 5 | +slyfox1186](https://github.com/slyfox1186/windows-wsl2-kernel-build-script). |
| 6 | + |
| 7 | +This project aims to use GitHub Actions Workflows to produce and publish |
| 8 | +up-to-date, versioned custom builds of |
| 9 | +[WSL2-Linux-Kernel](https://github.com/microsoft/WSL2-Linux-Kernel) with |
| 10 | +[`HIDDEV`](https://docs.kernel.org/hid/hiddev.html) and |
| 11 | +[`HIDRAW`](https://docs.kernel.org/hid/hidraw.html) enabled. |
| 12 | + |
| 13 | +These custom kernels builds can be used to enable full Yubikey passthrough to |
| 14 | +WSL2 using [`usbipd`](https://github.com/dorssel/usbipd-win), with full FIDO2 |
| 15 | +functionality. |
| 16 | + |
| 17 | +The versioning scheme of this project matches the versioning scheme used by |
| 18 | +WSL2-Linux-Kernel. |
| 19 | + |
| 20 | +## Usage |
| 21 | + |
| 22 | +- Download the custom kernel from the releases page |
| 23 | +- Make sure you have saved all your work in all WSL2 instances |
| 24 | +- Shutdown all WSL2 instances with `wsl --shutdown` |
| 25 | +- Edit (or create) the ~/.wslconfig file on Windows |
| 26 | +- Specify the path to the custom kernel |
| 27 | + |
| 28 | +```ini |
| 29 | +# For example... |
| 30 | +[wsl2] |
| 31 | +kernel=C:\\Users\\YOUR_USERNAME\\Downloads\\vmlinux |
| 32 | +``` |
| 33 | + |
| 34 | +- Start a WSL2 instance |
| 35 | +- Check that the kernel is running with `uname -sr` |
| 36 | + |
| 37 | +``` |
| 38 | +Linux 5.15.123.1-lgug2z-custom-WSL2 |
| 39 | +``` |
0 commit comments