VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (6 pts)
5 Replies Last post: Apr 13, 2009 10:46 AM by RDPetruska  

Reducing the size of a virtual machine posted: Apr 11, 2009 7:45 PM

Click to view Guille779's profile Novice 3 posts since
Apr 11, 2009

Hey guys,

Is there a way I can reduce the size of a disk image? I have a Windows XP image that started at around 4GB, I've installed only a couple of apps and it's been increasing in size ever since I created it. It's now at 9GB. Why is this?

Re: Reducing the size of a virtual machine

1. Apr 11, 2009 11:18 PM in response to: Guille779
Click to view mikelane's profile Hot Shot 241 posts since
May 14, 2007
What size are the apps that you installed?

Do you have Windows set to update automatically?

Are you surfing the internet on the machine or downloading files?

The 9GB of usage just reflects the size of the files that your windows installation is using.

You might also check Event Viewer for errors to see if you have problems that are being logged?

How much RAM do you have assigned to the virtual machine? This will also be reflected in a file in your virtual machine directory as will any snapshots of the virtual machine that you have taken

Without more details it's hard to tell ...

Re: Reducing the size of a virtual machine

3. Apr 13, 2009 8:01 AM in response to: Guille779
Click to view RDPetruska's profile Guru 15,877 posts since
Jan 11, 2005

The weird thing is that Windows only reports 6GB of used hard drive space, so where the heck are the other 3GB?

ANY disk activity is a write. ANY disk writes to a growable virtual disk will expand it. Even a "delete" is NOT a delete - just an update to the directory entry for the file. For at least a short while, the actual bits of the file still exist on the hard disk (until they become overwritten by some other file). Note that this is exactly the same as a physical hard disk... just that you don't see it expand so you don't realize that it is happening.

To reclaim the space on your host which your virtual disk is using, you need to run the Shrink command within the VMware Tools for your guest.

Re: Reducing the size of a virtual machine

4. Apr 13, 2009 10:23 AM in response to: RDPetruska
Click to view davidb2's profile Enthusiast 84 posts since
Jul 30, 2007
RDPetruska wrote:

The weird thing is that Windows only reports 6GB of used hard drive space, so where the heck are the other 3GB?

ANY disk activity is a write. ANY disk writes to a growable virtual disk will expand it. Even a "delete" is NOT a delete - just an update to the directory entry for the file. For at least a short while, the actual bits of the file still exist on the hard disk (until they become overwritten by some other file). Note that this is exactly the same as a physical hard disk... just that you don't see it expand so you don't realize that it is happening.

To reclaim the space on your host which your virtual disk is using, you need to run the Shrink command within the VMware Tools for your guest.

Maybe this explains why my disk also grew when I used System Tools>Disk Cleanup in XP Pro SP3 to compress old files? (I asked this in another thread I started a few days ago but got no answer.) By the way, subsequently running Shrink didn't reclaim the increased size.

David

Re: Reducing the size of a virtual machine

5. Apr 13, 2009 10:46 AM in response to: davidb2
Click to view RDPetruska's profile Guru 15,877 posts since
Jan 11, 2005

davidb2 wrote:
Maybe this explains why my disk also grew when I used System Tools>Disk Cleanup in XP Pro SP3 to compress old files? (I asked this in another thread I started a few days ago but got no answer.) By the way, subsequently running Shrink didn't reclaim the increased size.

David

Possibly. But, if your guest OS has used most of the space you've allocated for it (and hence why you'd want to run the Disk Cleanup utility in the guest), then there aren't many sectors left in the virtual drive containing deleted data which needs to be zeroed by the Shrink utility. Therefore, very little space available to be reclaimed.


Robert
http://communities.vmware.com/servlet/JiveServlet/download/38-20628/vExpert_logo_150x75.jpg

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities