VirtualBox - compact or enlarge the VDI

Requisite: Windows 7 virtualized on Linux machine



To compact a VDI:

    Windows side:
        Download here the SDelete command. You need it because the normal deletion process removes only the index of the file deleted but doesn't zeroes the space occuped.
        Uncompress the archive and extract sdelete.exe
        From a Command Prompt: "SDelete -z c:"
            (This will take a long time)


    Linux side:
        From a terminal (Ctrl-Alt-T)
        cd [path_of_vdi]
        /usr/bin/VBoxManage modifyvdi [disk_name.vdi] --compact
            (This will take a long time too)



To enlarge a VDI:

    Linux side:
        cd [path_of_vdi]
        VBoxManage modifyhd [disk_name.vdi] --resize [size_in_MB]
            (example: for 40 GB, 40960 MB)

No comments:

Post a Comment