Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

[SOLVED] Could not access KVM kernel module

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
Lumpy Gravy
n00b
n00b
User avatar
Posts: 58
Joined: Wed Dec 28, 2016 9:50 am
Location: France
Contact:
Contact Lumpy Gravy
Website

[SOLVED] Could not access KVM kernel module

  • Quote

Post by Lumpy Gravy » Sun Nov 23, 2025 6:25 pm

Hi,
Yesterday everyhink was working fine but this morning, my hypervisor was off and when I started it, the VM on it refused to boot.
Here's the error message:

Code: Select all

qemu-system-x86_64: -accel kvm: Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: -accel kvm: failed to initialize kvm: No such file or director
I found nothing in dmesg:

Code: Select all

# dmesg | grep kvm
[    0.342023] kvm_amd: TSC scaling supported
[    0.342030] kvm_amd: Nested Virtualization enabled
[    0.342032] kvm_amd: Nested Paging enabled
[    0.342035] kvm_amd: LBR virtualization supported
The kvm module is builtin:

Code: Select all

# cat /usr/src/linux/.config | grep KVM
CONFIG_KVM_COMMON=y
CONFIG_HAVE_KVM_PFNCACHE=y
CONFIG_HAVE_KVM_IRQCHIP=y
CONFIG_HAVE_KVM_IRQ_ROUTING=y
CONFIG_HAVE_KVM_DIRTY_RING=y
CONFIG_HAVE_KVM_DIRTY_RING_TSO=y
CONFIG_HAVE_KVM_DIRTY_RING_ACQ_REL=y
CONFIG_KVM_MMIO=y
CONFIG_KVM_ASYNC_PF=y
CONFIG_HAVE_KVM_MSI=y
CONFIG_HAVE_KVM_READONLY_MEM=y
CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT=y
CONFIG_KVM_VFIO=y
CONFIG_KVM_GENERIC_DIRTYLOG_READ_PROTECT=y
CONFIG_KVM_GENERIC_PRE_FAULT_MEMORY=y
CONFIG_KVM_COMPAT=y
CONFIG_HAVE_KVM_IRQ_BYPASS=y
CONFIG_HAVE_KVM_NO_POLL=y
CONFIG_KVM_XFER_TO_GUEST_WORK=y
CONFIG_KVM_GENERIC_HARDWARE_ENABLING=y
CONFIG_KVM_GENERIC_MMU_NOTIFIER=y
CONFIG_KVM_X86=y
CONFIG_KVM=y
CONFIG_KVM_WERROR=y
# CONFIG_KVM_INTEL is not set
CONFIG_KVM_AMD=y
CONFIG_KVM_SMM=y
CONFIG_KVM_HYPERV=y
# CONFIG_KVM_XEN is not set
CONFIG_KVM_MAX_NR_VCPUS=1024
What could I do ?
Thanks.
Last edited by Lumpy Gravy on Thu Nov 27, 2025 4:48 pm, edited 1 time in total.
Top
alamahant
Advocate
Advocate
Posts: 4032
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Sun Nov 23, 2025 9:57 pm

Plz do

Code: Select all

if [ ! -e /dev/kvm ]; then
    echo "Creating /dev/kvm..."
    sudo mknod /dev/kvm c 10 232
    sudo chmod 660 /dev/kvm
    sudo chown root:kvm /dev/kvm 2>/dev/null
else
    echo "/dev/kvm already exists."
fi
And if indeed it was absent and after being created qemu works maybe invoke it at machine booting
or maybe better creating a tmpfile

/etc/tmpfiles.d/kvm.conf

Code: Select all

c /dev/kvm 0660 root kvm - 10:232
:)
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Sun Nov 23, 2025 10:40 pm

The kvm device ought to be created automatically. Manual creation is interesting to detect if the absence is the only problem, but if it is absent on its own, even after a reboot, deeper investigation is warranted.
Top
Lumpy Gravy
n00b
n00b
User avatar
Posts: 58
Joined: Wed Dec 28, 2016 9:50 am
Location: France
Contact:
Contact Lumpy Gravy
Website

  • Quote

Post by Lumpy Gravy » Mon Nov 24, 2025 6:39 am

alamahant wrote:Plz do

Code: Select all

if [ ! -e /dev/kvm ]; then
    echo "Creating /dev/kvm..."
    sudo mknod /dev/kvm c 10 232
    sudo chmod 660 /dev/kvm
    sudo chown root:kvm /dev/kvm 2>/dev/null
else
    echo "/dev/kvm already exists."
fi
/dev/kvm already exists.
Well it seems to be here.
Top
Lumpy Gravy
n00b
n00b
User avatar
Posts: 58
Joined: Wed Dec 28, 2016 9:50 am
Location: France
Contact:
Contact Lumpy Gravy
Website

  • Quote

Post by Lumpy Gravy » Thu Nov 27, 2025 10:26 am

Maybe it's a hardware probem, it was running on an old FX-6300, so I tried to move the VM on another hypervisor but with intel CPU so I ran into an "Illegal instruction" error while trying to chroot.
Same thing on yet another hypervisor with AMD this time but a Ryzen 5 2600.
I will have to rebuild the VM but it's a mail server, if it can't run again, how could I retrieve the mails ?
Top
Hu
Administrator
Administrator
Posts: 24385
Joined: Tue Mar 06, 2007 5:38 am

  • Quote

Post by Hu » Thu Nov 27, 2025 2:03 pm

Although hardware errors can happen, I would rule out other things first. Usually, hardware errors are catastrophic, rather than disabling one feature and leaving everything else intact.

Start by posting kern.log, ideally with enough history to see both the bad boot where KVM does not work, and the last good boot where it did.

If you can't start the system, then mount its drive as a data drive in a working system and copy the content out that way.
Top
Lumpy Gravy
n00b
n00b
User avatar
Posts: 58
Joined: Wed Dec 28, 2016 9:50 am
Location: France
Contact:
Contact Lumpy Gravy
Website

  • Quote

Post by Lumpy Gravy » Thu Nov 27, 2025 4:08 pm

I don't see anything suspicious.

Code: Select all

Mar 24 14:25:14 TC-14 kernel: kvm_amd: TSC scaling supported
Mar 24 14:25:14 TC-14 kernel: kvm_amd: Nested Virtualization enabled
Mar 24 14:25:14 TC-14 kernel: kvm_amd: Nested Paging enabled
Mar 24 14:25:14 TC-14 kernel: kvm_amd: LBR virtualization supported
...
Nov 27 07:47:18 TC-14 kernel: kvm_amd: TSC scaling supported
Nov 27 07:47:18 TC-14 kernel: kvm_amd: Nested Virtualization enabled
Nov 27 07:47:18 TC-14 kernel: kvm_amd: Nested Paging enabled
Nov 27 07:47:18 TC-14 kernel: kvm_amd: LBR virtualization supported
but I'm not sure what I'm looking for.
Maybe it's a permission thing ?
Top
Lumpy Gravy
n00b
n00b
User avatar
Posts: 58
Joined: Wed Dec 28, 2016 9:50 am
Location: France
Contact:
Contact Lumpy Gravy
Website

  • Quote

Post by Lumpy Gravy » Thu Nov 27, 2025 4:44 pm

It was a permission thing !
My user was not in the kvm group, before, I just needed to be in the libvirt group if I remember well.
Top
Post Reply

8 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic