Failed to creat a vm using KVM: permission denied.

I have been a long time virtualbox user. Today I’m trying to create a lubuntu vm using KVM, but got this error that couldn’t be solved when I click “begin running vm” after configured one.

unable to complete install: 'internal error: process exited while connecting to monitor: Could not access KVM kernel module: Permission denied

failed to initialize KVM: Permission denied

Traceback (most recent call last):
File “/usr/share/virt-manager/virtManager/asyncjob.py”, line 91, in cb_wrapper
callback(asyncjob, *args, **kwargs)
File “/usr/share/virt-manager/virtManager/create.py”, line 1907, in do_install

 guest.start_install(meter=meter)

File “/usr/share/virt-manager/virtinst/guest.py”, line 428, in start_install

 noboot)

File “/usr/share/virt-manager/virtinst/guest.py”, line 492, in _create_guest
dom = self.conn.createLinux(start_xml or final_xml, 0)

File “/usr/lib64/python2.7/site-packages/libvirt.py”, line 3440, in createLinux
if ret is None:raise libvirtError(‘virDomainCreateLinux() failed’, conn=self)
libvirtError: internal error: process exited while connecting to monitor: Could not access KVM kernel module: Permission denied
failed to initialize KVM: Permission denied

I have tried add my username to the group “libvirt”, “qemu”, “kvm”.

The error didn’t go away even I added to all three groups.

What are permissions of /dev/kvm (ls -l /dev/kvm)?

crw-rw-rw-+ 1 root kvm 10, 232

Could you also show “getfacl /dev/kvm”?

getfacl: Removing leading '/' from absolute path names
# file: dev/kvm
# owner: root
# group: kvm
user::rw-
user:bone:rw-
group::---
mask::rw-
other::rw-

If you just installed virtualization and this is the very first VM you tried to create,
Did you update your system immediately after installing virtualization?

zypper up

That was my solution when I ran into what you described years ago.
If you’re experiencing a similar problem, that should fix your problem.

TSU

In openSUSE 13.2 libvirt is built to run QEMU as user == qemu and group == qemu. User qemu is supposed to belong to kvm group. At least that is what QEMU RPM does. Check it, if needed manually add qemu user to kvm group. You can also check /etc/libvirt/qemu.conf in case something changed user that is used (user=, group= parameters).

Thanks a lot. Although my last update was done only a few days ago, I did a zypper ref & up and reboot. It is working now. (I didn’t pay much attention what exactly were updated as there were lots of libreoffice stuff)

I also removed my user name from all those three groups and re-login and tested, it is still working.

Thanks all for the help.