Skip to content
WSLHow-To July 12, 2026 1 min readViews unavailable

Running a Custom WSL 2 Kernel Without Losing the Supported Rollback Path

Build or select a compatible kernel, configure .wslconfig, preserve modules, and recover from an unbootable image.

Use Microsoft’s WSL kernel source/configuration as the baseline and change only required options. Preserve the official kernel path and exported distribution before testing. Build the architecture expected by the host and retain matching modules when a feature is modular.

Point .wslconfig at the absolute Windows path, run wsl --shutdown, and test a non-critical distribution first. Verify uname, devices, networking, filesystems, systemd, and Docker workloads.

If startup fails, remove the override and shut WSL down to return to the Microsoft kernel. Custom kernels shift update and security responsibility to you.

Sources: Microsoft WSL2 Linux kernel, Advanced WSL configuration