|
| 1 | +--- |
| 2 | +title: Custom kernels on WSL |
| 3 | +description: Using custom kernels with Docker Desktop on WSL 2 |
| 4 | +keywords: wsl, docker desktop, custom kernel |
| 5 | +tags: [Best practices, troubleshooting] |
| 6 | +aliases: |
| 7 | +- /desktop/wsl/custom-kernels/ |
| 8 | +--- |
| 9 | + |
| 10 | +Docker Desktop depends on several kernel features built into the default |
| 11 | +WSL 2 Linux kernel distributed by Microsoft. Because of that, **using a |
| 12 | +custom kernel with Docker Desktop on WSL 2 is not officially supported** |
| 13 | +and may cause issues with Docker Desktop startup or operation. |
| 14 | + |
| 15 | +At the same time, we understand that in some cases it may be necessary |
| 16 | +to run custom kernels; Docker Desktop does not block their use, and |
| 17 | +some users have reported success using them. |
| 18 | + |
| 19 | +If you choose to use a custom kernel, we suggest starting |
| 20 | +from the kernel tree distributed by Microsoft at their [official |
| 21 | +repository](https://github.com/microsoft/WSL2-Linux-Kernel) and adding |
| 22 | +the features you need on top of that. |
| 23 | + |
| 24 | +We suggest to: |
| 25 | +- Use the same kernel version as the one distributed by the latest WSL2 |
| 26 | +release (you can find the version by running `wsl.exe --system uname -r` |
| 27 | +in a terminal). |
| 28 | +- Start from the default kernel configuration as provided by Microsoft |
| 29 | +in their [repository](https://github.com/microsoft/WSL2-Linux-Kernel) |
| 30 | +and add the features you need on top of that. |
| 31 | +- Make sure that your kernel build environment includes `pahole` and |
| 32 | +its version is properly reflected in the corresponding kernel config |
| 33 | +(`CONFIG_PAHOLE_VERSION`). |
| 34 | + |
0 commit comments