skift icon indicating copy to clipboard operation
skift copied to clipboard

meta: fix launch script for WSL

Open tritium007 opened this issue 5 months ago • 3 comments

Adds detection for Windows Subsystem for Linux (WSL) to the Qemu backend. If the script is running under WSL, it automatically forces the use of the TCG accelerator (-accel tcg) instead of attempting to use KVM or other hardware acceleration. This change prevents errors related to missing KVM support in WSL environments and improves compatibility for users running the project on Windows.

Why?

WSL does not support KVM or other hardware virtualization, which causes QEMU to fail when those options are used.

ref: https://wiki.qemu.org/Documentation/TCG

tritium007 avatar May 18 '25 23:05 tritium007

After a bit of research, it appears that you can compile a custom kernel and enable KVM support within WSL.

Source

This change prevents errors related to missing KVM support in WSL environments and improves compatibility for users running the project on Windows.

Do you really have an error ? This should fall into the else stmt

keyboard-slayer avatar May 19 '25 17:05 keyboard-slayer

After a bit of research, it appears that you can compile a custom kernel and enable KVM support within WSL.

Source

This change prevents errors related to missing KVM support in WSL environments and improves compatibility for users running the project on Windows.

Do you really have an error ? This should fall into the else stmt

This will only fix the "qemu-system-x86_64: failed to initialize kvm: Permission denied" error. AFAIK starting with WSL 2, it comes with KVM by default but for some reason qemu doesn't work

tritium007 avatar May 19 '25 19:05 tritium007

This will only fix the "qemu-system-x86_64: failed to initialize kvm: Permission denied" error.

Looks like a permission error on your side. Did you try to fix the permission first? If not I've just found this tutorial online.

keyboard-slayer avatar May 20 '25 09:05 keyboard-slayer