# [Solved] Virt-Manager no kvm-acceleration

## yellowhat

Hi all,

I am trying to use qemu-kvm through virt-manager, so I emerged virt-manager, launched "/etc/init.d/libvirtd start".

I started virt-manager then I created a new VM but at the last step it gives me this error:

```
Could not access KVM kernel module: Permission denied

failed to initialize KVM: Permission denied

No accelerator found!
```

But kvm-amd module is loaded. Any ideas?

ThanksLast edited by yellowhat on Mon Jun 11, 2012 2:52 pm; edited 1 time in total

----------

## Ant P.

Are you running the VM with correct permissions to access /dev/kvm?

----------

## yellowhat

How can I check it?

----------

## yellowhat

All I did when I installed qemu-kvm was:

-> emerge qemu-kvm

-> gpasswd -a username kvm

-> modprobe kvm_amd

----------

## yellowhat

If I set in virt-manager to use qemu instead of kvm, the VM start but it is very slowly

----------

## yellowhat

Any ideas?

----------

## yellowhat

Adding:

```
QEMU_SOFTMMU_TARGETS="i386 x86_64" 

QEMU_USER_TARGETS="${QEMU_SOFTMMU_TARGETS}"

```

to make.conf, nothing is changed.

----------

## radegand

Hi

I seem to be getting the same error. I have been using KVM and virt-manager for a while without issues, and now I'm having the same problem. Permissions on /dev/kvm are fine:

```

# ls -la /dev/kvm 

crw-rw----+ 1 root kvm 10, 232 Jun 10 09:09 /dev/kvm

```

I can also start my VMs by hand from command line using the 'qemu-kvm' command and providing a path to an image, no probs there...

Permissions on libvirt sockets look fine:

```

# ls -la /var/run/libvirt

total 28

drwxr-xr-x  7 root root 4096 Jun 10 09:10 .

drwxr-xr-x 28 root root 4096 Jun 10 10:13 ..

srwxrwx---  1 root kvm     0 Jun 10 09:10 libvirt-sock

srwxrwx---  1 root kvm     0 Jun 10 09:10 libvirt-sock-ro

drwxr-xr-x  2 root root 4096 May 29  2009 lxc

drwxr-xr-x  2 root root 4096 Jun 10 09:10 network

drwxr-xr-x  2 root root 4096 Jun 10 11:50 qemu

drwxr-xr-x  2 root root 4096 May 29  2009 uml

drwxr-xr-x  2 root root 4096 Apr  3  2011 uml-guest

```

However, when I try using virt-manager, or virsh itself, I get:

```

# virsh start my_vm

error: Failed to start domain my_vm

error: internal error Process exited while reading console log output: char device redirected to /dev/pts/14

Could not access KVM kernel module: Permission denied

failed to initialize KVM: Permission denied

No accelerator found!

```

and that's regardless if run as regular user (who belongs to the kvm group),root or using sudo...any ideas appreciated  :Smile: 

Thanks

----------

## yellowhat

Can you post how did you install and configure virt-manager and qemu-kvm?

Thanks

----------

## PraetorZero

I ended up downgrading to app-emulation/libvirt-0.9.11.3 from app-emulation/libvirt-0.9.12.

Not the best solution, but I needed my VMs more than I needed a headache at the moment.   :Smile: 

----------

## yellowhat

Thank you so do I solved downgrading libvirt, I will open a bug report.

----------

## radegand

 *PraetorZero wrote:*   

> I ended up downgrading to app-emulation/libvirt-0.9.11.3 from app-emulation/libvirt-0.9.12.
> 
> 

 

...downgrading from 0.9.12 to 0.9.11.3 gave a hint, my 'lxc' use flag enforced setting of the 'caps' flag which probably resulted in Linux capabilities restricting libvirt access...

So if you can emerge 0.9.12 without caps, (I had to get rid of Linux containers), then it will work. Or find out how to configure 'caps' to allow VM access by libvirt.  :Smile: 

Cheers,

radegand

----------

## yellowhat

That's my bug report

https://bugs.gentoo.org/show_bug.cgi?id=420507

----------

## Ant P.

Yeah, just updated here and now it broke for me too. Running that command in the bug report fixed it for me.

----------

## yellowhat

Solved running: gpasswd -a qemu kvm

----------

## the_mgt

Thanks for solving this! Yesterday, before I read this thread, I thought about your solution, too, but I also thought "Nah, this is stupid."

Should have listened to my intuition.   :Very Happy: 

----------

## Alakhai

Yeah worked for me also!

----------

## cprior

 *yellowhat wrote:*   

> Solved running: gpasswd -a qemu kvm

 

Thanks a lot!

----------

## Caprisun

 *yellowhat wrote:*   

> Hi all,
> 
> I am trying to use qemu-kvm through virt-manager, so I emerged virt-manager, launched "/etc/init.d/libvirtd start".
> 
> I started virt-manager then I created a new VM but at the last step it gives me this error:
> ...

 

Has there been a large change with permissions? I got past this error, and I still can't run virt-manager as  a normal user even after adding them to the kvm group. I've tried adding them to the kvm group,qemu, just not root though it will probably work because it works as root.

I can work as root for now, I'm sure this can be resolved somehow.

I also tried editing /etc/conf.d/libvirt/libvirtd.conf

Nothing seemed to stick or make a difference, all of the commented lines make me think the daemon may be defaulting to its own options.

I've also logged out, even rebooted.

----------

## feiticeir0

 *yellowhat wrote:*   

> Solved running: gpasswd -a qemu kvm

 

Worked for me also ! Thank you !

My question: Why ? Why is the need now to add qemu to the kvm group ? Is an error or something the ebuild should have done ?

Thank you

----------

## Ant P.

The VMs previously ran as root, or something.

----------

## Alakhai

it seams that libvirt start as qemu user and after drop privs to kvm or somethings like

----------

