cannot delete snapshots

This is for discussing general topics about how to use VirtualBox.
Post Reply
quenda
Posts: 2
Joined: 19. Mar 2022, 17:55

cannot delete snapshots

Post by quenda »

I seem to have created a problem by deleting SATA drives that were used in earlier snapshots.
I now wish to delete all two snapshots to consolidate drive files, before creating a new snapshot with the current state.

Trying to delete the first snapshot gives: Cannot lock hard disk '/home/user/MISSING_DISK.vdi' when deleting a snapshot. ... VERR_FILE_NOT_FOUND
Cannot delete second snapshot either. .vdi' has more than one child hard disk (2).

So I tried to clone the VM, full clone of current machine state.
> Failed to clone the virtual machine macOS2. Result Code: NS_ERROR_FAILURE (0x80004005)

Any suggestions on a way to get a clean VM please? Perhaps I need to copy the data to a new VDI and hand-edit the vbox file?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: cannot delete snapshots

Post by scottgus1 »

quenda wrote:deleting SATA drives that were used in earlier snapshots.
If you did this by deleting the individual disk files in the host OS's File Manager, then this VM is screwed, unless you can get the files off a host backup and put them back.

Snapshots aren't backups. They are changed-disk-sector files, working as links in a chain, and are not standalone images.

Snapshots can only be deleted by deleting them inside the VM's Snapshots pane in the main Virtualbox window. This is because "deleting" a snapshot is really writing all of the stored changed sectors into the previous file in the chain.
quenda
Posts: 2
Joined: 19. Mar 2022, 17:55

Re: cannot delete snapshots

Post by quenda »

I realise of course that I cannot revert to the snapshot.
But the VM as-is, is working fine, and I just want to keep the current state.

I suppose my best option would be to clone the HDD within the VM to a new virtual drive, and then attach that new drive to a new VM with the same settings.
Is there something special I need to do with that new VDI, to detach it from the old VM before deleting that VM?

(i'm using Linux BTW, but posted here as I don't think it relevant)
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: cannot delete snapshots

Post by scottgus1 »

quenda wrote:clone the HDD within the VM to a new virtual drive, and then attach that new drive to a new VM
That's a good way. Clone the entire contents of the old VM's drive, not just some partitions.
quenda wrote:Is there something special I need to do with that new VDI, to detach it from the old VM before deleting that VM?
No, just detach from the old and attach to the new. I'd strongly suggest ensuring that the new VM works fine and is backed up to your backup media before deleting the old VM.
Post Reply