Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't run QEMU as a user
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
venc
n00b
n00b


Joined: 28 May 2012
Posts: 7

PostPosted: Thu Apr 04, 2013 10:34 am    Post subject: Can't run QEMU as a user Reply with quote

Hello,

I can run my VMs using the superuser account, but I'm unable to run qemu under my user account. It fails on accessing KVM module.
Code:
user@beacon ~/Virt $ ./WindowsVM.sh
Could not access KVM kernel module: Permission denied
failed to initialize KVM: Permission denied
No accelerator found!

my user account is in KVM group
Code:
user@beacon ~/Virt $ groups
wheel uucp audio cdrom video games kvm usb portage user rfreader

and /dev/kvm permissions
Code:
user@beacon ~/Virt $ ls -l /dev/kvm
crw-rw----+ 1 root kvm 10, 232 Apr  4 07:47 /dev/kvm

any guesses, what could be wrong?

Thanks
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6097
Location: Dallas area

PostPosted: Thu Apr 04, 2013 11:53 am    Post subject: Re: Can't run QEMU as a user Reply with quote

venc wrote:
Hello,

I can run my VMs using the superuser account, but I'm unable to run qemu under my user account. It fails on accessing KVM module.
Code:
user@beacon ~/Virt $ ./WindowsVM.sh
Could not access KVM kernel module: Permission denied
failed to initialize KVM: Permission denied
No accelerator found!



What are you doing inside WindowsVM.sh?
Is the kvm module loaded before you run the shell script or are you trying to load it from the shell script?
Kernel modules need to be loaded by root.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
venc
n00b
n00b


Joined: 28 May 2012
Posts: 7

PostPosted: Thu Apr 04, 2013 12:05 pm    Post subject: Reply with quote

Here is the content of WindowsVM.sh (copy-paste from some tut)
Code:
#!/bin/sh
exec qemu-kvm \
            -cpu host \
            -drive file=WindowsVM.img,if=virtio \
            -net nic -net user,hostname=windowsvm \
            -m 1G \
            -monitor stdio \
            -name "Windows" \
            $@


I do not have KVM as a module, it is hardwired in kernel (and it works with superuser privs) so there is no need to load KVM module tough.
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6097
Location: Dallas area

PostPosted: Thu Apr 04, 2013 12:31 pm    Post subject: Reply with quote

Don't know then, I run mine as modules.

I do have to run as root if I use passthrough (vfio), not sure if the same applies to virtio.
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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