Libvirtd missing modules.alias

Hi,

When I try to run a Windows VM in virt-manager (so KVM/QEMU) with GPU passthrough, I get an error stating ‘/lib/modules/6.7.2/modules.alias’ file missing. Because this is Nix, it is located at /run/booted-system/kernel-modules/lib/modules/6.7.2/modules.alias.

How can I fix it? Should I just symlink the file?

I’d appreciate any help

4 Likes

I found something that looks similar maybe that helps.

libvirtd.nix

I’m having this issue, too, except /lib/modules/6.1.75-hardened1/modules.alias – it seems to be after updating nixos that this happened. That’s the only change that I can think of that I did

For now, I’ve just symlinked the file and it works. I will check out other options, but it simply needs the file, so just doing this is a reasonable workaround for me.

I’m glad I found this thread; I thought it was just me.

My solution is sudo ln -s /run/current-system/kernel-modules/lib/modules /lib/modules

Many thanks. I’ll try that now; it worked. Thank you very much.

That’s what I did as well. It is a bit of a workaround, as it wouldn’t carry over to another system and you’d need to run the command again.

I was wondering if there is a way to fix it in configuration.nix