Jump to content

VM stuck in boot loop with video passthrough (now code 43 error)


bobbintb

Recommended Posts

I recently added a GTX 950 to my VM. I was just using RDP before. I installed the driver but when I rebooted device manager said Windows stopped the driver because of an error 43. I uninstalled everything Nvidia, rebooted, and tried to reinstall the driver (over RDP) but now the VM crashes after a bit and is stuck in a boot loop. I read a few posts about this and they suggested also passing through the audio. I did that but I am still having the issue. Here is my xml:

 

<domain type='kvm' id='6'>
  <name>Windows 10 test 2</name>
  <uuid>417213c5-f75f-17d3-90f9-70ced9e5dc93</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>24641536</memory>
  <currentMemory unit='KiB'>24641536</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>6</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
    <vcpupin vcpu='2' cpuset='2'/>
    <vcpupin vcpu='3' cpuset='4'/>
    <vcpupin vcpu='4' cpuset='5'/>
    <vcpupin vcpu='5' cpuset='6'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-q35-2.5'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor id='none'/>
    </hyperv>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='3' threads='2'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='hypervclock' present='yes'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/UnRAID/virtio-win-0.1.118-2.iso'/>
      <backingStore/>
      <target dev='hdb' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source dev='/dev/sdb'/>
      <backingStore/>
      <target dev='hdc' bus='sata'/>
      <boot order='1'/>
      <alias name='sata0-0-2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source dev='/dev/sdd'/>
      <backingStore/>
      <target dev='hdd' bus='sata'/>
      <alias name='sata0-0-3'/>
      <address type='drive' controller='0' bus='0' target='0' unit='3'/>
    </disk>
    <controller type='usb' index='0' model='nec-xhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1f' function='0x2'/>
    </controller>
    <controller type='pci' index='0' model='pcie-root'>
      <alias name='pcie.0'/>
    </controller>
    <controller type='pci' index='1' model='dmi-to-pci-bridge'>
      <model name='i82801b11-bridge'/>
      <alias name='pci.1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1e' function='0x0'/>
    </controller>
    <controller type='pci' index='2' model='pci-bridge'>
      <model name='pci-bridge'/>
      <target chassisNr='2'/>
      <alias name='pci.2'/>
      <address type='pci' domain='0x0000' bus='0x01' slot='0x01' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:b1:7e:a0'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x01' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-Windows 10 test 2/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <hostdev mode='subsystem' type='pci' managed='yes' xvga='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x03' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x06' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x04' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
      </source>
      <alias name='hostdev2'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x05' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x046d'/>
        <product id='0xc24a'/>
        <address bus='2' device='10'/>
      </source>
      <alias name='hostdev3'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x1038'/>
        <product id='0x0510'/>
        <address bus='2' device='11'/>
      </source>
      <alias name='hostdev4'/>
    </hostdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x02' slot='0x06' function='0x0'/>
    </memballoon>
  </devices>
</domain>

Link to comment

Just some questions.

 

Can you boot into windows now or is it stuck in a loop?

 

Have you removed the gpu passthough and changed it to vnc, if you cant boot into windows? (Also remove gpu passthrough and use vnc for graphics if removing drivers)

 

I see you are passing through a few disks physically. So are you editing your xml manually or using the vm manager?

 

Link to comment

Just some questions.

 

Can you boot into windows now or is it stuck in a loop?

 

Have you removed the gpu passthough and changed it to vnc, if you cant boot into windows? (Also remove gpu passthrough and use vnc for graphics if removing drivers)

 

I see you are passing through a few disks physically. So are you editing your xml manually or using the vm manager?

 

It's stuck in a loop if I use GPU passthrough. I don't have to be doing anything for it to happen. After a few minutes of it being on I will lose connection with it and when I remote back in it has obviously been restarted. If I go back to VNC it's fine.

 

