New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get fedora 23 working with libvirt #539

Closed
jerowe opened this Issue Jan 9, 2016 · 14 comments

Comments

Projects
None yet
7 participants
@jerowe

jerowe commented Jan 9, 2016

I'm probably missing something simple here. Help would be very appreciated!

vagrant box add f23cloud https://download.fedoraproject.org/pub/fedora/linux/releases/23/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-23-20151030.x86_64.vagrant-libvirt.box

vagrant init f22atomic

VagrantFile

config.vm.provider "libvirt" do |libvirt|
config.vm.box = "f23cloud"
libvirt.driver = "qemu" #I've also tried this as kvm
libvirt.memory = 2048
libvirt.cpus = 4
end

vagrant up

Output vagrant up

Bringing machine 'default' up with 'libvirt' provider...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
==> default: -- Name: fed_test_default
==> default: -- Domain type: kvm
==> default: -- Cpus: 4
==> default: -- Memory: 2048M
==> default: -- Base box: f22atomic
==> default: -- Storage pool: default
==> default: -- Image: /var/lib/libvirt/images/fed_test_default.img
==> default: -- Volume Cache: default
==> default: -- Kernel:
==> default: -- Initrd:
==> default: -- Graphics Type: vnc
==> default: -- Graphics Port: 5900
==> default: -- Graphics IP: 127.0.0.1
==> default: -- Graphics Password: Not defined
==> default: -- Video Type: cirrus
==> default: -- Video VRAM: 9216
==> default: -- Keymap: en-us
==> default: -- Command line :
Error while creating domain: Error saving the server: Call to virDomainDefineXML failed: invalid argument: could not find capabilities for domaintype=kvm

Fedora 23, Vagrant 1.7.4, vagrant-libvirt (0.0.30), vagrant-mutate (1.0.4)

@fabiand

This comment has been minimized.

Show comment
Hide comment
@fabiand

fabiand Jan 19, 2016

I'm seeing the same:

# rpm -q vagrant libvirt-daemon-kvm
vagrant-1.7.4-2.fc23.noarch
vagrant-libvirt-0.0.30-5.fc23.noarch
libvirt-daemon-kvm-1.2.18.2-1.fc23.x86_64

fabiand commented Jan 19, 2016

I'm seeing the same:

# rpm -q vagrant libvirt-daemon-kvm
vagrant-1.7.4-2.fc23.noarch
vagrant-libvirt-0.0.30-5.fc23.noarch
libvirt-daemon-kvm-1.2.18.2-1.fc23.x86_64
@fabiand

This comment has been minimized.

Show comment
Hide comment
@fabiand

fabiand Jan 19, 2016

I had to enable nesting:

echo "options kvm_intel nested=Y" > /etc/modprobe.d/kvm.conf

and reboot

fabiand commented Jan 19, 2016

I had to enable nesting:

echo "options kvm_intel nested=Y" > /etc/modprobe.d/kvm.conf

and reboot

@infernix

This comment has been minimized.

Show comment
Hide comment
@infernix

infernix Feb 11, 2016

Member

I have tested this both with and without nested KVM and in both cases it worked under Vagrant 1.8.1 and vagrant-libvirt 0.0.32.

The error could not find capabilities for domaintype=kvm is indicative of the lack of kvm support on the host. It may mean that the kvm/kvm_intel/kvm_amd modules aren't loaded, the CPU doesn't support hardware virtualisation, or the required options are disabled in the BIOS.

When using libvirt.driver = "qemu" you are using software virtualisation (TCG) which would be a lot slower.

I don't believe that either of these problems are issues with vagrant-libvirt. Can you retry with vagrant 1.8.1 and the following Vagrantfile:

