canonical/multipass

[snapshot] Raw error on snapshot deletion attempt on a running VM

Offen

#4.824 geöffnet am 15.04.2026

 (7 Kommentare) (0 Reaktionen) (1 zugewiesene Person)C++ (634 Forks)batch import
good first issuelowlow hanging fruit

Repository-Metriken

Stars
 (6.956 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 16T 2h) (50 gemergte PRs in 30 T)

Beschreibung

Describe the bug When deleting a snapshot from a running VM, Multipass will attempt the process without checking whether the VM is in a state that allows the process.

└─[λ] multipass delete a.snapshot1 --purge                            
delete failed: Cannot list snapshots from the image: qemu-img failed (Process returned exit code: 1) with output:
qemu-img: Could not open '/var/snap/multipass/common/data/multipassd/vault/instances/a/ubuntu-24.04-server-cloudimg-amd64.img': Failed to get shared "write" lock
Is another process using the image [/var/snap/multipass/common/data/multipassd/vault/instances/a/ubuntu-24.04-server-cloudimg-amd64.img]?

└─[2] multipass delete a.snapshot1        
Snapshots can only be purged (after deletion, they cannot be recovered). Are you sure you want to continue? (Yes/no): Yes
delete failed: Cannot list snapshots from the image: qemu-img failed (Process returned exit code: 1) with output:
qemu-img: Could not open '/var/snap/multipass/common/data/multipassd/vault/instances/a/ubuntu-24.04-server-cloudimg-amd64.img': Failed to get shared "write" lock
Is another process using the image [/var/snap/multipass/common/data/multipassd/vault/instances/a/ubuntu-24.04-server-cloudimg-amd64.img]?

To Reproduce How, and what happened?

  1. multipass launch -n a
  2. multipass stop a
  3. multipass snapshot a
  4. multipass start a
  5. multipass delete a.snapshot1 (--purge)

Expected behavior Multipass should return an error to the user telling them that the VM must be stopped for the process.

Additional info

  • OS: Ubuntu 24.04 (authd)
  • CPU architecture or model: amd64
  • multipass version: 1.17.0-dev

Contributor Guide