1

I recently created several virtual machines through virt-manager and all ran without issue. The following week, whenever I try to start any of the vms I get the following message.

Error starting domain: unsupported configuration: Domain requires KVM, but it is not available. Check that virtualization is enabled in the host BIOS, and host configuration is setup to load the kvm modules.

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1279, in startup
    self._backend.create()
  File "/usr/lib64/python3.6/site-packages/libvirt.py", line 1234, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: unsupported configuration: Domain requires KVM, but it is not available. Check that virtualization is enabled in the host BIOS, and host configuration is setup to load the kvm modules.

I did notice when I was using this system through remote login, that I got kicked out, so I'm assuming this system restarted over the weekend.

I also remembered having to load the kvm module by running the command so my first guess was that it wasn't loaded so I ran

$modprobe kvm

but still I am getting the same message. I also ran

$lsmod | grep kvm

and get

kvm                   507904  0

so it is loaded.

I already checked in the bios and can confirm that it is indeed enabled. I also was able to get my VMs running again when I was trying to figure out how to fix this issue although I am not sure what I did. I then restarted the system again to see if it was truly fixed and the message still comes back up. Can anyone help me fix this?

1

KVM is loaded, but there should also be kvm_intel or kvm_amd module loaded. For example, on my machine, it looks like this:

[Alex@NormandySR2 nested_virt_kvm]$ lsmod | grep kvm
kvm_intel             327680  7
kvm                   909312  1 kvm_intel

As you noticed, there might be at least 2 reasons why this doesn't work.

  1. Virtualization is disabled in UEFI (sometimes called BIOS)
  2. Your CPU doesn't support virtualization

You might check if your CPU supports virtualization with:

lscpu | grep vmx # intel
lscpu | grep svm # amd

If it's not present, check if your CPU model support virtualization (the vendor website has this information). To get your CPU model, you might use.

lscpu | grep 'Model'
Model:                           60
Model name:                      Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz

Edit

How to enable them automatically? Depending on your distro, they should be already loaded after startup. But if they, for some reason, aren't, you might use:

echo -e 'kvm\nkvm_amd' | sudo tee -a /etc/modules-load.d/kvm.conf

That will save two lines into /etc/module-load.d. More about modules-load.d could be found in man 5 modules-load.d or one of the websites that host manuals like: https://www.systutorials.com/docs/linux/man/5-modules-load.d/

2
  • i see, i just ran modprobe kvm_amd becuase it is an amd system and that was the solution although I don't remember ever having to run this command at all the first time. Is there a way to run these modules automatically when the system starts up?
    – CodeRich
    Mar 22 at 21:43
  • @CodeRich see edit Mar 22 at 21:51
0

It's a comment, posting here for formating:

Is this the full output of lsmod | grep kvm? In that case something seems wrong, my output of is:

kvm_intel             233472  0
kvm                   757760  1 kvm_intel
irqbypass              16384  1 kvm

If a recall well the equivalent applies for AMD CPUs, kvm_amd


You can also try a plain kvm command on yor shell; an empty VM, with BIOS trying to boot should start. In that scenario, qemu-kvm is fine, it could be something wrong with libvirt or Virt-Manager.

1
  • yes, I was missing the rest of the modules like the kvm_amd module and only the single kvm was shown in the terminal output. My vms ran after loading this module.
    – CodeRich
    Mar 22 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.