LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   virt-manager storage pool on lvm - non-root user problem (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/virt-manager-storage-pool-on-lvm-non-root-user-problem-826091/)

octinum 08-13-2010 05:00 PM

virt-manager storage pool on lvm - non-root user problem
 
I've been experimenting with KVM for some time and I think it's time I dump my Windows partition altogether -well, had to use Windows for some Windows-only programs I have to use for work. :)
I can build VM guests on raw files etc. What I need is using a logical volume (LV) of a volume group (VG) as target for guest VM.
Here's what I did:
1) Threw a new disk and configured LVM.
2) Created a volume group called lvmdepo. It has a swap partition in it, so i think it works so far. :)
3) Created an LV called virtwin1 in the VG lvmdepo.
4) Ran Virt-Manager. Connected.
5) Edit --> host details, Storage tab.
6) Click add pool, select "logical: LVM Volume Group", give the name of my existing VG. Forward to selection window.
7) Enter target path as /dev/lvmdepo. Click Finish
8) Had this error: "Could not start storage pool: internal error '/sbin/vgchange -ay lvmdepo' exited with non-zero status 5 and signal 6: WARNING: Running as a non-root user. Functionality may be unavailable.
/var/lock/lvm/V_lvmdepo:aux: open failed: Permission denied. Can't get lock for lvmdepo"

What I understand is that, it tries to issue a vgchange command, then, since Virt-Manager wasn't run as superuser, fails to use the command.

I tried running Virt-manager as superuser (sudo virt-manager) and successfully installed a guest VM on the very same LV. So it works. What I need is a way to make it work for a non-root user.

Thanks for the ideas in advance. :)

r3sistance 08-14-2010 04:43 AM

If this is all being down in Virt-Manager you could configure it in sudoers (and use sudo) if you are willing to give the users enough power to do that... that's the simple fix but does mean you need to trust people to begin with, with virt-manager (what if you wanted them having this type of power to start with, you'd probably have to do).

octinum 08-14-2010 08:51 AM

Thanks for the idea, r3sistance. :)

Well, giving sudoers excessive authorization wouldn't be a problem -I'm the only primary user of this box and nobody logs into it apart from a few Samba shares.
But what I'm trying to do is getting all my Virtualization on usermode/userspace. Actually, I just lost my network bridge in usermode; I know it will work as superuser for superuser can modify bridges by default but, if Ubuntu has put the Virt-Manager menu entry as a non-root user, why so limited?
Still looking for some way to use Virt-Manager efficiently without going superuser. Maybe will open another topic like "using Virt-manager as non-root user" because now I cant:
- configure the VM to use a LVM partition
- Get my bridge used by VMs
- Can't use virsh etc. with my already configured VMs -which are configured using Virt-manager 0.8.4. virsh simply can't list my VM guests, displays an empty list.


All times are GMT -5. The time now is 10:41 PM.