Category: QEmu/Virtual-Manager

Virtual Manager/libvirt: how to change default location of VM images

Dump the actual default configuration

$ virsh pool-dumpxml default > pool.xml

Edit the XML file and change <path> element from /var/lib/libvirt/images to your new location

<pool type='dir'>
 <name>default</name>
 <uuid>0ec0e393-28a2-e975-feec-0c7356f38d08</uuid>
 <capacity unit='bytes'>975762788352</capacity>
 <allocation unit='bytes'>530052247552</allocation>
 <available unit='bytes'>445710540800</available>
 <source>
 </source>
 <target>
 <path>/my/new/path/images</path>
 <permissions>
 <mode>0711</mode>
 <owner>-1</owner>
 <group>-1</group>
 </permissions>
 </target>
 </pool>

Remove the current default pool

$ virsh pool-destroy default

Update the new storage pool based on the modified XML file

 $ virsh pool-create pool.xml

Instead if you want to add a new pool, also edit the <name> element and then

virsh pool-create pool.xml
virsh pool-refresh <new-name>

WordPress Themes