LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   How do I give libvirt search permissions on an external drive? (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/how-do-i-give-libvirt-search-permissions-on-an-external-drive-4175470828/)

Usalabs 07-25-2013 12:10 AM

How do I give libvirt search permissions on an external drive?
 
I'm running Ubuntu 12.04 x64, and installed KVM (libvirt), along with the GUI (virtual machine manager), I would rather use KVM than using a software VM, such as VMware or VBox, because it utilizes the CPU VM flag, so, after installing virtual machine manager, I added myself to the lbvirt group to be able to create VM domains, now here's the problem, to save space (even though I have a 1TB HDD) I have all ISO's on an external USB drive, but when I try to create a new VM using one of those ISO's, libvirt gives me an error that it doesn't have search permissions on that drive and would I like to correct it, to which I click 'Yes' and then it says unable to change permissions, access denied.

Now, bearing in mind, the external HDD is also Windoze accessible, as it contains windows backups.

How do I give libvirt search permissions on that external HDD?

druuna 07-25-2013 02:14 AM

Am I correct in assuming that the HDD in question has a Windows File-System on it (ntfs/fat or alike)?

If that is the case then I don't think it is possible.

libvirt changes the permissions, owner and group of the file, which it cannot do on a none unix/linux file-system (windows file-systems work differently).

Usalabs 07-25-2013 06:23 AM

Yes, the USB HDD is NTFS.

So basically unless I copy all the files to another drive and format the USB to a Linux format such as EXT4, the only other way would be to copy a wanted ISO to Ubuntu then libvrt can change that ISO group and user to its own permissions, so that I can create the VM domain, then delete the ISO as root, because the permissions would have been changed, and a user account will not be able to delete it.

gradinaruvasile 07-25-2013 09:26 AM

Quote:

Originally Posted by druuna (Post 4996386)
Am I correct in assuming that the HDD in question has a Windows File-System on it (ntfs/fat or alike)?

If that is the case then I don't think it is possible.

libvirt changes the permissions, owner and group of the file, which it cannot do on a none unix/linux file-system (windows file-systems work differently).

This option can be deactivated in /etc/libvirt/qemu.conf - set "dynamic_ownership = 0". But in this case you have to make absolutely sure that the file in question can be changed by the user libvirt uses to run vms through (its not the same as the logged in user!).

NTFS is another matter since it is used via the ntfs-3g wrapper and the Linux ownership flags may not apply (hence the failed attempts), but if this option is turned off and the partition in question is indeed writable, it should work.
Another issue might be disk access speeds in the VM since KVM has the virtio drivers designed to be used with standard Linux formats so it might suffer a performance penalty.

Quote:

Originally Posted by Usalabs
I would rather use KVM than using a software VM, such as VMware or VBox, because it utilizes the CPU VM flag

What? EVERY virtualization software uses the "CPU VM flag". They CAN do without it (=if the CPU isnt capable) - and this is a plus versus KVM that cannot work without the amd-v/intel vt-x extension. Although recently KVM was included in QEMU altogether and Qemu can do software virtualization.


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