Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to reduce the maximum capacity of a .vdi file (hard disk) for one of my VMs.

I set it as dynamically-allocated with a maximum capacity of 25GB. I want to reduce this to 10GB.

NOTE: I do not want to compact the size of the .vdi file on my host machine. Then I could just use VBoxManage modifyhd --compact /path/to/my/vdi. However, although this reduces the footprint of the .vdi file on my host machine, the guest will still report a 25GB hard drive.

What I want to do is reduce the maximum capacity of the .vdi such that the guest reports a 10GB hard drive (I have already adjusted my partitions within the guest such that my partitions only take up 10GB total, and the other 15GB comes up as unallocated space).

What I have tried

I tried using the same command one uses to increase the size of the disk:

$ VBoxManage modifyhd Arch\ Linux\ Aug\ 2012\ Clone.vdi --resize 10240
0%...
Progress state: VBOX_E_NOT_SUPPORTED
VBoxManage: error: Resize hard disk operation for this format is not implemented yet!

It seems not to be supported (and the .vdi is definitely a dynamically-allocated .vdi, not a fixed-size one).

cheers.

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

Correct. You cannot downsize a VDI file, even if it does have unallocated disk space. At least not with the current version of VirtualBox. The only thing --resize can do at the moment is to increase the size of a VDI file.

share|improve this answer
    
awww, ok. I guess since I only let my partitions take up 10GB total and since it's dynamically sized, I can hope to always have an on-disk file of <= 10GB (with compacting) –  mathematical.coffee Sep 4 '12 at 23:48
    
Well, you could always use the method I suggested here. –  Ansgar Wiechers Sep 4 '12 at 23:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.