You are not logged in.

#1 2013-02-12 16:04:27

vendion
Member
From: Cleveland, TN
Registered: 2010-03-10
Posts: 190
Website

[solved] Libvirt "No accelerator found!" but aqemu and qemu-kvm works.

After the latest update to libvirt I have been getting a weird error message when I try to run or install a new VM on multiple machines.

Unable to complete install: 'internal error process exited while connecting to monitor: char device redirected to /dev/pts/1
Could not access KVM kernel module: Permission denied
failed to initialize KVM: Permission denied
No accelerator found!
'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 96, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/create.py", line 1943, in do_install
    guest.start_install(False, meter=meter)
  File "/usr/lib/python2.7/site-packages/virtinst/Guest.py", line 1249, in start_install
    noboot)
  File "/usr/lib/python2.7/site-packages/virtinst/Guest.py", line 1317, in _create_guest
    dom = self.conn.createLinux(start_xml or final_xml, 0)
  File "/usr/lib/python2.7/site-packages/libvirt.py", line 2722, in createLinux
    if ret is None:raise libvirtError('virDomainCreateLinux() failed', conn=self)

I have hardware virtulization enabled in the BIOS on my machines, as well as the the required kernel modules loaded:

> lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                2
On-line CPU(s) list:   0,1
Thread(s) per core:    1
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             AuthenticAMD
CPU family:            16
Model:                 6
Stepping:              3
CPU MHz:               800.000
BogoMIPS:              4989.39
Virtualization:        AMD-V
L1d cache:             64K
L1i cache:             64K
L2 cache:              1024K
NUMA node0 CPU(s):     0,1

> grep -E "(vmx|svm)" /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 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate npt lbrv svm_lock nrip_save
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt nodeid_msr hw_pstate npt lbrv svm_lock nrip_save

> lsmod | ack 'kvm*'
kvm_amd                52055  0 
kvm                   384721  1 kvm_amd

I am able to create and run VMs using qemu-kvm directly and with using aqemu-git without any issues.  I am not sure if the direct cause is with Libvirt or if I am using qemu-kvm-spice from AUR (has not caused an issue before).

Last edited by vendion (2013-02-16 20:15:15)

Offline

#2 2013-02-14 23:02:36

jwhipp
Member
Registered: 2012-01-20
Posts: 7

Re: [solved] Libvirt "No accelerator found!" but aqemu and qemu-kvm works.

I have the same exact issue only I am using kvm_intel.

I am trying to use KVM with libvirt and no QEMU anything. 

Stats:

Linux 3.7.7-1-ARCH #1 SMP PREEMPT Mon Feb 11 20:20:58 EET 2013 x86_64 GNU/Linux

libvirt 1.0.2-3

root:~/ # modinfo kvm_intel                                                                                           [15:59:09]
filename:       /lib/modules/3.7.7-1-ARCH/kernel/arch/x86/kvm/kvm-intel.ko.gz
license:        GPL
author:         Qumranet
alias:          x86cpu:vendor:*:family:*:model:*:feature:*0085*
depends:        kvm
intree:         Y
vermagic:       3.7.7-1-ARCH SMP preempt mod_unload modversions
parm:           vpid:bool
parm:           flexpriority:bool
parm:           ept:bool
parm:           unrestricted_guest:bool
parm:           eptad:bool
parm:           emulate_invalid_guest_state:bool
parm:           vmm_exclusive:bool
parm:           fasteoi:bool
parm:           nested:bool
parm:           ple_gap:int
parm:           ple_window:int

I've started the various libvirt services with systemd and I am running virt-manager as root to rule out any permissions issues.

Offline

#3 2013-02-16 20:14:27

vendion
Member
From: Cleveland, TN
Registered: 2010-03-10
Posts: 190
Website

Re: [solved] Libvirt "No accelerator found!" but aqemu and qemu-kvm works.

So I guess this is what happens when you don't see notices during updates, turns out that the last libvirt update displayed the following warning:

>>> You may need to run 'rm -rf ~/.libvirt'
>>> libvirt runs qemu from nobody:nobody by default
>>> change it in /etc/libvirt/qemu.conf

To get libvird working again you need to edit the qemu.conf file and change the group to "kvm", once that is done and libvirtd is restarted everything works again.

Offline

#4 2013-02-23 15:39:10

hawkinstw
Member
Registered: 2013-01-26
Posts: 7

Re: [solved] Libvirt "No accelerator found!" but aqemu and qemu-kvm works.

I had the same problem, however the fix did not work for me.
Tried replacing kvm user and group with qemu (since it exists), same problem.
Reverted and created a kvm user (which did not exist and qemu-kvm package did not create), then the problem changes to
error: Unable to read from monitor: Connection reset by peer

I do not know if it is relevant but when run as root I get:

# qemu-kvm
Could not initialize SDL(No available video device) - exiting

However as the user of the current login a qemu-kvm starts with no problems.

maybe it indicates a systemd/polkit qxl/SDL driver problem or cgroups problem?
my libvirtd.conf I had set the permissions to polkit but commenting it out to get the defaults changes nothing.

a stab in the dark would predict that since systemd/polkit only allows programmes to run on the login session/seat, it is preventing the kvm/qemu user to run a programme since that user has not logged in?
so I changed the user and group in qemu.conf again but this time to root then the following error :
connecting to monitor: chardev: opening backend "pty" failed

changing it to the current session/seat login username and group:
success

On the other hand maybe it is as result of a messed up passwd or groups file causing polkit not to work correctly?

UPDATE: the problem also goes away when I remove a SDL display and then use the trusty old(archaic) VNC. so as I said, my guess is the qxl framebuffer and/or SDL is not being granted permission to use the display by polkit or PAM or systemd or whatever is supposed to be granting it permission.  it can probably be fixed with a rule....

Last edited by hawkinstw (2013-03-13 23:16:18)

Offline

#5 2013-02-28 17:34:38

cyberyoung
Member
Registered: 2012-02-12
Posts: 14

Re: [solved] Libvirt "No accelerator found!" but aqemu and qemu-kvm works.

hawkinstw wrote:

I had the same problem, however the fix did not work for me.
Tried replacing kvm user and group with qemu (since it exists), same problem.
Reverted and created a kvm user (which did not exist and qemu-kvm package did not create), then the problem changes to
error: Unable to read from monitor: Connection reset by peer

I do not know if it is relevant but when run as root I get:

# qemu-kvm
Could not initialize SDL(No available video device) - exiting

However as the user of the current login a qemu-kvm starts with no problems.

maybe it indicates a systemd/polkit qxl/SDL driver problem or cgroups problem?
my libvirtd.conf I had set the permissions to polkit but commenting it out to get the defaults changes nothing.

a stab in the dark would predict that since systemd/polkit only allows programmes to run on the login session/seat, it is preventing the kvm/qemu user to run a programme since that user has not logged in?
so I changed the user and group in qemu.conf again but this time to root then the following error :
connecting to monitor: chardev: opening backend "pty" failed

changing it to the current session/seat login username and group:
success

On the other hand maybe it is as result of a messed up passwd or groups file causing polkit not to work correctly?


it works for me! thanks.
but still confused. any documents or article for this?

Offline

Board footer

Powered by FluxBB