[SOLVED] PC won't boot after VFIO claim

i have a ryzen r7 1700, x370 GIGABYTE gaming k7, HOST R9 270, GUEST r9 fury (aircooled).
i use arch (antergos) so i followed the instructions on the wiki and i can’t boot after “claiming gpu” with vfio.
i tried at least 3 times to format my ssd and retry but it doesn’t work. when i boot i just see on one screen “Starting version 236” and on the other one full black. i want to do this pci passthrough because with dual-boot i usually use windows more, and i don’t want to. the IOMMU groups are ok because the 2 gpus are in different ones… i really don’t see what i’m doing wrong. Thanks in advance

If you only see “Starting version 236” that probably means that’s the output of the guest card.

Is your host card plugged into the black one?

Yes, host black, guest “starting version 236”

Is everything plugged into the host GPU(power etc.)?
Is the black monitor on the right input?

You’re host GPU shouldn’t be affected if you’re only isolating the guest.

i’m guessing here but:
i had a problem setting this up when the guest card was in the top slot.
so if you have host card not in top slot, maybe try that.

2 Likes

THANK YOU!!!
I was so close to losing my mind

Last thing: I have an SSD with Windows on and I would like to use that as disk image in virt-manager. How do I do it?

Create a virtual disk, edit the xml and replace the disk path with /dev/sdx. and change the type to block.

was that really the problem? :open_mouth:

if so, cool, happy vm-ing :slight_smile:

2 Likes

I have been trying to do it but I’m really a noob, I’ve created a VM and I have to edit the .XML file in /etc/libvirt ?

Sorry, sometimes when you’ve been doing something for years, you forget what to tell newbies. :stuck_out_tongue:

Alright, Here’s a couple XML excerpts.

This one is an example of a virtual disk image file.

    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/win10-gpu.raw'/>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x04' slot='0x00' function='0x0'/>
    </disk>

This is an example of a block device passed through:

    <disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/sda'/>
      <target dev='vdb' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x08' slot='0x00' function='0x0'/>
    </disk>

to edit the XML, do sudo virsh edit <vmname.

Scroll through the file and find <devices>, which has all your disks, controllers and other things that qemu is emulating.

Either edit the existing xml tags or create your own.

A couple things to note:

The <target> tag defines how the disk will show up in the VM. (virtio needs drivers, so you’ll need to install them before passing through)

The <address> tag defines the virtual PCI address that the device shows up at. Every device is attached to the PCI bus in QEMU. Make sure the address doesn’t conflict with anything else.

The <driver> tag defines how QEMU interacts with the storage backend (image file or block device) and how any caching should be handled.

1 Like

Thanks for the kind reply,
i installed the virtio drivers, i installed windows but then when i edit the .xml and boot back the vm it doesn’t care, seems like nothing has changed.
Here is a part of my .xml example

<disk type='block' device='disk'>
      <driver name='qemu' type='raw' cache='none' io='native'/>
      <source dev='/dev/sdb'/>
      <target dev='vda' bus='virtio'/>
      <boot order='3'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='sda' bus='sata'/>
      <readonly/>
      <boot order='1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <source file='/home/andrea/Scaricati/virtio-win-0.1.141.iso'/>
      <target dev='sdb' bus='sata'/>
      <readonly/>
      <boot order='2'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>

What exactly do you mean by this? Does it boot from the disk image?

If you haven’t restarted virt-manager, you might want to do that. Sometimes editing xml while virt-manager is open causes things to get screwy for me.

you were right, i had to reboot the pc, now when i boot it it show the blue screen of death with error: INACCESIBLE BOOT DEVICE.
I tried doing without the SSD disk image and it works.

inaccessible boot device means it doesn’t have the virtio driver loaded early enough.

I’m not sure how to fix this. (not a windows guy)

1 Like

I may fix with boot order? Not a problem tho, I’m satisfied with a disk image on the Linux machine

Yeah, that’s how I usually do it. image for C drive, physical disk for D drive.

I’m not sure how you had your disk configured prior but when I installed Windows I side-load the virtio drivers at that stage to ensure it has what it needs going forward. If it’s a fairly fresh install maybe reinstall and do that?

1 Like

Yeah I did the same and I even reinstalled to be sure… idk sorry