Skip to content

Instantly share code, notes, and snippets.

@rainzoo
Created October 20, 2016 06:53
Show Gist options
  • Save rainzoo/7d4ae7dbf9b4816baabf54e1746a17bb to your computer and use it in GitHub Desktop.
Save rainzoo/7d4ae7dbf9b4816baabf54e1746a17bb to your computer and use it in GitHub Desktop.
Alice Vs VirtualBox

Bug

Alice asks VirtualBox to delete a snapshot. Not just any snapshot but one whose child snapshot has a snapshot. VirtualBox deletes the snapshot file, but when she launchs the VM, VirtualBox complains:

Failed to open a session for the virtual machine VMName V2.

Could not open the medium 'C:\Users\Alice\VirtualBox VMs\VMName V2\Snapshots/{snapshot_that_should_have_been_deleted}.vdi'.

VD: error VERR_FILE_NOT_FOUND opening image file 'C:\Users\Alice\VirtualBox VMs\VMName V2\Snapshots/{snapshot_that_should_have_been_deleted}.vdi' (VERR_FILE_NOT_FOUND).

Result Code: E_FAIL (0x80004005)
Component: MediumWrap
Interface: IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}

Workaround

Alice copies an existing snapshot and renames it to the one that should've been deleted: VBoxManage internalcommands sethduuid "{snapshot_that_should_have_been_deleted}.vdi" "snapshot_that_should_have_been_deleted"

Also, Alice sets the Parent UUID of the hd

C:\Users\Alice\VirtualBox VMs\VMName V2\Snapshots>VBoxManage internalcommands sethdparentuuid "{snapshot_on_which_universe_depends}.vdi" snapshot_that_should_have_been_deleted

Otherwise Virtualbox complains about the Parent UUIDs:

Parent UUID {0374ab26-b1e3-43b7-b4a3-3ca785df042b} of the medium 'C:\Users\Alice\VirtualBox VMs\VMName V2\Snapshots/{snapshot_on_which_universe_depends}.vdi' does not match UUID {snapshot_that_should_have_been_deleted} of its parent medium stored in the media registry ('C:\Users\Alice\.VirtualBox\VirtualBox.xml').


Result Code: 
E_FAIL (0x80004005)
Component: 
MediumWrap
Interface: 
IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}

Solution

  1. Do not create a snapshot of a snapshot and then delete the grandparent
  2. Clone from the child snapshot and discard the old
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment