Return to Level1Techs.com

Allowing VM to be stored on second drive


#1

Hi all
So finally I have most of my VM setup for passthrough, except I can't save a VM drive on my 2nd HDD due to permission error.
Is there any suggestions even running virt manager as root (test only!!) it fails

Suggestions?

Thanks


#2

I don't think I can help, but could you confirm if you are passing the physical disk to the VM, or just want to create a Virtual HD in a dir on the second disk?


#3

Did you create a storage pool located on the drive?

Where did you mount this drive?

Which permissions have you set to the folder in which the libvirt storage pool is located?


#4

Its just a Virtual HD on the drive, similar to how Hyper V would be.


#5

First we need to know if you connect to the system session of libvirt or the user. When running virt-manager as root i assume you didn't (manually) create a user session for root.

By default the system session stores its images in /var/lib/libvirt/images/. This folder is owned by root:root.

You don't need to run virt-manager as root to connect to the libvirt system session!

Do you want to use the VM in a user or system (root) session?

If you want to use a user session you can create one by selecting file → Add Connection …. Then select QEMU/KVM user session as hypervisor.

No matter which session you can change the storage pool under Edit → Connection Details. now select the storage tab. In the bottom left you can find a plus. Click this and add a new storage pool (storage location) and select some folder on your second drive. Or even the drive itself by changing the type from dir to disk.

Make sure the directory belongs to your user (if user session) or the user that runs the process "libvirtd" this usually root, libvirt or libvirtd.

If the folder has the wrong permissions (as indicated by your error, then change the permission via chown or grafically using your file manager.


#6

Right I think ive got it now,
So I have created a pool and then a virtual drive of around 250GB, I then have virt-manager looking at this directory, it seems to allow it access.
Additionally I have changed the qemu.conf file to allow root access currently, unsure if it will still be allowed to access the drives when I disable this again.


#7

you need to make sure the libvirtd group has access to any folder that you want to use with kvm, as kvm does not run as your local user


#8

Right managed to get the VM working, apart from it been a bit slow it works fine now, Virt-manager has full access to the 2nd drive :)

Thanks for the help all!