ENV['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt'
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.provider "libvirt" do |libvirt|
    config.vm.box = "f23cloud"
    libvirt.driver = "kvm"
    libvirt.memory = 2048
    libvirt.cpus = 4
  end
  config.vm.synced_folder ".", "/vagrant", disabled: true
end

If that still fails, can you download CPU checker extract it and run the kvm-ok script to ensure you are kvm capable?

Member

infernix commented Feb 11, 2016

I have tested this both with and without nested KVM and in both cases it worked under Vagrant 1.8.1 and vagrant-libvirt 0.0.32.

The error could not find capabilities for domaintype=kvm is indicative of the lack of kvm support on the host. It may mean that the kvm/kvm_intel/kvm_amd modules aren't loaded, the CPU doesn't support hardware virtualisation, or the required options are disabled in the BIOS.

When using libvirt.driver = "qemu" you are using software virtualisation (TCG) which would be a lot slower.

I don't believe that either of these problems are issues with vagrant-libvirt. Can you retry with vagrant 1.8.1 and the following Vagrantfile:

ENV['VAGRANT_DEFAULT_PROVIDER'] = 'libvirt'
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.provider "libvirt" do |libvirt|
    config.vm.box = "f23cloud"
    libvirt.driver = "kvm"
    libvirt.memory = 2048
    libvirt.cpus = 4
  end
  config.vm.synced_folder ".", "/vagrant", disabled: true
end

If that still fails, can you download CPU checker extract it and run the kvm-ok script to ensure you are kvm capable?

anonym added a commit to anonym/vagrant-libvirt that referenced this issue Feb 17, 2016

Make it possible to set the path to the device model emulator.
On some systems (e.g. Debian) omitting this setting results in the
following error:

    Error while creating domain: Error saving the server: Call to
    virDomainDefineXML failed: invalid argument: could not find
    capabilities for domaintype=kvm

Which has been reported as:

    vagrant-libvirt#539
@infernix

This comment has been minimized.

Show comment
Hide comment
@infernix

infernix Mar 15, 2016

Member

I am closing this due to inactivity; feel free to update in case this needs to be reopened.

Member

infernix commented Mar 15, 2016

I am closing this due to inactivity; feel free to update in case this needs to be reopened.

@infernix infernix closed this Mar 15, 2016

@techtonik

This comment has been minimized.

Show comment
Hide comment
@techtonik

techtonik May 11, 2016

$ sudo kvm-ok
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used

So, what is the next step to run it?

techtonik commented May 11, 2016

$ sudo kvm-ok
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used

So, what is the next step to run it?

@pronix

This comment has been minimized.

Show comment
Hide comment
@pronix

pronix May 11, 2016

Member

@techtonik читать документацию

Member

pronix commented May 11, 2016

@techtonik читать документацию

@infernix

This comment has been minimized.

Show comment
Hide comment
@infernix

infernix May 11, 2016

Member

@pronix 😎

@techtonik Turn on VT-x or SVM (and any other virtualisation settings) in your bios, or replace the CPU if it doesn't support it.

Member

infernix commented May 11, 2016

@pronix 😎

@techtonik Turn on VT-x or SVM (and any other virtualisation settings) in your bios, or replace the CPU if it doesn't support it.

@techtonik

This comment has been minimized.

Show comment
Hide comment
@techtonik

techtonik May 11, 2016

@pronix so have you mastered the skill?

@infernix no such setting in BIOS. The CPU is https://en.wikipedia.org/wiki/Pentium_D - what should I change it to?

techtonik commented May 11, 2016

@pronix so have you mastered the skill?

@infernix no such setting in BIOS. The CPU is https://en.wikipedia.org/wiki/Pentium_D - what should I change it to?

@infernix

This comment has been minimized.

Show comment
Hide comment
@infernix

infernix May 11, 2016

Member

@techtonik anything newer - "Smithfield did not support Intel VT-x—Intel's x86 virtualization (formerly Vanderpool)."

Member

infernix commented May 11, 2016

@techtonik anything newer - "Smithfield did not support Intel VT-x—Intel's x86 virtualization (formerly Vanderpool)."

@techtonik

This comment has been minimized.

Show comment
Hide comment
@techtonik

techtonik May 12, 2016

Anything from this list http://www.cpu-upgrade.com/mb-ASUS/P5KR.html#cs ? Or else I will have to change motherboard and system chassis and that needs a bigger lump of cash.

techtonik commented May 12, 2016

Anything from this list http://www.cpu-upgrade.com/mb-ASUS/P5KR.html#cs ? Or else I will have to change motherboard and system chassis and that needs a bigger lump of cash.

@techtonik

This comment has been minimized.

Show comment
Hide comment
@techtonik

techtonik May 12, 2016

libvirt.driver = "kvm"

is it possible to use

libvirt.driver = "qemu"

in the meanwhile?

UPDATE: doesn't work - fails with

invalid argument: could not find capabilities for domaintype=qemu

techtonik commented May 12, 2016

libvirt.driver = "kvm"

is it possible to use

libvirt.driver = "qemu"

in the meanwhile?

UPDATE: doesn't work - fails with

invalid argument: could not find capabilities for domaintype=qemu
@techtonik

This comment has been minimized.

Show comment
Hide comment
@techtonik

techtonik May 12, 2016

Ok. apt install qemu fixed the issue.

techtonik commented May 12, 2016

Ok. apt install qemu fixed the issue.

@cyphar

This comment has been minimized.

Show comment
Hide comment
@cyphar

cyphar Sep 21, 2016

On openSUSE you need to make sure you install qemu-kvm. I would recommend anyone coming to this thread in the future read this page from the libvirt docs which explains all of the requirements for the "capability" to run different drivers.

cyphar commented Sep 21, 2016

On openSUSE you need to make sure you install qemu-kvm. I would recommend anyone coming to this thread in the future read this page from the libvirt docs which explains all of the requirements for the "capability" to run different drivers.

@vhosakot

This comment has been minimized.

Show comment
Hide comment
@vhosakot

vhosakot Feb 11, 2017

The invalid argument: could not find capabilities for domaintype=kvm is seen if the CPU does not support virtualization and/or the kvm kernel module is not loaded.

Here are the commands that can be used to check if the CPU supports virtualization and if the kvm kernel module is loaded:

# grep -i vmx /proc/cpuinfo
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm tpr_shadow vnmi flexpriority ept fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm tpr_shadow vnmi flexpriority ept fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm tpr_shadow vnmi flexpriority ept fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm tpr_shadow vnmi flexpriority ept fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt

#  lsmod | grep kvm
kvm_intel             170181  0 
kvm                   554609  1 kvm_intel
irqbypass              13503  1 kvm

vhosakot commented Feb 11, 2017

The invalid argument: could not find capabilities for domaintype=kvm is seen if the CPU does not support virtualization and/or the kvm kernel module is not loaded.

Here are the commands that can be used to check if the CPU supports virtualization and if the kvm kernel module is loaded:

# grep -i vmx /proc/cpuinfo
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm tpr_shadow vnmi flexpriority ept fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm tpr_shadow vnmi flexpriority ept fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm tpr_shadow vnmi flexpriority ept fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nopl eagerfpu pni pclmulqdq vmx ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm tpr_shadow vnmi flexpriority ept fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid xsaveopt

#  lsmod | grep kvm
kvm_intel             170181  0 
kvm                   554609  1 kvm_intel
irqbypass              13503  1 kvm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment