feat: Support rolling kernel versions officially via config file.
Is your feature request related to a problem? Please describe. The current version of WSL only supports LTS kernels built by Microsoft officially. It may lack features and contain security vulnerabilities. Some distros like Arch Linux naturally expects a rolling kernel.
Describe the solution you'd like
It would be great if Microsoft offered official release channels (LTS as default, rolling stable, nightly, real-time, etc) instead of having to piece together a community release using the kernel and kernelModules options in .wslconfig pointing to a local path. This would provide more official support for newer kernels and CVEs. Something like kernelRelease and kernelReleaseChannel could work well.
# 🚨 -- MOCK EXAMPLE CONFIG ONLY
# .wslconfig or /etc/wsl.conf per-distribution
kernelRelease=7.0
kernelReleaseChannel=stable | lts | nightly
# 🚨 -- MOCK EXAMPLE CONFIG ONLY
In which case, Windows would include some service installed to fetch the release each night (if you are on nightly channel) just like scoop.
Even better would be applying this in wsl.exe such that output could be verbosely printed:
# 🚨 -- MOCK EXAMPLE CONFIG ONLY
❯ wsl -l -v
NAME STATE VERSION KERNEL
* numbat Running 2 7.0-stable
arch Running 2 7.0-nightly
jammy Stopped 2 6.7-stable
# 🚨 -- MOCK EXAMPLE CONFIG ONLY
Most people aren't going to have any interest or need to compile a custom kernel (or seek out community built kernels) but having some casual-user-friendly porcelain in wsl.exe to switch official kernel release channels would be nice.
Describe alternatives you've considered Manage kernels like a real linux distro using distro packages and wsl would inject kernel modules.
Additional context Outdated kernels may have CVEs Example: #40365
Logs are required for review from WSL team
If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise, please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.
How to collect WSL logs
Download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1
The script will output the path of the log file once done.
If this is a networking issue, please use .\collect-wsl-logs.ps1 -LogProfile networking instead, following the instructions in Collect WSL logs for networking issues
Once completed please upload the output files to this GitHub issue.
See Collect WSL logs (recommended method).
If you choose to email these logs instead of attaching them to the bug, please send them to [email protected] with the GitHub issue number in the subject, and include a link to your GitHub issue comment in the message body, and reply with '/emailed-logs'.
@pztrick @RageGen continue here.
/feature
Diagnostic information
Found '/feature', adding tag 'feature'
So, as I mentioned in the previous thread, I’ll outline my thoughts again, with some additional points. I’m confused about the use of a container-based (LXC-type) model within WSL, where everything depends on a kernel fork created by Microsoft, because, first, it takes effort to maintain that fork itself, and second, there are security concerns, as we saw with the CVE example. Although I understand that this was done to simplify things compared to the standard containerization model, to provide access to hardware (such as CUDA cores, if we’re talking about NVIDIA) through a compatibility layer, and to ensure integration with Windows as a whole. However, it is unclear to me why this cannot be achieved by implementing a separate, immutable package in addition to the standard Linux kernels and limiting its distribution solely to WSL builds. Again, the point of a rolling release distribution, as exemplified by Arch, is lost when we are limited to kernel 6.6 and a host hypervisor in the form of the base WSL.
It's nice to want this feature but I wouldn't hold my breath. This would require major revamp of WSL2 arch. From the beginning it has been architecture as one single VM, with each "distro" a container with custom features added in (that's why WSL "distro" can be imported from docker os images OOB).
Having different kernel would mean multiple WSL VM instance.
@sarim I understand, of course. As well as the fact that it’s a massive amount of work that might be unnecessary.
It's nice to want this feature but I wouldn't hold my breath. This would require major revamp of WSL2 arch. From the beginning it has been architecture as one single VM, with each "distro" a container with custom features added in (that's why WSL "distro" can be imported from docker os images OOB).
Having different kernel would mean multiple WSL VM instance.
We could maintain the same architecture by avoiding multiple kernel instances, but provide different kernel channels like LTS, rolling, and more. A single kernel would power all containers, while versions could be switched using .wslconfig or the GUI app.
@fluentmoheshwar Actually, the GUIs aren't that important; what matters is simply being able to change them, even if only through the CLI.
@fluentmoheshwar Actually, the GUIs aren't that important; what matters is simply being able to change them, even if only through the CLI.
actually WSL have a GUI app
@fluentmoheshwar i know, thanks. But I don't use it :]
🚨 -- MOCK EXAMPLE CONFIG ONLY
.wslconfig or /etc/wsl.conf per-distribution
kernelRelease=7.0 kernelReleaseChannel=stable | lts | nightly
🚨 -- MOCK EXAMPLE CONFIG ONLY
🚨 -- MOCK EXAMPLE CONFIG ONLY
❯ wsl -l -v NAME STATE VERSION KERNEL
- numbat Running 2 7.0-stable arch Running 2 7.0-nightly jammy Stopped 2 6.7-stable