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 have a Windows XP VM (with VirtualBox 3.1.2) that is slowly getting its HD full. Sometimes even when I delete some stuff nothing happens with the free space.

I've already tried to defrag the VM and also tried the SysInternals sdelete utility, but it doesn't helped, in fact, the VM lost a little more space.

Any idea about what else should I try?

share|improve this question

After running sdelete inside the virtual machine did you shut it down and compact the drive? You need to run a command to tell VirtualBox to look for unused space and release it back.

Steps for releasing the allocated space for a .vhd

  1. Defragment the .vhd from inside the VM.
  2. Run sdelete from inside the VM.
  3. Shut down the VM.
  4. Open a command prompt (Start -> Run -> cmd.exe).
  5. Change directories to your virtual box installation directory.
    cd \Program Files\Sun\VirtualBox
  6. Run vboxmanage modifyhd {filename} --compact to shrink the file size.
    vboxmanage modifyhd "C:\Users\joshua\.VirtualBox\Hard Disks\XP Virtual Machine.vhd" --compact
  7. Wait for the process to complete.

You will need to know the location of your .vhd file. You can locate this information by opening the Virtual Media Manager (File > Virtual Media Manager...), select the drive to compact and look at the Location listed below. Once the process finishes you should end up with a .vhd file size that matches (or close to) the amount of space used in the VM.

share|improve this answer
Joshua, I did all the steps with no effect in the disk space. – Eder Gusatto Jan 28 '10 at 3:22

Perhaps you have some sort of virus or trojan running inside your VM slowly eating up the available diskspace? Or some other buggy program wasting space? I suggest running WinDirStat inside the VM to determine what is using up the most space.

share|improve this answer

You must log in to answer this question.

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