Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 420649

Summary: app-emulation/qemu-kvm-1.0.1-r1 in combination with app-emulation/libvirt-0.9.12: starting virtual machines fails with permission denied for /dev/kvm
Product: Gentoo Linux Reporter: Martin Dummer <martin.dummer>
Component: Current packagesAssignee: Doug Goldstein (RETIRED) <cardoe>
Status: RESOLVED DUPLICATE    
Severity: major CC: martin.dummer, qemu+disabled, virtualization
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Martin Dummer 2012-06-11 08:28:12 UTC
after upgrading libvirt to app-emulation/libvirt-0.9.12, virtual machines based on qemu-kvm cannot be started from libvirt any more

it fails with 

Could not access KVM kernel module: Permission denied
failed to initialize KVM: Permission denied
No accelerator found!


The reason is that libvirt has changed its behavour how it starts the qemu-kvm processes.
before libvirt-0.9.12, qemu-kvm was started as user root, now with libvirt-0.9.12 the qemu-kvm process is started as user qemu

Problem is now: the user qemu is not able to access /dev/kvm so qemu fails with "permission denied"  (/dev/kvm is owned by root:kvm)


Resolution that works for me: add the group "kvm" as a secondary group to qemu by submitting the command

gpasswd -a qemu kvm

After that the libvirt daemon can start virtual machines again
Comment 1 Michael Weber (RETIRED) gentoo-dev 2012-06-11 10:17:09 UTC

*** This bug has been marked as a duplicate of bug 420507 ***