23

I noticed with version 4.1 that VirtualBox added a "Solid-State Drive" option in the storage section.

I also know that Windows 7 will report free space differently for a solid state disk so that the disk can re-use those sectors in its built-in optimization.

I'm wondering about turning this on even though my host has a spinning disk. Would this effectively zero free space so that I can compact my virtual disk? Would I take a big performance hit by turning this on?

Giacomo1968
  • 58,727
sherbang
  • 355

3 Answers3

13

This just changes whether or not your guest OS sees a solid-state drive (and enables/disables features based on that). Since VirtualBox supports physical pass-through for hard drives, this will only matter if you have a solid-state drive on the host computer and have the virtual hard drive on the same drive.

From the guest OS's perspective, all it will do is disable disk defragging, and try to send TRIM commands to the drive (they are ignored if the host drive doesn't support them, or VirtualBox is not using pass-through I/O requests). Aside from that, it's actually up to the SSD controller to choose what sectors to read/write data from/to, not the operating system.

You can turn this on, but you won't see any performance differences. For what it's worth, though, nobody ever has a reason to turn this on unless they are testing SSD-specific features (and even then, can test said features with a simulated SSD).

Breakthrough
  • 34,847
1

In theory one would think that marking an HDD as a SDD could be a good idea, because it would allow online shrinking of the virtual disk (if it's a VDI), thus freeing up some space on the host.

In practice, that online shrinking could impact performance, because, well, it’ll happen on a HDD, so it wouldn’t probably go as unnoticed as on a (much faster) SSD.

Quoting from a VirtualBox forum site moderator; bold emphasis is mine:

If you want the performance of an SSD you simply locate the VM on an SSD, simple as that. Trim being an optional extra. Marking a VDI as SSD when it's not located on an SSD will not improve performance. Potentially it could decrease performance if it causes image blocks to be shuffled, causing extra seek latencies.

Giacomo1968
  • 58,727
1

If you are doing pass through to an SSD, I'm pretty sure the guest is already going to see it as an SSD. This flag is much more relevant for virtual drives. I'm not clear on how much benefit this flag can provide, particularly if you have the guest tools installed on the guest, but a few things come to mind.

First, there is the "TRIM" feature, which can help the host OS to know it doesn't need to flush out unused file system pages to disk once they are abandoned.

More than that though, I think a potential win could be that most OS's turn off their normal elevator scheduling for disk IO when presented with an SSD. Particularly if you have host I/O caching enabled, this is probably a big win, as having two levels of elevated scheduling is likely counter productive.

Giacomo1968
  • 58,727