About Windows Installer, the .NET Framework, and Visual Studio.
Many times it's necessary to debug solutions on other machines so that you don't corrupt your developer machine, because of different platform requirements, or to attach a debugger without changing the state of the machine. Testing Windows Installer patches is no different. We test on daily target builds using daily upgrade builds. Installing daily builds isn't always such a good idea, and because Windows Installer now caches MSP re-installing a patch with slightly different contents but the same PatchCode proves difficult.
Of course we have labs full of machines, but because these run through a complete installation of both the OS and other components such as service packs and lab tools, I prefer Microsoft Virtual PC and Virtual Server. Both at home and at work I've got a good base build with very little installed, including the latest service packs, hotfixes, and the Visual Studio .NET 2003 native remote debugger. Once that's all set up, I enable undo disks. Now whenever I need to start over I simply turn off the virtual machine and discard the changes. When I restart I have a fresh new machine.
In order to decrease disk space requirements, you have to compact your virtual hard disks, or VHD files. If you run the Virtual Disk Wizard from the File menu and choose to edit and compact an existing VHD, the wizard states that, "Before you compact this virtual hard disk, you must zero out free space on it with a third-party tool that you install on the guest operating system." The CHM file for Virtual PC 2005 Service Pack 1 has a similar message. Finding such a tool wasn't so easy. SDelete from Sysinternals starts by zeroing free space, but then fills it with 0xff and then random bytes. It also grows the size of a dynamic disk because it creates a file to fill all available space which most likely hasn't been allocated yet in the VHD.
Before writing such a utility I, of course, tried Microsoft Support. I was able to find one KB article — KB 888760 — that made mention of such a tool, which was not a third-party tool at all.
This can significantly reduce the size of your base VHD file. When it's finished, click Settings to open the settings for your virtual machine, select Undo Disks, and check Enable Undo Disks.
Virtual Hard Drive Compacting
PingBack from http://www.philiprichardson.org/blog/post/Virtual-Hard-Drive-Compacting.aspx
PingBack from http://smurfonspreadsheets.wordpress.com/2007/11/21/virtual-pc/
PingBack from http://sharevm.wordpress.com/2008/11/25/compressing-virtual-images/
PingBack from http://sharevm.wordpress.com/2008/12/13/virtual-machine-disk-image-compression/
Thanks a bunch! My VHD was getting to 20+GB...
You can use "sdelete -z"! That will only zero-fill unused space, and it's even documented as being good for virtual disk compaction.