|
1 | | -# WSL2 Kernel Builder |
| 1 | +# Let's build wsl2 kernels 🛠️ |
2 | 2 |
|
3 | | -This repository automates building custom WSL2 kernels using GitHub Actions. |
| 3 | +[](https://github.com/lenML/lets-build-wsl2-kernels/actions) |
| 4 | +[](LICENSE) |
4 | 5 |
|
5 | | -## Features |
| 6 | +This repository provides automated builds of Microsoft's official WSL2 kernel sources, compiling and releasing only the bzImage kernel files. |
6 | 7 |
|
7 | | -- Build any WSL2 kernel version from Microsoft's repository |
8 | | -- Manual trigger with custom version and config options |
9 | | -- Weekly automatic builds of the latest stable version |
10 | | -- Artifact with compiled kernel and config |
| 8 | +## Why This Exists ❓ |
11 | 9 |
|
12 | | -## Usage |
| 10 | +Microsoft maintains the [WSL2-Linux-Kernel](https://github.com/microsoft/WSL2-Linux-Kernel) but: |
| 11 | +- Doesn't provide pre-built historical kernel versions |
| 12 | +- Only distributes kernels through Windows Update |
| 13 | +- Makes it difficult to test different kernel versions |
| 14 | + |
| 15 | +This project: |
| 16 | +- Automates building official Microsoft kernel sources exactly as released |
| 17 | +- Provides access to historical kernel versions |
| 18 | +- Only distributes the compiled bzImage (kernel binary) |
| 19 | +- Does NOT provide or modify any vhdx files |
| 20 | + |
| 21 | +## Features ✨ |
| 22 | + |
| 23 | +- Builds any WSL2 kernel version from Microsoft's repository |
| 24 | +- Manual trigger with version selection |
| 25 | +- Weekly automatic builds of latest stable version |
| 26 | +- Provides only the bzImage kernel file |
| 27 | +- Clean builds with no modifications |
| 28 | + |
| 29 | +## Usage 🚀 |
13 | 30 |
|
14 | 31 | ### Manual Build via GitHub UI |
15 | 32 |
|
16 | 33 | 1. Go to "Actions" tab |
17 | 34 | 2. Select "Build WSL2 Kernel" |
18 | 35 | 3. Click "Run workflow" |
19 | | -4. Specify kernel version (e.g. `5.15.150.1`) |
20 | | -5. (Optional) Add extra config options (e.g. `CONFIG_USB_VIDEO_CLASS=y`) |
21 | | -6. Click "Run workflow" |
| 36 | +4. Specify kernel version (e.g. `5.15.90.1`) |
| 37 | +5. Click "Run workflow" |
22 | 38 |
|
23 | | -### Download and Use Built Kernel |
| 39 | +### Install Compiled Kernel |
24 | 40 |
|
25 | | -1. After build completes, download the artifact |
26 | | -2. Extract the `bzImage` file |
27 | | -3. Place it in your desired location (e.g. `C:\Windows\System32\lxss\tools`) |
28 | | -4. Create or modify `%USERPROFILE%\.wslconfig`: |
| 41 | +1. Download the bzImage artifact after build completes |
| 42 | +2. Place it in your preferred location (e.g. `C:\Windows\System32\lxss\tools`) |
| 43 | +3. Create/modify `%USERPROFILE%\.wslconfig`: |
29 | 44 |
|
30 | 45 | ```ini |
31 | 46 | [wsl2] |
32 | 47 | kernel=C:\\path\\to\\bzImage |
33 | 48 | ``` |
34 | 49 |
|
35 | | -5. Restart WSL: `wsl --shutdown` |
| 50 | +4. Restart WSL: `wsl --shutdown` |
36 | 51 |
|
37 | 52 | ### Local Build |
38 | 53 |
|
39 | | -To build locally, run: |
| 54 | +To build locally from official sources: |
40 | 55 |
|
41 | 56 | ```bash |
42 | | -./scripts/build.sh [version] [extra_config] |
| 57 | +./scripts/build.sh [version] |
43 | 58 | ``` |
44 | 59 |
|
45 | 60 | Example: |
46 | 61 | ```bash |
47 | | -./scripts/build.sh 5.15.150.1 "CONFIG_USB_VIDEO_CLASS=y" |
| 62 | +./scripts/build.sh 5.15.90.1 |
48 | 63 | ``` |
49 | 64 |
|
50 | | -## Supported Versions |
| 65 | +## Supported Versions 📦 |
| 66 | + |
| 67 | +All versions from Microsoft's [WSL2-Linux-Kernel](https://github.com/microsoft/WSL2-Linux-Kernel/tags) can be built. |
| 68 | + |
| 69 | +## License 📄 |
51 | 70 |
|
52 | | -Check available versions at [Microsoft's WSL2-Linux-Kernel repository](https://github.com/microsoft/WSL2-Linux-Kernel/tags) |
| 71 | +Kernel code is under Microsoft's original licenses. Build scripts are MIT licensed. |
0 commit comments