Question: I use Libvirt and Virt-manager to create virtual machines on my Linux system. I noticed that the virtual machine image is located in the/var/lib/libvirt/images directory. Is there a way to change the default path for a virtual machine image?
Libvirt and its GUI front-end Virt-manager can use different hypervisors to create and manage VMs, such as LVM and Xen. By default, all virtual machine images are created through libvirt to the/var/lib/libvirt/images directory. However, this is sometimes not what we want. For example,/var/lib/libvirt/images here the size of the disk partition is limited. Or you want to store all the virtual machine images in a specific warehouse for management.
In fact, you can easily change the default directory for the Libvirt image, or call it a "storage pool."
There are two ways to change the default storage pool.
Method One: Virt-manager GUI
If you are using the Virt-manager GUI program, it is very easy to change the default storage pool.
Go to Virt-manager 's menu gui "edit", "Connection Details".
You can see the default storage pool, as shown below. In the lower left corner of the window, click the Fork button and the default storage pool will be stopped. Once the storage pool is stopped, click on the Trash bin on the right to delete the storage pool. Note that this action does not delete the mirror in the pool.
Now click on the plus sign on the left to add a new storage pool.
Enter the name of the new storage pool (for example: Default), and select the type of storage pool. In this case, because we just changed the storage pool directory, select "File system directory".
- Related articles recommended:
- Build a local area network mirror image source with Debian 7.5 CD/DVD to install Debian unattended in batch networks
- Linux Ask a question: How to extend the Xfs file system
- Configure access control lists (ACLs) for Linux
- This article from: Hobby Linux Technology Network
- This article link: http://www.ahlinux.com/mainte/9393.html
Linux system Getting Started learning: Changing the default location for Libvirt VM mirroring