In NixOS 23.11 when I try to restore a Vagrant snapshot it fails with a mysterious IO error:
$ vagrant init generic/ubuntu2204
$ vagrant up
$ vagrant snapshot push
$ vagrant snapshot pop
Call to virDomainRevertToSnapshot failed: End of file while reading data: Input/output error (Libvirt::Error)
Full transcript
$ vagrant init generic/ubuntu2204
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
$ vagrant up
Bringing machine 'default' up with 'libvirt' provider...
==> default: Checking if box 'generic/ubuntu2204' version '4.3.12' is up to date...
==> default: Creating image (snapshot of base box volume).
==> default: Creating domain with the following settings...
==> default: -- Name: vagrant-snapshot_default
==> default: -- Description: Source: /home/user/sandbox/vagrant-snapshot/Vagrantfile
==> default: -- Domain type: kvm
==> default: -- Cpus: 2
==> default: -- Feature: acpi
==> default: -- Feature: apic
==> default: -- Feature: pae
==> default: -- Clock offset: utc
==> default: -- Memory: 2048M
==> default: -- Base box: generic/ubuntu2204
==> default: -- Storage pool: default
==> default: -- Image(vda): /var/lib/libvirt/images/vagrant-snapshot_default.img, virtio, 128G
==> default: -- Disk driver opts: cache='default'
==> default: -- Graphics Type: vnc
==> default: -- Video Type: cirrus
==> default: -- Video VRAM: 256
==> default: -- Video 3D accel: false
==> default: -- Keymap: en-us
==> default: -- TPM Backend: passthrough
==> default: -- INPUT: type=mouse, bus=ps2
==> default: Creating shared folders metadata...
==> default: Starting domain.
==> default: Domain launching with graphics connection settings...
==> default: -- Graphics Port: 5900
==> default: -- Graphics IP: 127.0.0.1
==> default: -- Graphics Password: Not defined
==> default: -- Graphics Websocket: 5700
==> default: Waiting for domain to get an IP address...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 192.168.121.78:22
default: SSH username: vagrant
default: SSH auth method: private key
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
$ vagrant snapshot push
==> default: Snapshotting the machine as 'push_1710461858_4519'...
==> default: Snapshot saved! You can restore the snapshot at any time by
==> default: using `vagrant snapshot restore`. You can delete it using
==> default: `vagrant snapshot delete`.
$ vagrant snapshot pop
==> default: Restoring the snapshot 'push_1710461858_4519'...
/nix/store/35912xccb7f6445k5rbfflf6ppvz0ph8-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/driver.rb:114:in `revert_to_snapshot': Call to virDomainRevertToSnapshot failed: End of file while reading data: Input/output error (Libvirt::Error)
from /nix/store/35912xccb7f6445k5rbfflf6ppvz0ph8-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/driver.rb:114:in `restore_snapshot'
from /nix/store/35912xccb7f6445k5rbfflf6ppvz0ph8-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-libvirt-0.12.2/lib/vagrant-libvirt/action/snapshot_restore.rb:15:in `call'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:48:in `call'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:127:in `block in finalize_action'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:48:in `call'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/builder.rb:180:in `call'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `block in run'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/util/busy.rb:19:in `busy'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `run'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/builtin/call.rb:53:in `call'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:48:in `call'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/warden.rb:48:in `call'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/builder.rb:180:in `call'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `block in run'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/util/busy.rb:19:in `busy'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/action/runner.rb:101:in `run'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/machine.rb:248:in `action_raw'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/machine.rb:217:in `block in action'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/environment.rb:631:in `lock'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/machine.rb:203:in `call'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/machine.rb:203:in `action'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/plugins/commands/snapshot/command/push_shared.rb:50:in `pop'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/plugins/commands/snapshot/command/push_shared.rb:15:in `call'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/plugins/commands/snapshot/command/push_shared.rb:15:in `block (2 levels) in shared_exec'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/environment.rb:631:in `lock'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/plugins/commands/snapshot/command/push_shared.rb:14:in `block in shared_exec'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/plugin/v2/command.rb:243:in `block in with_target_vms'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/plugin/v2/command.rb:232:in `each'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/plugin/v2/command.rb:232:in `with_target_vms'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/plugins/commands/snapshot/command/push_shared.rb:8:in `shared_exec'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/plugins/commands/snapshot/command/pop.rb:46:in `execute'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/plugins/commands/snapshot/command/root.rb:65:in `execute'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/cli.rb:67:in `execute'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/lib/vagrant/environment.rb:301:in `cli'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/lib/ruby/gems/3.1.0/gems/vagrant-2.3.7/bin/vagrant:217:in `<top (required)>'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/bin/.vagrant-wrapped:18:in `load'
from /nix/store/xnwrb0ayb9pn1w1sv3pcr1azvqpavm1i-vagrant-2.3.7/bin/.vagrant-wrapped:18:in `<main>'
Would could cause this? I see no mention of the error in Vagrant’s issue tracker or community forums so I first suspect the NixOS environment/packaging.
Does it work for anyone else?