View previous topic :: View next topic |
Author |
Message |
leyvi Tux's lil' helper
Joined: 08 Sep 2023 Posts: 101
|
Posted: Sun Jan 05, 2025 8:17 pm Post subject: No `modules.alias` on system with monolithic kernel |
|
|
Hello all.
I'm trying to run a Windows 10 VM with QEMU/KVM, using Virtual Machine Manager as a graphical frontend. I wanted to use PCIe passthrough, so I configured IOMMU in my kernel, and checked all the relevant log files, and verified that everything was working. Problem is, when I try to start a VM passing my iGPU over to it (using the dGPU on the host), it gives me this error message: Code: | libvirt.libvirtError: Failed to open file '/lib/modules/6.12.8-gentoo/modules.alias': No such file or directory | I have a purely monolithic kernel, with loadable modules disabled, so I don't think I should have that file there. I've tried making a dummy file called `modules.alias`, but that logs me out of my KDE session when I try to start the VM. I've also tried making a symbolic link to `modules.builtin` called `modules.alias`, but then starting the VM crashes KDE altogether. I also can't find anything of interest in syslog, except maybe this: Code: | Jan 5 21:34:24 fast-penguin kernel: QSGRenderThread[30227]: segfault at 8 ip 00007fde17eb9031 sp 00007fddd176b830 error 4 in libQt6Core.so.6.8.1[2b9031,7fde17c91000+388000] likely on CPU 9 (core 11, socket 0) | I don't think it's really relevant though.
Anyone know how I can fix this? |
|
Back to top |
|
|
rab0171610 Guru
Joined: 24 Dec 2022 Posts: 449
|
Posted: Mon Jan 06, 2025 9:37 am Post subject: |
|
|
With regards to libvirt looking for modules.alias when using PCI passthrough:
https://libvirt.org/news.html#v10-0-0-2024-01-15
Code: | qemu: automatic selection/binding of VFIO variant drivers
When a device is assigned to a guest using VFIO with <hostdev managed='yes'>, libvirt will now search the running kernel's modules.alias file for the most specific match to that device for a VFIO driver, and bind that driver to the device rather than vfio-pci. A specific driver can also be forced, using the <driver model='plugh'/> attribute. |
It may be that when hostdev is set to managed, libvirt may require dynamically loadable modules for use in hotplugging -- stopping and then passing attached PCI devices back and forth between the host and the guest:
Code: |
<hostdev>
Passes host-attached devices to a virtual server.
Ensure that the device that is passed through to the virtual server is not in use by the host. The virtualization of the pass-through device can be SCSI-based or it can be based on the VFIO framework. |
Code: | <hostdev managed='yes'>
managed=yes | no
For managed="yes", automatically handles the host setup of the PCI device. When the virtual server is started or the device is hotplugged to a running virtual server, the device is detached from the host and assigned to the virtual server. When the virtual server is stopped or detaches the device, it is returned to the host.
|
You can refer to the PCI Passthrough section (Libvirt Domain XML format):
https://libvirt.org/formatdomain.html#pci-passthrough
I don't know if any of the configuration parameters would be beneficial for you, i.e. driver sub-element with a name attribute set to traditional 'kvm' rather than 'vfio'', changing <interface type='hostdev' managed='yes'> to <interface type='hostdev' managed='no''> in your Domain Configuration-XML, etc.
Note:
Code: | If managed is omitted or "no", the user is responsible to call virNodeDeviceDettach (or virsh nodedev-detach) before starting the guest or hot-plugging the device, and virNodeDeviceReAttach (or virsh nodedev-reattach) after hot-unplug or stopping the guest. |
Rather than experimenting with any of that, it might be easier to install gentoo-kernel-bin. I can confirm that the file modules.alias exists on my system with sys-kernel/gentoo-kernel-bin in the kernel modules directory.
Last edited by rab0171610 on Tue Jan 07, 2025 8:45 am; edited 2 times in total |
|
Back to top |
|
|
leyvi Tux's lil' helper
Joined: 08 Sep 2023 Posts: 101
|
Posted: Mon Jan 06, 2025 6:31 pm Post subject: |
|
|
OK, thanks!
I'll give it a shot. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|