Error when compacting vdi

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Pers
Posts: 1
Joined: 9. Dec 2014, 08:12

Error when compacting vdi

Post by Pers »

Hi,there is a problem.

When I compacted vdi to free space on the host,An error occured.There is some information coming from vboxmanager.exe.

Progress state: VBOX_E_FILE_ERROR
VBoxManage.exe: error: Failed to compact hard disk
VBoxManage.exe: error: Could not compact medium 'E:\VirtualBox\Windows\Windows 2
003\Snapshots/{3d3d38d0-2e07-4b3c-a818-89dbf0038f0d}.vdi' (VERR_VD_BLOCK_FREE)
VBoxManage.exe: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component M
edium, interface IMedium
VBoxManage.exe: error: Context: "int __cdecl handleModifyHardDisk(struct Handler
Arg *)" at line 582 of file VBoxManageDisk.cpp

What should I do?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Error when compacting vdi

Post by mpack »

Not compacting snapshots would be a good start! That's a complete waste of time I'm afraid to say.

I assume you are concerned about disk space. In which case your mistake was when you decided to use snapshots at all. Your best fix is probably to clone the most recent snapshot using CloneVDI, with the Compact option ticked. CloneVDI actually will in this case create a standalone VDI which is a (compacted) merge of that snapshot and all its ancestors. You must then build a new VM around the clone VDI: it is important that you don't attempt to mount the clone VDI in the original VM, as the original VM is expecting snapshots.

Test the new VM, and if everything is ok you can then delete the old one.

When building the new VM, try to move the VDI into the VM folder before using it, that keeps everything in one folder which is best. Oh, and avoid snapshots in future.
Post Reply