quickemu-project / quickemu

Quickly create and run optimised Windows, macOS and Linux virtual machines
MIT License
10.93k stars 479 forks source link

Using WSL in a Windows 10 VM causes booting to never end. #918

Closed miVimproved closed 7 months ago

miVimproved commented 9 months ago

Expected behaviour

I am able to boot after installing WSL on the emulator

Actual behaviour

It starts to boot but never goes past the screen where it says it's loading the bootloader.

Steps to reproduce the behaviour

  1. Create a Windows 10 VM.
  2. Install WSL with wsl --install on the VM.
  3. Restart the machine.

Quickemu output

quickget output:

ERROR! You must specify an operating system.
 - Operating Systems: alma alpine android antix archlinux archcraft arcolinux batocera blendos bodhi bunsenlabs cachyos centos-stream debian deepin devuan dragonflybsd easyos edubuntu elementary endeavouros endless fedora freebsd freedos garuda gentoo ghostbsd haiku holoiso kali kdeneon kolibrios kubuntu linuxlite linuxmint lmde mageia manjaro mxlinux netboot netbsd nixos lubuntu macos openbsd openindiana opensuse oraclelinux peppermint popos porteus reactos rebornos rockylinux siduction slackware solus spiral tails tinycore trisquel truenas-core truenas-scale ubuntu ubuntu-budgie ubuntucinnamon ubuntukylin ubuntu-mate ubuntu-server ubuntustudio ubuntu-unity vanillaos void vxlinux windows xerolinux xubuntu zorin

        You can also use this arguments:
        Only show ISO download URL
            --show-iso-url / -s {distro} {release} [edition]
        Test if ISO is available
            --test-iso-url / -t {distro} {release} [edition]
        Open distro homepage
            --open-distro-homepage / -o {distro}

Linux Distribution & Kernel

LSB Version:    n/a
Distributor ID: EndeavourOS
Description:    EndeavourOS Linux
Release:    rolling
Codename:   rolling
Linux 2023 6.7.2-arch1-2 #1 SMP PREEMPT_DYNAMIC Wed, 31 Jan 2024 09:22:15 +0000 x86_64 GNU/Linux
philclifford commented 9 months ago

Have you enabled nested virtualization before trying to install and run nested virtualization on your Windows VM ? Also the quickget output quoted is normal if you don't tell it what you want to fetch - you've presumably already fetched and run the Windows install so output from quickemu --vm windows-10.conf and any appropriate qemu logs might be helpful, but unless you have enabled nested virtualization on your host then nesting will not work.

flexiondotorg commented 7 months ago

Closed due to lack of response.

ranjan-purbey commented 2 months ago

This indeed is related to nested virtualization. Windows detects if it is running inside a VM and doesn't boot if WSL2 is enabled. The workaround is to hide the fact from windows that it's running in a VM.

Add the following line to windows-10.conf:

extra_args="-cpu Skylake-Client-v4,-hypervisor,+vmx,+invtsc,l3-cache=on,hv_passthrough"