I have a physical SSD that I use for the VM boot disk (and some other drive I use for temp storage that I probably should remove). This VM was a physical machine at one point and then I converted it and moved it to UnRAID. At the time, I had to do this manually by editing the XML but it seems the VM manager is more capable now. When I switch back and forth between GPU passthrough and VNC I don't seem to need to edit the XML manually. At least it didn't appear to lose any setting like it did before when I checked with a diff comparison tool and I've been switching back and forth between passthrough and VNC that way and it hasn't caused an issue.

 

As a side note, I've been meaning to get this done for a while and the last time I researched it I seem to remember making a mental note that I needed to change something in the UEFI in regard to the on-board video before I enabled GPU passthrough. However, before I went to make that change the other day, I noticed the GPU was available as an option in the VM setting so I thought maybe I was wrong or something changed between now and then and it was no longer necessary so I never went to the UEFI to make changes. Maybe that's it.

Link to comment

If you originally used the machine bare metal with the same GPU, you may need to clean up devices in the device manager.

 

Boot with your VNC so it actually gets to a working desktop.

Open Device Manager.

Configure it to show hidden devices.

Navigate around to places like display adapters and such.

Delete all of the devices which appear grayed out as "disconnected."

Shut down cleanly.

 

Now try rebooting with the GPU passed in. It should at least detect it as a basic VGA adapter and allow you to install the drivers again. Bonus points if it installs the drivers again automatically.

Link to comment

If you originally used the machine bare metal with the same GPU, you may need to clean up devices in the device manager.

 

Boot with your VNC so it actually gets to a working desktop.

Open Device Manager.

Configure it to show hidden devices.

Navigate around to places like display adapters and such.

Delete all of the devices which appear grayed out as "disconnected."

Shut down cleanly.

 

Now try rebooting with the GPU passed in. It should at least detect it as a basic VGA adapter and allow you to install the drivers again. Bonus points if it installs the drivers again automatically.

 

Thanks, that fixed the issue. I had already tried cleaning up the drivers but did not think to show the hidden devices and clear those up. However now I am getting this error in device manager after installing the driver:

 

Windows has stopped this device because it has reported problems. (Code 43)

Link to comment

Now you need to delete:

 

    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor id='none'/>
    </hyperv>

 

And:

 

<timer name='hypervclock' present='yes'/>

 

And restart the VM, then reinstall the drivers.

Link to comment

If you originally used the machine bare metal with the same GPU, you may need to clean up devices in the device manager.

 

Boot with your VNC so it actually gets to a working desktop.

Open Device Manager.

Configure it to show hidden devices.

Navigate around to places like display adapters and such.

Delete all of the devices which appear grayed out as "disconnected."

Shut down cleanly.

 

Now try rebooting with the GPU passed in. It should at least detect it as a basic VGA adapter and allow you to install the drivers again. Bonus points if it installs the drivers again automatically.

 

Thanks, that fixed the issue. I had already tried cleaning up the drivers but did not think to show the hidden devices and clear those up. However now I am getting this error in device manager after installing the driver:

 

Windows has stopped this device because it has reported problems. (Code 43)

 

If you still have vnc enabled be sure to disable it.

Link to comment

I tried did as suggested but I am still having issues. I removed the lines from the XML but it got stuck in another boot loop. I got it out of the loop again but now I am back to the error 43, except the lines are still gone from the XML. I'm going to try again tomorrow because it's late and maybe I messed something up.

Link to comment

I tried did as suggested but I am still having issues. I removed the lines from the XML but it got stuck in another boot loop. I got it out of the loop again but now I am back to the error 43, except the lines are still gone from the XML. I'm going to try again tomorrow because it's late and maybe I messed something up.

 

A couple of things may be worth trying.

 

1. create new xml with the vm manager (as your original was manual edits) call it windows 10 new.

    Try using ovmf for bios type if it will boot with that. If machine doesn't boot with this, then delete that 

    template and make new with seabios.

    Choose 2 disks

    for disk one click manual and put /dev/sdb

    for disk two click manual and put /dev/sdd

 

2. choose vnc for graphics card.

 

3.  boot machine. One in windows 10 then download and run ddu (display driver uninstaller) follow instructions on download link howto use

    http://www.guru3d.com/files-details/display-driver-uninstaller-download.html 

 

