Summary
Snapshot creation fails with "Permission denied" error when using libvirt provider on Ubuntu, even though file permissions are correctly set. The issue appears related to improper URL-encoding of the box image filename (containing "VAGRANTSLASH" instead of forward slash).
Debug output
Full debug output available at: https://gist.github.com/tomislav-varga/1fbe48ce2bd328526b20ce684475c10d
Key error from journalctl:
libvirtd[4298]: internal error: process exited while connecting to monitor:
2026-06-14T08:38:06.896141Z qemu-system-x86_64: -blockdev
{"driver":"file","filename":"/var/lib/libvirt/images/cloud-image-VAGRANTSLASH-ubuntu-24.04_vagrant_box_image_20260518.0.0_box.img"...}:
Could not open '/var/lib/libvirt/images/cloud-image-VAGRANTSLASH-ubuntu-24.04_vagrant_box_image_20260518.0.0_box.img': Permission denied
Expected behavior
VM should start successfully and snapshots should be created without permission errors. The box image filename should be properly encoded without "VAGRANTSLASH" placeholders.
Actual behavior
When vagrant up --provider=libvirt runs and attempts to create a snapshot:
- Vagrant creates a box image with malformed filename:
cloud-image-VAGRANTSLASH-ubuntu-24.04_vagrant_box_image_20260518.0.0_box.img
- QEMU fails to open the file with "Permission denied" error
- VM fails to start
- Subsequent
vagrant up attempts fail with: Call to virStorageVolCreateXML failed: storage volume 'cloud-image-VAGRANTSLASH-ubuntu-24.04_vagrant_box_image_20260518.0.0_box.img' exists already
Reproduction information
Vagrant version
vagrant -v output: Vagrant 2.4.9
Host operating system
Ubuntu 24.04 LTS with libvirt/QEMU virtualization
Guest operating system
Ubuntu 24.04
Steps to reproduce
- Create a minimal Vagrantfile with libvirt provider and Ubuntu 24.04 box
- Run
VAGRANT_LOG=info vagrant up --provider=libvirt
- Observe permission denied error during snapshot creation
- File permissions are correct:
-rw-r--r-- libvirt-qemu kvm on the image file
/var/lib/libvirt/images/ directory permissions are correct: drwx--x--x libvirt-qemu libvirt-qemu
Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "cloud-image/ubuntu-24.04"
config.vm.box_version = "20260518.0.0"
config.vm.synced_folder ".", "/vagrant", disabled: true
libvirt.driver = "kvm"
libvirt.cpu_mode = "host-passthrough"
end
end
Additional Information
- AppArmor: Disabled to rule out security policies - issue persists
- File attributes: No immutable or restrictive attributes set
- Filename issue: The presence of "VAGRANTSLASH" (likely URL-encoded
%2F) in the image filename suggests a metadata/encoding bug in how Vagrant generates or references box images
- Workaround attempted: Removing and re-adding boxes does not resolve the issue
- libvirt version: libvirtd (libvirt) 10.0.0
- QEMU version:
QEMU emulator version 8.2.2 (Debian 1:8.2.2+ds-0ubuntu1.16)
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers
Summary
Snapshot creation fails with "Permission denied" error when using libvirt provider on Ubuntu, even though file permissions are correctly set. The issue appears related to improper URL-encoding of the box image filename (containing "VAGRANTSLASH" instead of forward slash).
Debug output
Full debug output available at: https://gist.github.com/tomislav-varga/1fbe48ce2bd328526b20ce684475c10d
Key error from
journalctl:libvirtd[4298]: internal error: process exited while connecting to monitor:
2026-06-14T08:38:06.896141Z qemu-system-x86_64: -blockdev
{"driver":"file","filename":"/var/lib/libvirt/images/cloud-image-VAGRANTSLASH-ubuntu-24.04_vagrant_box_image_20260518.0.0_box.img"...}:
Could not open '/var/lib/libvirt/images/cloud-image-VAGRANTSLASH-ubuntu-24.04_vagrant_box_image_20260518.0.0_box.img': Permission denied
Expected behavior
VM should start successfully and snapshots should be created without permission errors. The box image filename should be properly encoded without "VAGRANTSLASH" placeholders.
Actual behavior
When
vagrant up --provider=libvirtruns and attempts to create a snapshot:cloud-image-VAGRANTSLASH-ubuntu-24.04_vagrant_box_image_20260518.0.0_box.imgvagrant upattempts fail with:Call to virStorageVolCreateXML failed: storage volume 'cloud-image-VAGRANTSLASH-ubuntu-24.04_vagrant_box_image_20260518.0.0_box.img' exists alreadyReproduction information
Vagrant version
vagrant -voutput: Vagrant 2.4.9Host operating system
Ubuntu 24.04 LTS with libvirt/QEMU virtualization
Guest operating system
Ubuntu 24.04
Steps to reproduce
VAGRANT_LOG=info vagrant up --provider=libvirt-rw-r--r-- libvirt-qemu kvmon the image file/var/lib/libvirt/images/directory permissions are correct:drwx--x--x libvirt-qemu libvirt-qemuVagrantfile
Additional Information
%2F) in the image filename suggests a metadata/encoding bug in how Vagrant generates or references box imagesQEMU emulator version 8.2.2 (Debian 1:8.2.2+ds-0ubuntu1.16)
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers