How to Shrink a VMware Guest in VMware Workstation/ VMware GSX Server/, VMware Server. And... VMware Server lets you do something new!
(At some point I hope to have some screen grabs, but some notes:)
Shrinking a VMware guest (.vmdk file)
The basic command: To make the size of a VMware guest image smaller, use the vmware-vdiskmanager command, with the -k option:
>vmware-vdiskmanager.exe -k guest.vmdk
The prep work:Less talked about, but equally important, is "preparing the guest for shrinking,"
from inside the guest OS. Before you run vmware-vdiskmanager, boot into your guest OS:
- open vmware-toolbox (both Windows and Linux VMware guests will have this)
- click the "shrink" tab
- make sure all relevant drives are selected
- run "Prepare to Shrink."
OS Gotchas:Note: most existing documentation suggests that the shrink option of vmware-vidskmanager will only work on a Windows host.
The VMware docs say you can shrink any kind of guest, but only from Windows hosts. This is somewhat true.
The Linux versions of VMware Workstation 5.5 and VMware GSX Server 3.x versions of the vmware-vdiskmanager tool do not even have a "-k" flag.
(This is officially documented for VMware Workstation 5.x, and VMware GSX Server 3.x:
http://www.vmware.com/support/ws55/doc/ws_disk_manager_shrinking.htmlhttp://www.vmware.com/support/gsx3/doc/disks_vdiskmanager_eg_gsx.html)
Special undocumented present from VMware:But the new GSX replacement product, VMware server, seems to let you do shrink with the vmware-vdiskmanager, from a Linux host! As of February 24, 2006,
there's still no official documentation for VMware server, but
the vmware-vdiskmanager tool included with it on the Linux version of VMware Server does support the -k (shrink) option! Very cool!
TECHNORATI TAGS: vmdk, VMware, virtualization, sysadmin, VMware Server, free, VMware Workstation