压缩VDI 文件
VBoxManage modifyvdi <uuid>|<filename> compact
VDI 文件会随着你的客座OS 中安装新程序而不断增大,但是它却并不因卸载程序而变小。
这时你就有必要先把闲置区充零,再就是用到上述命令。
具体步骤如下:
一、WINDOWS 下压缩 VDI 文件
1。在WIN里面整理碎片
2。
清除虚拟机硬盘上没用到的空间(把没用到的空间写入0),推荐使用sdelete -z。
sdelete下载地址:http://technet.
microsoft.com/en-us/sysinternals/bb897443.aspx
3。关掉 VBox 虚拟机
4。VBoxManage modifyvdi <uuid>|<filename> compact
例如:VBoxManage modifyhd Windows\ XP\ SP3.vdi --compact
二、LINUX 下下压缩 VDI 文件
1.One traditional way to zero unused blocks is to create a file that fills all the free space:
dd if=/dev/zero of=junk
sync
rm junk
2. VBoxManage modifyvdi <uuid>|<filename> compact
dd if=/dev/zero of=junk
sync
rm junk
2. VBoxManage modifyvdi <uuid>|<filename> compact
VBoxManage modifyvdi XXX.vdi --compact
本文提供了在Windows和Linux环境下压缩VirtualBox VDI文件的具体步骤。包括磁盘碎片整理、使用sdelete工具清除未使用的空间及运行VBoxManage命令进行压缩等操作。
879

被折叠的 条评论
为什么被折叠?



