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.

So i tried asking to xen team but it didnā€™t solve my issue.

I also asked to the vendor of my laptop, NV41.
They told me to have a look at GitHub - ElliotKillick/qvm-create-windows-qube: Spin up new Windows qubes quickly, effortlessly and securely on Qubes OS.
They told me that in their latest test they ā€œobserved stability issues during the install if it was finished successfully it mostly worked.ā€

I followed every step. Including downloading the iso with mido.

Sometimes when running the script for the creation of a new winvm, i get a bsod (kmode exception not handled), so i delete the newly created qube and start again.

Windows vm can be created with this script but they donā€™t have internet connectivity.

The ā€œqvm-create-windows-qubeā€ script is stuck in ā€œCompleting setup of Qubes Windows Toolsā€¦ā€ and canā€™t go further.

Newly created winvm still get bsod after a while.

Wait. Are you telling that you could fire up Win10 HVM with QWT installed under Qubes v4.2x, only sometimes later while itā€™s up to get BSOD?

yes.

I got this bsod with and without QWT somewhere betwwen 2 minutes to maybe an hour after succesfully starting the windows HVM

Wow. were you aware that you were the only one who succeeded to fire it up at all with qwt?

I donā€™t think i am the only one.

I just followed the instructions, downgrading qwt to 4.1.69

I have never seen anyone else, but regardless, if you read those topics, you probably realized that no Win10/11 qube will work with qwt installed under Qubes v4.2., and there is ugly, but the only one workaround for that.

QWT installer works fine for me in Qubes OS 4.2 so it works for at least 2 people.

1 Like

Thatā€™s great to hear! Can you attach block devices, not as USB devices?

Is block device attachment with Xen PV Disk Drivers the only thing that is not working for you in QWT? Or nothing from QWT works at all (clipboard/file move/copy/etc)?
There seems to be an issue with Xen PV Disk Drivers and btrfs:

Iā€™ve tried attaching the block device to Windows qube with latest Xen drivers (not from QWT) and it worked before:

But the result could be inconsistent because of the issue with btrfs.

No. I canā€™t boot when qwt disk drivers are installed (any version, of any provider, not Qubes only). When I donā€™t install disk drivers, everything else works: USB attaching, file/commands manipulation, everything.

Iā€™ll look into that issue though, thanks.

Well, it looks like it was finally traced. What Iā€™m not sure at the first glance, can I manually disable direct IO, or will have to wait until new version of qubes-linux-utils?

Also, you donā€™t have btrfs? Cause I do.