Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
qemu permission error?
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
uberDoward
n00b
n00b


Joined: 09 Jun 2011
Posts: 40

PostPosted: Thu Dec 28, 2017 2:26 am    Post subject: qemu permission error? Reply with quote

My error:
libvirtError: Failed to connect socket to '/var/run/libvirt/libvirt-sock': Permission denied

I followed:
https://wiki.gentoo.org/wiki/QEMU

This failed:
virt-manager
To run as a normal user, after emerging, ensure they are in the libvirt group:

root #usermod -a -G libvirt <user>

I tried:
I added the libvirt group, added my user to libvirt group, but I'm 99% certain that there's a missing step in the wiki (how do I verify that libvirtd is running with permissions allowing the libvirt group that didn't exist?)

kvm group contains qemu and my user.

Appreciate any help :)
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7234
Location: almost Mile High in the USA

PostPosted: Thu Dec 28, 2017 5:27 am    Post subject: Reply with quote

Are you using policykit and have that working?

Else I think you will need to su/sudo to root to use libvirt, then again I don't think it's much different either way...

Not sure if it's possible to use libvirt without root, but it's possible to use qemu by itself without root. To use qemu with kvm, /dev/kvm needs to be accessible.

You should be able to see /usr/sbin/libvirtd running when running

$ ps xa|grep libvirt
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
uberDoward
n00b
n00b


Joined: 09 Jun 2011
Posts: 40

PostPosted: Fri Dec 29, 2017 2:27 pm    Post subject: Reply with quote

Well, I pulled down policykit (+dbus, +consolekit), rebuilt the system, and still having the same issue.

sudo virt-manager from a terminal inside Xfce4 (via vnc) works fine.

gksu virt-manager to launch it from the Xfce panel doesn't work, though. I get a message that "This app was launched with root privileges due to the way your authentication system is yadda yadda"

*sigh*
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7234
Location: almost Mile High in the USA

PostPosted: Sat Dec 30, 2017 1:04 am    Post subject: Reply with quote

With policykit enabled, you should see a password prompt for root if you don't have any other configuration. Did you get that to show up?

Run (as a regular user)

$ pkexec id

as a user, does it prompt for a root password, and does it indicate you indeed got root privileges?

If virt-manager is enabled with policykit, it too should ask for a root password. Then setting yourself in the right group (or hacking policy; which is not recommended) will let you get root access to run virt-manager without requiring the password.

BTW, apologies for making it seem like you had to use policykit to make this work (especially if you were against using it); setting up a sudo system is equally a valid solution.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
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