My personal WSL Linux kernel build configuration.
Highlights:
- Network block device (NBD) support.
- Internet Small Computer System Interface (iSCSI) support.
I always try to make my modification minimal, you can use diff
to see exactly
what changes I made:
diff WSL2-Linux-Kernel/Microsoft/config-wsl config-wsl
Note
I have also added the config-wsl.diff
and the kernel config .config
file
in the GitHub releases.
If you want to try the same configuration as mine, you can just copy the
config-wsl as .config
to your WSL kernel source tree and
compile it. Or you can download the prebuilt kernel and modules from the
release page.
Note
Please see the documentation on the .wslconfig configuration file for information on using a custom built kernel. And remember to install the kernel modules.
FYI, I use this Makefile to simplify the installation process:
# build the kernel & modules, the wsl-config is copied automatically
make build
# copy the kernel to C drive
make PREFIX=/mnt/c/path/to/your_installation install
# install the kernel modules
sudo make modules_install
# now you can edit your `.wslconfig` to use the custom kernel :)