So, without doing anything fancy like using symlinks to another storage volume, etc., here is a better way to go about changing this:
- As root, start virt-manager.
- Click Edit > Connection Details, and then click the Storage tab.
- The "Connection Details" dialog box opens.
- In the lower left hand corner of this new dialog box, click the green plus sign to add a pool.
- The "Add Storage Pool" dialog box opens.
- Specify a name for the pool (call it anything you want, it's just a label).
- For pool type select dir: Filesystem Directory and click the forward button.
- For the target path, browse to the directory you wish to use.
- After selecting your folder, click the finish button.
- Now you should have 2 storage pools (Default and the new one you just created).
Notes:
1) virt-manager will automatically create the pool directory if it does not already exist.
2) virt-manager requires the pool directory to be owned by root.
3) That's why I had you run virt-manager as root.
4) You don't normally need to run virt-manager as root (and probably shouldn't).
5) You can do all of this using virsh instead of virt-manager. Just look at the Redhat docs.
4) You don't normally need to run virt-manager as root (and probably shouldn't).
5) You can do all of this using virsh instead of virt-manager. Just look at the Redhat docs.
Now.....after having done all this one might expect being able use the new pool by selecting it during the creation of a new virtual machine. Well....that's not going to happen.
As it turns out, virt-manager does not behave as one might expect it would. Instead, there does not look to be any configurable way at all to ensure new virtual machines are automatically created using the new pool. Nor can the default pool itself be modified to use a new location (unless you symlink it or something).
In fact, even if you stop and remove the default pool, disk images still won't be created in the new pool. Instead they'll be created right smack in the middle of your own home directory. Not only that, after the next system reboot, the default pool comes right back, and virt-manager will once again automatically use it as the default pool (no questions asked). Pretty strange behavior if you ask me.
To use your new storage pool, you have to do something completely different and rather unexpected.
Prior to creating your virtual machine, manually create a storage volume in your new pool.
It goes without saying if you fail to select the new volume during the creation of your virtual machine, the volume will instead automatically be created in the default pool.
Perhaps if you removed all pools and then created a new pool and gave it the name "default", then virt-manager might begin to use it as the default pool. I am only speculating as I have not yet tried it.
I am curious whether the odd behavior of the virt-manager GUI is inherent to KVM itself, or simply the result of poor interface design. At any rate, it's behavior is not always very intuitive.
As it turns out, virt-manager does not behave as one might expect it would. Instead, there does not look to be any configurable way at all to ensure new virtual machines are automatically created using the new pool. Nor can the default pool itself be modified to use a new location (unless you symlink it or something).
In fact, even if you stop and remove the default pool, disk images still won't be created in the new pool. Instead they'll be created right smack in the middle of your own home directory. Not only that, after the next system reboot, the default pool comes right back, and virt-manager will once again automatically use it as the default pool (no questions asked). Pretty strange behavior if you ask me.
To use your new storage pool, you have to do something completely different and rather unexpected.
Prior to creating your virtual machine, manually create a storage volume in your new pool.
- Start virt-manager.
- Click Edit > Connection Details, and then click the Storage tab.
- In the left hand pane, select your new storage pool.
- In the lower right hand pane, click the New Volume button.
- The "New Storage Volume" dialog box appears.
- Type a name for the new image file and select the format type.
- Now specify the max volume size and the amount of disk space to be initially allocated.
- Click the Finish button when done.
It goes without saying if you fail to select the new volume during the creation of your virtual machine, the volume will instead automatically be created in the default pool.
Perhaps if you removed all pools and then created a new pool and gave it the name "default", then virt-manager might begin to use it as the default pool. I am only speculating as I have not yet tried it.
I am curious whether the odd behavior of the virt-manager GUI is inherent to KVM itself, or simply the result of poor interface design. At any rate, it's behavior is not always very intuitive.
Tip: I've noticed virt-manager likes to do everything as root and it even wants to take root ownership of your ISO files (another peculiarity of virt-manager).
When creating a new virtual machine, you can work around this issue by simply making a copy of your ISO file and dropping it into /tmp. Once the file is in /tmp who cares what virt-manager does to it as the entire /tmp directory is swept clean upon every reboot.
Hope that helps.
Michael