These Things Matter to Me
Thursday, February 23, 2006
  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:
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.html
http://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
 
Comments:
Thanks for this information. I'm sure it's in "the manual" somewhere, but I was having a bad time finding any good information (quickly) outside of your article.

Your prerequisite section is what did it for me. In VMware WS 6.0, I performed the preparation phase, and was then prompted as to whether or not I wanted to shrink the disk right then and there.

I didn't have to use the vmware-vdiskmanager.exe program outside of this process.

Worked like a champ.

Thanks!
Charles R. Whealton
Charles Whealton @ pleasedontspam.com
 
Hi,

I downloaded the last version of vmware server (VMware-server-1.0.5-80187.tar.gz) but vmware-vdiskmanager doesn't have "-k" option.

Is there a later release? I'm desperate looking for the way of shrinking my vmdk files in my linux host.

Thank you very much!
 
I "shrunk" a vdisk as described; however, it appears that it created a snapshot. There is a new smaller vdisk file but it is linked to the original file.

I prepared the vdisk by mounting the disk and calling the vmware-vdiskmanager -p option. Then I unmounted the vdisk and called the -k option. There were two files. When I moved the original file. I got an error about not finding the parent file.

What did I miss?
 
Post a Comment

Subscribe to Post Comments [Atom]





<< Home
probably a little too much

About
Linux sysadmin. I cry when make fails. And during the Oscars. Every year.
Contact
andy: andiacts [at] gmail.com
Archives
September 2005 / October 2005 / November 2005 / December 2005 / January 2006 / February 2006 / March 2006 / April 2006 / May 2006 / June 2006 / July 2006 / August 2006 / November 2006 / December 2006 / January 2007 / February 2007 / March 2007 / April 2007 / May 2007 / June 2007 / July 2007 / August 2007 / September 2007 / October 2007 / November 2007 / December 2007 / January 2008 / February 2008 / March 2008 / April 2008 / May 2008 / June 2008 / July 2008 / August 2008 / September 2008 / January 2009 / February 2009 /




Powered by Blogger

Subscribe to
Comments [Atom]