4. reboot machine then shutdown.

 

5. go back to vm manager and change graphics to your gpu and also add sound (from gpu)

 

6. start vm then load correct nvidea drivers

 

7. keep fingers crossed and pray no boot loop  :)

Link to comment

Before you posted I read this:

 

https://lime-technology.com/forum/index.php?topic=52468.0

 

and added the following:

 

  <features>
    <acpi/>
    <apic/>
    <hyperv>
      <relaxed state='on'/>
      <vapic state='on'/>
      <spinlocks state='on' retries='8191'/>
      <vendor id='none'/>
    </hyperv>
    <kvm>
      <hidden state='on'/>
    </kvm>
  </features>

 

Still getting error 43. I also tried an older driver 368.81. Every time I tried something new I would run that DDU program, reboot, and reinstall drivers. Still not getting anything. I've heard mention of installing vbios or something. Should I try that? Also, I can only use SeaBIOS.  Using OVMF just takes me to a shell for some reason.

 

Edit: I also need to check my physical config. I have onboard video as well and I'm not sure how I left the config last. Maybe that might have something to do with it.

Link to comment

I said to remove that entire hyperv section. Also remove the entire hypervclock tag.

 

Still no luck. This is what I have currently:

 

<domain type='kvm' id='38'>
  <name>Windows 10 new</name>
  <uuid>c2e8e3e2-93ab-29dc-1fc2-4166af49299c</uuid>
  <metadata>
    <vmtemplate xmlns="unraid" name="Windows 10" icon="windows.png" os="windows10"/>
  </metadata>
  <memory unit='KiB'>24641536</memory>
  <currentMemory unit='KiB'>24641536</currentMemory>
  <memoryBacking>
    <nosharepages/>
    <locked/>
  </memoryBacking>
  <vcpu placement='static'>6</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='0'/>
    <vcpupin vcpu='1' cpuset='1'/>
    <vcpupin vcpu='2' cpuset='2'/>
    <vcpupin vcpu='3' cpuset='4'/>
    <vcpupin vcpu='4' cpuset='5'/>
    <vcpupin vcpu='5' cpuset='6'/>
  </cputune>
  <resource>
    <partition>/machine</partition>
  </resource>
  <os>
    <type arch='x86_64' machine='pc-i440fx-2.5'>hvm</type>
  </os>
  <features>
    <acpi/>
    <apic/>
    <kvm>
      <hidden state='on'/>
    </kvm>
  </features>
  <cpu mode='host-passthrough'>
    <topology sockets='1' cores='3' threads='2'/>
  </cpu>
  <clock offset='localtime'>
    <timer name='rtc' tickpolicy='catchup'/>
    <timer name='pit' tickpolicy='delay'/>
    <timer name='hpet' present='no'/>
  </clock>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/local/sbin/qemu</emulator>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source dev='/dev/sdb'/>
      <backingStore/>
      <target dev='hdc' bus='sata'/>
      <boot order='1'/>
      <alias name='sata0-0-2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='writeback'/>
      <source dev='/dev/sdd'/>
      <backingStore/>
      <target dev='hdd' bus='sata'/>
      <alias name='sata0-0-3'/>
      <address type='drive' controller='0' bus='0' target='0' unit='3'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/mnt/user/UnRAID/virtio-win-0.1.109-2.iso'/>
      <backingStore/>
      <target dev='hdb' bus='ide'/>
      <readonly/>
      <alias name='ide0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='usb' index='0' model='nec-xhci'>
      <alias name='usb'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
    </controller>
    <controller type='pci' index='0' model='pci-root'>
      <alias name='pci.0'/>
    </controller>
    <controller type='ide' index='0'>
      <alias name='ide'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='sata' index='0'>
      <alias name='sata0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </controller>
    <controller type='virtio-serial' index='0'>
      <alias name='virtio-serial0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </controller>
    <interface type='bridge'>
      <mac address='52:54:00:f5:c0:43'/>
      <source bridge='br0'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
    </interface>
    <serial type='pty'>
      <source path='/dev/pts/0'/>
      <target port='0'/>
      <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/0'>
      <source path='/dev/pts/0'/>
      <target type='serial' port='0'/>
      <alias name='serial0'/>
    </console>
    <channel type='unix'>
      <source mode='bind' path='/var/lib/libvirt/qemu/channel/target/domain-Windows 10 new/org.qemu.guest_agent.0'/>
      <target type='virtio' name='org.qemu.guest_agent.0' state='disconnected'/>
      <alias name='channel0'/>
      <address type='virtio-serial' controller='0' bus='0' port='1'/>
    </channel>
    <hostdev mode='subsystem' type='pci' managed='yes' xvga='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x06' slot='0x00' function='0x0'/>
      </source>
      <alias name='hostdev0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x06' slot='0x00' function='0x1'/>
      </source>
      <alias name='hostdev1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x04f2'/>
        <product id='0x1112'/>
        <address bus='2' device='5'/>
      </source>
      <alias name='hostdev2'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x13d3'/>
        <product id='0x3404'/>
        <address bus='1' device='3'/>
      </source>
      <alias name='hostdev3'/>
    </hostdev>
    <hostdev mode='subsystem' type='usb' managed='no'>
      <source>
        <vendor id='0x195d'/>
        <product id='0x1010'/>
        <address bus='2' device='7'/>
      </source>
      <alias name='hostdev4'/>
    </hostdev>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </memballoon>
  </devices>
