Virtual Machine environment maintenance-VDI to vmdk, vmdk slimming
After being abused by virutal box three times, I decided to give up happily.
VDI virtual hard disk really hurts me.
Fortunately, VDI can be switched to vmdk, while the Virtual Machine of virtual box can also be opened, open the manager in virtual Box software, you must use the clone method to convert VDI to clone virtual hard disk, create a vmwarevm and use the vmdk. From then on, the virtual box is a passer-by and I unmount it directly.
I found that the vmdk file is too large, so I searched Google and used VMware Tools to slim down the vmdk.
Vmware-vdiskmanager-K *. vmdk, but it is not thin.
In fact, there is such a reason that the vmdk file is large because the guest system always occupies space and does not release it. It does not release the space by itself, and it cannot achieve its goal if it wants to use other tools to force it to release.
Search Google again. In this case, use the root user command on the guest terminal:
CAT/dev/Zero> zero. fill, until this command cannot be executed. The guest system prompts that there is not enough space. Then LS-l will check this zero. the fill file is too large. Delete it happily, turn off the guest system, and use the vmware-vdiskmanager command to quickly lose weight. No error is found, but it is a good habit to back up before executing this slimming command.
If your guest system is not created in single disk mode, but is created using scattered files, there will be a lot of vmdk files in the Virtual Machine directory, you should find the first one, such as the virtual machine called centos, you just
Vmware-vdiskmanager-K centos. vmdk
In addition, to lose weight, you must delete all the previous snapshots. Similarly, if the previous snapshot is important, back up the snapshots.