Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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).


share|improve this question
up vote 10 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) – Sep 4 '12 at 23:48
Well, you could always use the method I suggested here. – Ansgar Wiechers Sep 4 '12 at 23:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .