Skip to content

Xanmod kernel for WSL2, built by clang with ThinLTO enabled. Build & Release are automated by Github Action.

License

Notifications You must be signed in to change notification settings

Locietta/xanmod-kernel-WSL2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xanmod-kernel-WSL2

Kernel CI Kernel LTS CI version

Unoffical XanMod port with dxgkrnl patched for WSL2, compiled by clang with ThinLTO enabled.

This repo holds an automated GitHub Action workflow to build and release WSL kernel images. It checks if newer upstream version is available everyday, and trigger the build&release process accordingly.

We are currently releasing both latest stable (MAIN) and LTS Xanmod kernels, LTS kernel builds are released with extra -lts suffix.

Usage

Manual Installation

  • Download kernel image from releases.
  • Place it to somewhere appropriate. (e.g. D:\.WSL\bzImage)
  • Save the .wslconfig in current user's home directory with following content:
[wsl2]
kernel = the\\path\\to\\bzImage
; e.g.
; kernel = D:\\.WSL\\bzImage
;
; Note that all `\` should be escaped with `\\`.
  • Reboot your WSL2 to check your new kernel and enjoy!

For more information about .wslconfig, see microsoft's official documentation.

Install via Scoop

scoop is a command-line installer on windows. If you have scoop installed, then you can install this kernel with following commands:

scoop bucket add sniffer https://github.com/Locietta/sniffer
scoop install xanmod-WSL2 # alias to xanmod-WSL2-x64v3

# other builds
# scoop install xanmod-WSL2-x64v2
# scoop install xanmod-WSL2-x64v4
# scoop install xanmod-WSL2-skylake

# LTS builds
# scoop install xanmod-WSL2-lts # alias to xanmod-WSL2-lts-x64v3
# scoop install xanmod-WSL2-lts-x64v2
# scoop install xanmod-WSL2-lts-x64v3
# scoop install xanmod-WSL2-lts-x64v4
# scoop install xanmod-WSL2-lts-skylake

Scoop will automatically set .wslconfig for you, but you still need a reboot of WSL2.

Update kernel

To update kernel for WSL2, you can use scoop update * if installed by scoop. Or you can just manually replace your kernel image with newer one.

NOTE: To make the kernel update applied, you have to reboot WSL2 (namely, wsl --shutdown and open a fresh WSL2 instance).

If you are interested in how we handle install and update with scoop, see scoop manifest for this kernel.

Miscs

Systemd

Compatible with built-in systemd support since WSL 0.67.6 and wsl-distrod for older WSL versions.

But sorah/subsystemd and arkane-systems/genie will refuse to work due to modified kernel version string (they demand "microsoft" in it...).

I'll not add "microsoft" back into the version string (it's quite long now), since "WSL2" is sufficient, see WSL#423. And you can check it with systemd-detect-virt, it should return wsl. I'll make a change if there's any update.

Credits

  • The Linux community for the awesome OS kernel.
  • Microsoft for WSL2 and dxgkrnl patches.
  • XanMod project for various optimizations.

Contributing

Sending an issue to let me know bugs, missing features or anything else.

Open a PR if you'd like to improve this repo.