The Soul of a Virtual Machine

Things to know about running a virtual machine under Virtual Server

Blogs

New tool for precompacting virtual hard disks

  • Comments 12
  • Likes

Compacting your dynamically expanding virtual hard disks (VHDs) reduces the amount of disk space they use. Preparing a disk and compacting it is covered in the Virtual Server 2005 Administrator’s Guide, so I won’t go into it here. What’s new is this: you used to have to use a third-party tool to zero out available blank space on the VHD before compacting it. Now you can use a tool that's included with Virtual PC 2004 SP1 -- the Virtual Disk Precompactor.

If you have Virtual PC 2004, you can simply install SP1 to get this utility.* Otherwise, you’ll need to download the trial version of Virtual PC 2004, and then install SP1. (If you try to install it on your Windows Server 2003 machine, you'll get a warning that it isn't a supported OS. You can ignore the warning.)

To use Virtual Disk Precompactor, you must first capture Virtual Disk Precompactor.iso, which is installed with Virtual PC 2004 SP1. For instructions on capturing media, see "Add or remove a CD or DVD drive" in the Virtual Server 2005 Administrator's Guide. Virtual Disk Precompactor.iso is located in %ProgramFiles%\Microsoft Virtual PC\Virtual Machine Additions\.

After you capture Virtual Disk Precompactor.iso, you can run Virtual Disk Precompactor from the command line by navigating to the CD drive of the virtual machine and typing Precompact. The available parameters are:

  -Help - Displays help for the precompactor.

  -Silent - Runs the precompactor in unattended mode.

  -SetDisks - Specifies the disks to be precompacted. If this parameter isn't specified, then all virtual hard disks for this virtual machine are compacted.

Example: Precompact -Silent -SetDisks:CDE

Note that you can only compact dynamically expanding virtual hard disks. To compact fixed-size VHDs, you can convert them to dynamically expanding VHDs, compact them, and then convert them back to fixed size.

* As announced in my posting of January 12, 2005 (http://blogs.msdn.com/megand/archive/2005/01/12/351756.aspx), this tool also will be available in Virtual Server 2005 Service Pack 1.

Comments
  • I know I'm a little late here, but it hit me today while I was replying to a Virtual Server newsgroup post: Will we see the &quot;pre-compactor&quot; released for Virtual Server as well (or better yet, just as a download at Microsoft.com)? I know that the VS Administrator's guide gives info on compacting (and I quote, &quot;Use a non-Microsoft disk utility program to &quot;zero out&quot; deleted data, which overwrites the data with zeros.&quot;,) but the same way that having the ability to zero and compact is a very welcome addition to Virtual PC, it would also be welcomed for Virtual Server. <br> <br>Thanks! <br> <br>Jonathan

  • I'll keep you (and other readers) posted about broader availability of the pre-compactor, Jonathan.

  • Thanks Megan, I'll be looking forward to it. <br> <br>Jonathan

  • &lt;p&gt;&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Neh&#233;z &#233;s hossz&#250; sz&#252;l&#233;s ut&#225;n... ami főleg időhi&#225;nynak k&#246;sz&#246;nhető... k&#233;rj&#252;k azokat, akik sz&#237;vesen olvasnak (=azt a keveset), hogyha tal&#225;l vmi &#233;rdekeset, ak&#225;r el is k&#252;ldheti :)&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;&amp;lt;a href=&amp;quot;ht

  • Q: Lach writes with this question: &amp;quot;I have 2 virtual machines installed, and had them set up as dynamic...

  • Q: Lach writes with this question: &amp;quot;I have 2 virtual machines installed, and had them set up as dynamic...

  • <p>PingBack from <a rel="nofollow" target="_new" href="http://ilenextlheidi.stmhost.com/2008/02/09/dealing-with-a-vhd-that-grew-too-large/">http://ilenextlheidi.stmhost.com/2008/02/09/dealing-with-a-vhd-that-grew-too-large/</a></p>