Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Virt-Manager no kvm-acceleration
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 482

PostPosted: Wed Jun 06, 2012 1:32 pm    Post subject: [Solved] Virt-Manager no kvm-acceleration Reply with quote

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:

Code:
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?

Thanks
_________________
Gentoo Linux ~x86, Kernel 3.11.2, Enermax Revolutions85+ 850W, AMD Athlon 64 X2 5000+ BE, Corsair XMS2 PC6400 3GB, ASUS M2R32, Sapphire HD6870, Creative X-Fi Platinum, WD Raptor 150GB, WD 2.5 320GB, Asus DRW-24B1ST


Last edited by yellowhat on Mon Jun 11, 2012 2:52 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2584
Location: UK

PostPosted: Wed Jun 06, 2012 6:22 pm    Post subject: Reply with quote

Are you running the VM with correct permissions to access /dev/kvm?
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 482

PostPosted: Wed Jun 06, 2012 6:28 pm    Post subject: Reply with quote

How can I check it?
_________________
Gentoo Linux ~x86, Kernel 3.11.2, Enermax Revolutions85+ 850W, AMD Athlon 64 X2 5000+ BE, Corsair XMS2 PC6400 3GB, ASUS M2R32, Sapphire HD6870, Creative X-Fi Platinum, WD Raptor 150GB, WD 2.5 320GB, Asus DRW-24B1ST
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 482

PostPosted: Wed Jun 06, 2012 7:10 pm    Post subject: Reply with quote

All I did when I installed qemu-kvm was:
-> emerge qemu-kvm
-> gpasswd -a username kvm
-> modprobe kvm_amd
_________________
Gentoo Linux ~x86, Kernel 3.11.2, Enermax Revolutions85+ 850W, AMD Athlon 64 X2 5000+ BE, Corsair XMS2 PC6400 3GB, ASUS M2R32, Sapphire HD6870, Creative X-Fi Platinum, WD Raptor 150GB, WD 2.5 320GB, Asus DRW-24B1ST
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 482

PostPosted: Thu Jun 07, 2012 3:23 pm    Post subject: Reply with quote

If I set in virt-manager to use qemu instead of kvm, the VM start but it is very slowly
_________________
Gentoo Linux ~x86, Kernel 3.11.2, Enermax Revolutions85+ 850W, AMD Athlon 64 X2 5000+ BE, Corsair XMS2 PC6400 3GB, ASUS M2R32, Sapphire HD6870, Creative X-Fi Platinum, WD Raptor 150GB, WD 2.5 320GB, Asus DRW-24B1ST
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 482

PostPosted: Fri Jun 08, 2012 4:58 pm    Post subject: Reply with quote

Any ideas?
_________________
Gentoo Linux ~x86, Kernel 3.11.2, Enermax Revolutions85+ 850W, AMD Athlon 64 X2 5000+ BE, Corsair XMS2 PC6400 3GB, ASUS M2R32, Sapphire HD6870, Creative X-Fi Platinum, WD Raptor 150GB, WD 2.5 320GB, Asus DRW-24B1ST
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 482

PostPosted: Sat Jun 09, 2012 5:13 pm    Post subject: Reply with quote

Adding:
Code:
QEMU_SOFTMMU_TARGETS="i386 x86_64"
QEMU_USER_TARGETS="${QEMU_SOFTMMU_TARGETS}"


to make.conf, nothing is changed.
_________________
Gentoo Linux ~x86, Kernel 3.11.2, Enermax Revolutions85+ 850W, AMD Athlon 64 X2 5000+ BE, Corsair XMS2 PC6400 3GB, ASUS M2R32, Sapphire HD6870, Creative X-Fi Platinum, WD Raptor 150GB, WD 2.5 320GB, Asus DRW-24B1ST
Back to top
View user's profile Send private message
radegand
n00b
n00b


Joined: 22 Aug 2008
Posts: 45
Location: Poland

PostPosted: Sun Jun 10, 2012 10:58 am    Post subject: Reply with quote

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:
Code:

# 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:
Code:

# 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:
Code:

# 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 :)
Thanks
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 482

PostPosted: Sun Jun 10, 2012 11:46 am    Post subject: Reply with quote

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

Thanks
_________________
Gentoo Linux ~x86, Kernel 3.11.2, Enermax Revolutions85+ 850W, AMD Athlon 64 X2 5000+ BE, Corsair XMS2 PC6400 3GB, ASUS M2R32, Sapphire HD6870, Creative X-Fi Platinum, WD Raptor 150GB, WD 2.5 320GB, Asus DRW-24B1ST
Back to top
View user's profile Send private message
PraetorZero
Apprentice
Apprentice


