VMware Communities
Obeechi
Contributor
Contributor

Compression: to NTFS Compress the Virtual Disks or Not?

On the flip side of Increasing Virtual Disk size is the question of Compression. Both address availability of space. Someone here told me I need to shrink after compressing in the VM for the space to be available to the Host (OSX). I posed my question in terms of using Zip... but then the question of NTFS compression raised itself, and whether best practice would be to compress the whole virtual disk. I'm running Vista and have four virtual disks, two of which are for backing up (no. 3), and archiving (no. 4).

In a Vista virtual environment running on the Mac, is there a best practice that can be suggested, between NTFS compression and Zip compression, and between compressing the entire disks, or just folder(s), or individual files?

EDIT: I've never used compression on a Virtual Machine, and neither on a non-virtual. What I've read makes it seem that Zip compression can't be used for when you want to access individual files within a zip compressed folder. Neither does Zip seem to be offered for whole disk (virtual disks in this case). Though Zip compression is said to be greater compression, NTFS compression seems more sensible to use because you can compress the whole disk and access individual files. However, something I read somewhere suggested that if you use NTFS compression then it's going to eat up greater CPU usage, even when you're not accessing files on the compressed disk. As a VM already puts a good burden on the CPU, I hope this isn't true. What's the pragmatic truth in this, for compressing in a VM without losing access to individual files, without taxing the CPU (if that's even true). Is NTFS compression the best choice, and how will this affect the need to shrink? Will shrinking after turning NTFS compression on be required?

Tags (1)
0 Kudos
2 Replies
jim_gill
Expert
Expert

NTFS compression works fine in a virtual machine. As with everything, there are tradeoffs: compressing your NTFS disks can reduce the amount of space your VM takes up on the Mac, but at the cost of some performance (Windows needs to decompress all this data after reading it from the disk).

The way virtual disks work, though, means your vmdk files don't get smaller just because you compress the files within them. A virtual disk grows whenever Windows writes to a part of the (virtual) disk for the first time. It doesn't shrink back when a file is deleted; that space stays as "unallocated" space in the Windows filesystem. So if you take an NTFS disk and have Windows compress it, all the space that's recovered becomes "free space" to Windows, It isn't released back to the Mac, but it can slow down further growth of the vmdk file.

To recover this empty space back for your Mac, you can shrink the disk: in Fusion 2.x, this works best if you right-click the VMware Tools icon in the tray and shrink from there. It won't let you shrink while there are outstanding snapshots.

One way to limit the compression performance hit is to compress particular files or folders, rather than the whole disk. That's what I do on my home Windows machine, where there's tons of stuff like Visual Studio sample code that I like to have around, but hardly ever look at.

0 Kudos
Obeechi
Contributor
Contributor

Well, what I'm doing is putting some files that I don't access a lot (like for backups of files, and for archived files) is putting them into virtual disks that aren't used for anything. So I don't think the performance hit is much of an issue, since I won't be accessing them much. I can understand needing to shrink after the initial compression. Now I understand this is needed whether using Zip or NTFS. What I'm not entirely clear of is, will I need to re-shrink after access files from the NTFS compressed virtual disks. I think that windows will first uncompress and then decompress each file that I open and close. But not sure if this is done entirely in RAM or if it's going to cause the virtual disk to expand. One last thing, is NTFS compression the only option for compression that allows you to access individual files within the compressed area (folder or disk),

0 Kudos