Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using VirtualBox on Ubuntu with some programs installed in it. And the snapshot file does not stop to grow.

I don't need this feature. I just want my data to be saved on the virtual windows hard drive.

How can I remove the snapshot of 20GB without losing my documents and settings and without starting another one keeping growing ?

Thank you.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Virtual disks

When you create a VM, you create a virtual disk as well. This disk can be of fixed size or dynamically expanding. In the first case, the file will not grow, in the latter case, the file has a small size at startup and will grow as needed by the VM to the maximum size of the virtual disk. The dinamically expanding disk can be compacted using Lukas's answer steps.

Snapshots

When you take a snapshot, VBox create a new file in which all changes will be writed instead of the original virtual disk file. This new file will grow as needed to the maximum size of the virtual disk. If you take another snapshot at some point, this file will stop growing, VBox will create another file which will grow at its turn.

Deleting snapshots

If you don't need snapshots, then you can delete them, the data will be commited in the original virtual disk file (or original snapshot file in case of consecutive snapshots.) Just stop the VM, select the snapshot you want to delete, use the button with the red cross in the snapshots tab. It can take a long time, depending of the amount of data in the snapshot.

Restoring snapshots

The icon with the up arrow is to restore a snapshot (and forget all data changed since the shapshot date).

share|improve this answer

You can use my script to backup and restore the snapshot and then compact its HDD with:

  1. Defragment the disk on guest
  2. Run sdelete -c Con guest (download sdelete from http:// technet.microsoft.com/en-us/sysinternals/bb897443.aspx) which zeroes free space. I don't know Linux equivalent (maybe dd?).
  3. Run VBoxManage modifyhd winxp.vdi --compact on host
share|improve this answer

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.