Joined: 11 Dec 2004
Posts: 239
Location: /home

PostPosted: Sun Jun 10, 2012 2:58 pm    Post subject: Reply with quote

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. :)
_________________
What's the worst that can happen?
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 482

PostPosted: Sun Jun 10, 2012 4:04 pm    Post subject: Reply with quote

Thank you so do I solved downgrading libvirt, I will open a bug report.
_________________
Gentoo Linux ~x86, Kernel 3.11.2, Enermax Revolutions85+ 850W, AMD Athlon 64 X2 5000+ BE, Corsair XMS2 PC6400 3GB, ASUS M2R32, Sapphire HD6870, Creative X-Fi Platinum, WD Raptor 150GB, WD 2.5 320GB, Asus DRW-24B1ST
Back to top
View user's profile Send private message
radegand
n00b
n00b


Joined: 22 Aug 2008
Posts: 45
Location: Poland

PostPosted: Sun Jun 10, 2012 8:51 pm    Post subject: Reply with quote

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. :)

Cheers,
radegand
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 482

PostPosted: Sun Jun 10, 2012 9:12 pm    Post subject: Reply with quote

That's my bug report

https://bugs.gentoo.org/show_bug.cgi?id=420507
_________________
Gentoo Linux ~x86, Kernel 3.11.2, Enermax Revolutions85+ 850W, AMD Athlon 64 X2 5000+ BE, Corsair XMS2 PC6400 3GB, ASUS M2R32, Sapphire HD6870, Creative X-Fi Platinum, WD Raptor 150GB, WD 2.5 320GB, Asus DRW-24B1ST
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2584
Location: UK

PostPosted: Mon Jun 11, 2012 2:48 pm    Post subject: Reply with quote

Yeah, just updated here and now it broke for me too. Running that command in the bug report fixed it for me.
Back to top
View user's profile Send private message
yellowhat
Guru
Guru


Joined: 10 Sep 2008
Posts: 482

PostPosted: Mon Jun 11, 2012 2:52 pm    Post subject: Reply with quote

Solved running: gpasswd -a qemu kvm
_________________
Gentoo Linux ~x86, Kernel 3.11.2, Enermax Revolutions85+ 850W, AMD Athlon 64 X2 5000+ BE, Corsair XMS2 PC6400 3GB, ASUS M2R32, Sapphire HD6870, Creative X-Fi Platinum, WD Raptor 150GB, WD 2.5 320GB, Asus DRW-24B1ST
Back to top
View user's profile Send private message
the_mgt
Apprentice
Apprentice


Joined: 05 Aug 2005
Posts: 259
Location: Germany, near Hannover

PostPosted: Sat Jun 16, 2012 10:30 am    Post subject: Reply with quote

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. :D
_________________
Citadel Groupware | Avahi Howto
Back to top
View user's profile Send private message
Alakhai
Apprentice
Apprentice


Joined: 16 Oct 2003
Posts: 151

PostPosted: Mon Aug 06, 2012 2:50 pm    Post subject: Reply with quote

Yeah worked for me also!
_________________
Gentoo Linux 64Bit User
Back to top
View user's profile Send private message
cprior
n00b
n00b


Joined: 03 Jun 2004
Posts: 57
Location: #gentoo ;)

PostPosted: Sun Aug 12, 2012 6:29 am    Post subject: Reply with quote

yellowhat wrote:
Solved running: gpasswd -a qemu kvm


Thanks a lot!
Back to top
View user's profile Send private message
Caprisun
n00b
n00b


Joined: 08 May 2012
Posts: 15

PostPosted: Mon Aug 13, 2012 4:57 am    Post subject: Re: [Solved] Virt-Manager no kvm-acceleration Reply with quote

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:

Code:
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?

Thanks


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.
Back to top
View user's profile Send private message
feiticeir0
Apprentice
Apprentice


Joined: 13 Jul 2005
Posts: 260
Location: Castelo Branco, Portugal

PostPosted: Tue Aug 14, 2012 1:02 pm    Post subject: Reply with quote

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
_________________
Do It With Rhythm
Back to top
View user's profile Send private message
Ant P.
Advocate
Advocate


Joined: 18 Apr 2009
Posts: 2584
Location: UK

PostPosted: Tue Aug 14, 2012 6:14 pm    Post subject: Reply with quote

The VMs previously ran as root, or something.
Back to top
View user's profile Send private message
Alakhai
Apprentice
Apprentice


Joined: 16 Oct 2003
Posts: 151

PostPosted: Mon Sep 17, 2012 8:26 pm    Post subject: Reply with quote

it seams that libvirt start as qemu user and after drop privs to kvm or somethings like
_________________
Gentoo Linux 64Bit User
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum