How a Large Virtual Machine Disk Affects SSD Lifetime

ssdvirtualboxvirtualizationwindows

I've an interesting doubt. Since virtual machines create a file that represents a hard disk – the so-called virtual disk -, and it usually takes 20-40GB (and even more), how does this affect a solid-state disk (SSD) life time?

For example, in my case I'm using VirtualBox latest version and since some more-than-a-year version, VirtualBox supports marking virtual hard disks as SSD in order to let guest operating system (i.e. Windows 7 and above) detect the whole disk as SSD and optimize the OS to work better with SSD pros and cons.

My virtual machine is a Windows 7 virtual development environment with Visual Studio and I rarely do intensive write operations. Well, saving code files when I edit them… But these are small writes.

The actual question is how virtualization software systems treat these big virtual disk files. I guess that a write in the guest machine is treated the same way as a write in the host machine, and a virtual machine doesn't shrinks SSD life-time more than a host OS, if I use virtual machines in the same way as host OSes.

Best Answer

Your assumption is mostly correct, a write on the VM's disk equals a write on the physical disk, even though there are many different virtual disk formats and the answer will be different for each one of them, I'm pretty sure some formats implement caching which can lower the number of writes on the physical disk.

The important part is that you shouldn't do in the VM anything that you wouldn't do on your real machine, that includes defragmentation, etc... that's actually why there is an option to mark a drive as an SSD in most virtualization software, so that guest OSes will disable such features that are harmful to SSDs.

Note that TRIM in virtual machines has no effect but isn't dangerous or harmful in any way, the virtual storage controller will just ignore the discard commands sent by the guest OS.

Related Question