windows icon indicating copy to clipboard operation
windows copied to clipboard

I got this error when booting up a windows 11 vm

Open SolarXYZ opened this issue 4 months ago • 14 comments

BdsDxe: failed to load Boot0002 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0xA,0x0)/Scsi(0x0,0x0): Not Found BdsDxe: loading Boot0001 "UEFI QEMU QEMU CD-ROM " from PciRoot(0x0)/Pci(0x5,0x0)/Scsi(0x0,0x0) BdsDxe: starting Boot0001 "UEFI QEMU QEMU CD-ROM " from PciRoot(0x0)/Pci(0x5,0x0)/Scsi(0x0,0x0) KVM: entry failed, hardware error 0xffffffff EAX=00000000 EBX=ea06f638 ECX=000000b2 EDX=000000b2 ESI=00000000 EDI=0000007a EBP=ea06f5a0 ESP=ea06f578 EIP=00008000 EFL=00000002 [-------] CPL=0 II=0 A20=1 SMM=1 HLT=0 ES =0000 00000000 ffffffff 00809300 CS =bd00 7ffbd000 ffffffff 00809300 SS =0000 00000000 ffffffff 00809300 DS =0000 00000000 ffffffff 00809300 FS =0000 00000000 ffffffff 00809300 GS =0000 00000000 ffffffff 00809300 LDT=0000 00000000 00000000 00000000 TR =0040 36cce000 00000067 00008b00 GDT= 36ccffb0 00000057 IDT= 00000000 00000000 CR0=00050032 CR2=6b9e17f8 CR3=0975b000 CR4=00000000 DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 DR6=00000000ffff0ff0 DR7=0000000000000400 EFER=0000000000000000 Code=qemu-system-x86_64: hw/core/cpu-sysemu.c:76: cpu_asidx_from_attrs: Assertion `ret < cpu->num_ases && ret >= 0' failed. KVM: entry failed, hardware error 0xffffffff ❯ ERROR: Forcefully terminating Windows, reason: 0... ❯ Shutdown completed!

SolarXYZ avatar Mar 07 '24 13:03 SolarXYZ

I have a laptop with AMD Ryzen 5500U with Radeon Graphics - 16GB RAM 512GB SSD and Vitrualization is enabled. and im running this on my windows laptop

SolarXYZ avatar Mar 07 '24 13:03 SolarXYZ

The relevant message is KVM: entry failed, hardware error 0xffffffff but I have no idea what hardware error 0xffffffff means as it is a message produced by QEMU and not my code. You can disable KVM in the compose file by setting

environment:
  KVM: "N"

And that will prevent the error, but its not a real solution because it will make it very slow to run.

kroese avatar Mar 07 '24 13:03 kroese

So how do i fix this without disabling kvm?

SolarXYZ avatar Mar 07 '24 13:03 SolarXYZ

I do not know. I Googled for that error, but I cant find any clear answer, it might be some incompatibility between the AMD 5500U and KVM, or some bug in QEMU. I know that this container works on most systems, but I cannot garantuee that it works on every system ofcourse.

kroese avatar Mar 07 '24 14:03 kroese

running something kvm based on a windows machine should not work if i'm not totally mistaken.

kvm is a linux kernel module, right? We cannot pass this from our windows host to a docker container.

HendrikHaase avatar Mar 07 '24 15:03 HendrikHaase

@HendrikHaase No, that is not true. If you use WSL2 on Windows you will have KVM and it works without issue. You are right that it is Linux based but Docker Desktop for Windows uses WSL2 (which is basicly a Linux environment for Windows).

kroese avatar Mar 07 '24 17:03 kroese

@HendrikHaase No, that is not true. If you use WSL2 on Windows you will have KVM and it works without issue. You are right that it is Linux based but Docker Desktop for Windows uses WSL2 (which is basicly a Linux environment for Windows).

ok, good i am wrong!

how do we go on, what can we test/try? i can replicate the exact same issue on my 5800x3d, windows11 w/ docker via wsl2

HendrikHaase avatar Mar 07 '24 17:03 HendrikHaase

I think i figured out what the problem is but i dont have a fix yet it cant find the vitrual disk

SolarXYZ avatar Mar 07 '24 20:03 SolarXYZ

I'm getting a slightly different error under WSL:

KVM: entry failed, hardware error 0x80000021

If you're running a guest on an Intel machine without unrestricted mode
support, the failure can be most likely due to the guest entering an invalid
state for Intel VT. For example, the guest maybe running in big real mode
which is not supported on less recent Intel processors.

Running lscpu in my WSL environment shows virtualization is available. As opposed to the original issue here, I have an Intel processor (i7-13700H). Is there anything special I need to do or enable for that?

mchughmk avatar Mar 08 '24 02:03 mchughmk

so @kroese how do i fix the error because it cant find the disk

SolarXYZ avatar Mar 08 '24 07:03 SolarXYZ

I also encountered a similar problem, there is no solution

bianningtao avatar Mar 08 '24 10:03 bianningtao

I think I figured out my particular issue, in case anyone else runs into it. I was assigning more RAM to the docker container than was available to the WSL VM. The fix is to either assign more RAM to WSL in the .wslconfig or work within the default RAM settings (50% of system or 8GB, whichever is less).

mchughmk avatar Mar 11 '24 18:03 mchughmk

@mchughmk @SolarXYZ I added a new flag now which disables a few features. Can you pull the new version (v2.07) and set:

environment:
  HV: "N"
  BOOT_MODE: "windows_plain"

in your compose file or

-e "KVM=N" -e "BOOT_MODE=windows_plain"

in your run command and see if it changes anything? It disables Secure Boot + TPM + Hyper-V and it might make a difference for you.

kroese avatar Mar 13 '24 09:03 kroese

@mchughmk @SolarXYZ I added a new flag now which disables a few features. Can you pull the new version (v2.07) and set:

environment:
  BOOT_MODE: "windows_plain"

in your compose file or

-e "BOOT_MODE=windows_plain"

in your run command and see if it changes anything? It disables Secure Boot + TPM + Hyper-V and it might make a difference for you.

Thank you, I've been running into the exact same issues as the users above (I have a Windows 11 Notebook with AMD Ryzen 7 6800HS, running docker from within WSL2). The boot_mode option kept the container from crashing as described in this issue.

vssn avatar Mar 15 '24 19:03 vssn

Hi, addind environment: BOOT_MODE: "windows_plain" solved the problem for me. AMD Ryzen 9 7900X

hristomirster avatar Apr 18 '24 08:04 hristomirster