Slimming VDI image files of virtualbox virtual machines

Source: Internet
Author: User

From: http://www.vmbest.com/school/2-virtualbox-school/388-virtualboxvdi

 

Virtualbox is a very helpful open-source Virtual Machine software. It is very small and runs fast. I use this software in Linux, virtual WindowsXP. However, after a period of time in use, especially when a large number of temporary files are used in the client, although the files are deleted, the size of the VDI file on the VM disk is only increased or decreased, the actual physical hard disk space will be wasted, resulting in insufficient disk space for the host. Now let's talk about how to return unused blank space in the VDI file to the host system and distribute it to the client when necessary.

 

I use Linux as the host, and the client is Windows XP with NTFS file system.
First install the sdelete software on the client. You can download it at the following address:

 
Http://www.microsoft.com/technet/sysinternals/Security/SDelete.mspx

Then input

 
Sdelete-C:

If there is a partition, fill in 0 blank disk space for each partition. That is, fill in all the blank spaces in NTFS format as '0 '.
Close the client and virtualbox, and enter

 
Vditool shrink windowxp_with_ntfs.vdi
Use vboxmanage modifyhd VDI file name compact in cmd

Vditool is a tool software provided by virtualbox. It mainly performs various operations on VDI files. Shrink is a parameter that indicates VDI file slimming.
After the VDI file is complete, it is restored to the current size, releasing unnecessary physical hard disk space.

 

I have verified that the original 23g is reduced to 17 GB, but the situation varies with each person, and the effect is not guaranteed to be obvious.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.