Locietta / xanmod-kernel-WSL2

Xanmod kernel for WSL2, built by clang with ThinLTO enabled. Build & Release are automated by Github Action.
GNU General Public License v2.0
88 stars 20 forks source link

WSL2 no longer loads when kernel version > 6.8.11 is used #65

Closed taalojarvi closed 5 months ago

taalojarvi commented 5 months ago

Hi @Locietta,

I recently updated the kernel and found out that it does not boot anymore. I triaged the issue and found out that versions of kernel subsequent to 6.8.11 no longer boot and produce the following error:

The operation timed out because a response was not received from the virtual machine or container.

Error code: Wsl/Service/CreateInstance/CreateVm/HCS_E_CONNECTION_TIMEOUT

I took the liberty of getting dmesg logs from WSL Debug Console for your reference. However, it does not seem to point to anything specific. But i suspect it has to do with 33d892f13f021a3f209242d71c35712ea1081961.

Hope this helps.

Locietta commented 5 months ago

Does 6.8.9-locietta-WSL2-xanmod1.3 works for you? That's the first release after 33d892f.

If 6.8.9-locietta-WSL2-xanmod1.2 works and 6.8.9-locietta-WSL2-xanmod1.3 fails then it should be the problem of CFI&CET thing...

taalojarvi commented 5 months ago

Does 6.8.9-locietta-WSL2-xanmod1.3 works for you? That's the first release after 33d892f.

If 6.8.9-locietta-WSL2-xanmod1.2 works and 6.8.9-locietta-WSL2-xanmod1.3 fails then it should be the problem of CFI&CET thing...

The last build of this kernel that boots on my machine is 6.8.9-locietta-WSL2-xanmod1.3.

All releases after this one have failed to boot upon testing.

Locietta commented 5 months ago

What CPU are you using to test the kernel?

taalojarvi commented 5 months ago

What CPU are you using to test the kernel?

I'm using the x64v3 build for my Ryzen 5 4500U

Locietta commented 5 months ago

What CPU are you using to test the kernel?

I'm using the x64v3 build for my Ryzen 5 4500U

Zen2 has no CET hardware though, maybe it's not 33d892f but something else. 6.8.11 works for my i5-9300H laptop, but 6.9.x does not. Toggling CFI/CET config does not help, still need more effort to investigate.

taalojarvi commented 5 months ago

Compiled a build after reverting 33d892f13f021a3f209242d71c35712ea1081961 and tested. Unfortunately, it produces the same issue.

I re-downloaded and retested 6.8.11 today on a clean slate. Confirmed working fine on my end.

image

6.8.9 still does not boot. Possible upstream issue?

Locietta commented 5 months ago

Finally get some spare time to test kernels this week. I just noticed there's a suspicious link warning in the log:

vmlinux.o: warning: objtool: nf_nat_handle_postrouting+0x291: can't find jump dest instruction at .text.nf_nat_handle_postrouting+0x14bf

Compiled after reverting upstream fullcone nftable patch and it finally boots. Though not sure how to fix this... image

Locietta commented 5 months ago

Hi, I've opened a PR to fix it, could you test kernels from https://github.com/Locietta/xanmod-kernel-WSL2/actions/runs/9576858987 to see if it works?

taalojarvi commented 5 months ago

Hi @Locietta,

The PR appears to have fixed the issue. System boots to prompt as intended now. image

Regards,

Karthik