Windows VM BSOD (KMODE EXCEPTION NOT HANDLED) (IRQL NOT LESS OR EQUAL)

Hello fellow qubes users,

I have tried for quite some time but i am not able to have a stable windows-vm.
I successfully can run windows10 and windows11 but after a while (it can be 2min or 45min) i run into a blue screen KMODE EXCEPTION NOT HANDLED in windows10 (+ continous beeping when browser is playing music) and windows11 and sometimes i got IRQL NOT LESS OR EQUAL in windows11.

I followed those steps :
First, I created a windows template following the steps described here :

(After creation i set qvm-prefs WindowsNew qrexec_timeout 7200 and powercfg -H off in windows-vm)

Then I installed QWT following :

I tried with and without xen drivers - i seem to got the same result

After successfully install windows : I run a file check : sfc /scannow it usually repairs some files the first time, the next time i run it after a bsod and a reebot, it says its all ok.

I updated windows

I ran memory check, all is ok.

Before installing QWT, in device manager in windows, i have a yellow triangle in front of pci device.
I disabled the faulty driver in device manager in the windows-vm

Then i created an appvm based on that windows-vm.

So, i think it might be more of a hardware related issue…

when I run: journalctl -f -n0in dom0
I get a pcie bus error

The pcie bus error is probably due with my wifi card qualcomm atheros but the error is detected and corrected.
Similar to this issue : "PCIe Bus Error" for my Qualcomm Ethernet controller / Kernel & Hardware / Arch Linux Forums
So I suppressed this messages in case windows vm was having a hard time handling all those errors,
adding to dom0: /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pci=noaer"
and saving changes
Now nothing appears when i run journalctl -f -n0 in dom0

The problem description i have is similar to this one Windows Bluescreen ( KMODE EXCEPTION NOT HANDLED ) - #20 by lie
But I don’t think the error come from the cpu, but i still tried to disable Split Lock Detection on the Linux host.

Windows-vm seems a bit more stable following those steps, but stills crashes.

Should i run tailf and monitor from dom0 to monitor as described in the qubes doc for installing windows ? if so i can’t find tailf nor the files to check.

Here are the results of xl dmesg
result-from-xl-dmesg.log (8.4 KB)

and the stubdom log for win10 and win11 located in /var/log/xen/console/guest-VMNAME-dm.log
windows10pro.log (54.3 KB)
windows11pro.log (54.8 KB)

Can some one please help me to understand if there is errors in here ?
And where my issue might be ?
:slight_smile:

Do you have the same issue without QWT installed?

Yes, i get the same BSOD without QWT.

Windows10 : Kmode Exception Not Handled
Windows11 : Kmode Exception Not Handled and IRQL Not Less or Equal

For info i’m running qubes 4.2.2 but i had the same issue with this computer with qubes 4.1.

From an external ssd with debian, I tried running a windows-vm - with quickemu and virtualbox, it work, no bsod so far.
(I get the same pcie bus error (detected and corrected) in journalctl)

.

As a workaround, I am now trying to to convert VirtualBox VMs to Qubes HVMs as described here : Standalones and HVMs | Qubes OS

  • I have a .vdi file and not a .vmdk
  • I converted .vdi to raw with qemu : qemu-img convert -O raw win10.vdi win10.raw
  • (I first tried to create a new windows-template and boot from the raw file - without success - no bootable devices found)
  • i then copied the file to dom0 and created a new HVM as decribed - without success - vm is stuck for 15min at “booting from Hard Disk…”

Maybe something went wrong transfering the vdi file to qubes, i will try again later.

Don’t hesitate to give me a clue :slight_smile:

Maybe you’ve installed Windows VM in UEFI mode. The Qubes OS is using Legacy BIOS boot mode by default.
You can enable UEFI for a qube by setting uefi feature for it:
qvm-features <vm-name> uefi 1
And you need to add ovmf.bin in your dom0:

Boot from qube and if you end up in startup.nsh shell then enter exit to enter UEFI menu and in Boot Manger select WIndows boot menu entry.

Thank you.

WindowsVM was installed in legacy bios.

The issue was that i was too quick and skiped steps.

Workaround :

see : ‘Converting VirtualBox VMs to Qubes HVMs’ in Standalones and HVMs | Qubes OS

From an externall ssd connected to my laptop :

From QubesOs :

  • Copy your .ova file to a qubes

  • Extract your OVA tar archive
    tar -xvf *.ova

  • Convert vmdk to raw:
    (Increase size of qube if necessary to 60GB+)
    qemu-img convert -O raw *.vmdk win10.raw

  • Copy the root image file from the originating qube (here called untrusted) to a temporary location in dom0, typing this in a dom0 terminal:
    (increase dom0 size if needed)
    qvm-run --pass-io untrusted 'cat "/media/user/externalhd/win10.raw"' > /home/user/win10-root.img

  • From within dom0, create a new HVM (here called win10) with the root image we just copied to dom0 (change the amount of RAM in GB as you wish):
    (for a template change --standalone with --class TemplateVM)
    qvm-create --property=virt_mode=hvm --property=memory=4096 --property=kernel=‘’ --label red --standalone --root-move-from /home/user/win10-root.img win10

I now have a working Windows10VM, I also installed Qubes Windows Tools as described here : Qubes Windows Tools (QWT) | Qubes OS

No BSOD so far. QWT works.

never mind i just get a BSOD kMode exception not handled in my new windowsTemplate

It’s starting to driving me crazy that i seem to be the only one to have this issue

If it works in other hypervisors e.g. KVM then maybe it’s Xen-specific issue and you can try to ask this question in Xen matrix channel or mailing list:
Matrix - Xen Project
Mailing Lists - Xen Project
Maybe they’ll be able to help debugging it.