</domain>

 

Still getting code 43.

Link to comment

Your XML looks correct. Have you since booted the machine, gone into the device manager, and deleted the device(s) which are giving you the Code 43 error, then triggered a re-scan?

 

I did the same procedure as before: edited xml, booted machine, ran DDU to remove drivers, rebooted, reinstalled drivers. I didn't rescan to automatically install drivers and I think DDU said it changed that setting so Windows doesn't try to install it's version of the NVidia driver.

Link to comment

Your XML looks correct. Have you since booted the machine, gone into the device manager, and deleted the device(s) which are giving you the Code 43 error, then triggered a re-scan?

 

I did the same procedure as before: edited xml, booted machine, ran DDU to remove drivers, rebooted, reinstalled drivers. I didn't rescan to automatically install drivers and I think DDU said it changed that setting so Windows doesn't try to install it's version of the NVidia driver.

 

Hi bobbintb.  A long shot but maybe the card isnt getting enough power. Is your power supply old or not high enough wattage. Try reseating the gpu (even try another pci e slot) reconnect all the power cables to the gpu. (i found once that i had forgotten to connected the gpu power cable. The card still worked without the power connected until i loaded the drivers then i got an error. cant remember which error it was now though)

Link to comment

Your XML looks correct. Have you since booted the machine, gone into the device manager, and deleted the device(s) which are giving you the Code 43 error, then triggered a re-scan?

 

I did the same procedure as before: edited xml, booted machine, ran DDU to remove drivers, rebooted, reinstalled drivers. I didn't rescan to automatically install drivers and I think DDU said it changed that setting so Windows doesn't try to install it's version of the NVidia driver.

 

Hi bobbintb.  A long shot but maybe the card isnt getting enough power. Is your power supply old or not high enough wattage. Try reseating the gpu (even try another pci e slot) reconnect all the power cables to the gpu. (i found once that i had forgotten to connected the gpu power cable. The card still worked without the power connected until i loaded the drivers then i got an error. cant remember which error it was now though)

 

I was going to try changing PCIe slots as I heard some have issues. I'll have to wait until this weekend to do so. There may also be some UEFI settigs I need to check (Asrock Z87 Extreme11/ac). The power supply is plenty large. I don't remember exactly but it's either 800w or 1000w. Pretty sure it's 1000w though and, while it is old, it's a pretty high quality Corsair so I don't think that's it. I've checked the actual output before and it usually is below 200w actual drain when idle or in light usage. I'll check it out though. Hopefully I'll get it resolved and thanks all for the help. I'd love to hear if anyone else has any ideas.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...