Saturday, February 28, 2026

Switching location of default libvirt's pool on Debian forky

Google's AI Assistant brief report some times shows up the command following below : If you need to redefine, use virsh pool-define-as --name default --type  dir --target /new/path/libvirt/images, some times skips it. However, "Dive deeper in AI mode" always point to this command. Same procedure may be also performed via Virt-manager GUI with option "preferences" => XML editing enabled and manually editing path to default pool and restarting daemon libvirtd.

Existing VMs: If you already have virtual machines, moving the pool will "break" their pathing. You must manually move the .qcow2 files to the new location and update each VM's XML configuration using virsh edit <vm_name> to point to the new disk path. 

 boris@DebianForky20FB:~$ uname -a

Linux DebianForky20FB 6.19.3 #1 SMP PREEMPT_DYNAMIC Thu Feb 19 13:29:45 EST 2026 x86_64 GNU/Linux

boris@DebianForky20FB:~$ mkdir -p lib/libvirt/images/

boris@DebianForky20FB:~$ sudo virsh pool-destroy default

[sudo] password for boris:

Pool default destroyed

boris@DebianForky20FB:~$ sudo virsh pool-undefine default

Pool default has been undefined

Per my experience next step is a must ( obviously my experience is limited )

boris@DebianForky20FB:~$ sudo virsh pool-define-as --name default --type dir --target /home/boris/lib/libvirt/images

Pool default defined

boris@DebianForky20FB:~$ sudo virsh pool-autostart default

Pool default marked as autostarted

boris@DebianForky20FB:~$ sudo virsh pool-start default

Pool default started

boris@DebianForky20FB:~$ sudo systemctl restart libvirtd

boris@DebianForky20FB:~$ sudo systemctl status libvirtd

● libvirtd.service - libvirt legacy monolithic daemon

     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; preset: enabled)

     Active: active (running) since Sat 2026-02-28 05:14:03 EST; 10s ago

 Invocation: 70acc549144a452d87816386c0e39190

TriggeredBy: ● libvirtd-ro.socket

             ● libvirtd-admin.socket

             ● libvirtd.socket

       Docs: man:libvirtd(8)

             https://libvirt.org/

   Main PID: 3610 (libvirtd)

      Tasks: 21 (limit: 32768)

     Memory: 8.3M (peak: 9.5M)

        CPU: 412ms

     CGroup: /system.slice/libvirtd.service

             └─3610 /usr/sbin/libvirtd --timeout 120

Feb 28 05:14:02 DebianForky20FB systemd[1]: Starting libvirtd.service - libvirt legacy monolithic daemon...

Feb 28 05:14:03 DebianForky20FB systemd[1]: Started libvirtd.service - libvirt legacy monolithic daemon.



















REFERENCES

https://serverfault.com/questions/840519/how-to-change-the-default-storage-pool-from-libvirt

No comments:

Post a Comment