skift
skift copied to clipboard
meta: fix launch script for WSL
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
After a bit of research, it appears that you can compile a custom kernel and enable KVM support within WSL.
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
After a bit of research, it appears that you can compile a custom kernel and enable KVM support within WSL.
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
elsestmt
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
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.