20

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

I also know that Win7 will report free space differently for a solid state disk so that the disk can re-use those sectors in it's 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?

2 Answers 2

12

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).

7
  • 5
    TRIM is what I was thinking of. I'd expect TRIM would help VirtualBox know which blocks are free so it doesn't have to grow the .vdi as much/often. Of course that's only if VBox has TRIM support, which some quick Google searches aren't telling me.
    – sherbang
    Aug 24, 2011 at 18:59
  • AFAIK, it does not have TRIM support. That being said, there are much easier/faster ways to accomplish this. See the following question, Is it possible to shrink a VirtualBox dynamic image? Alternatively (this is what I do), you can just compress the VDI with an archiver (7zip, WinRar, etc...), and extract it when you need to fire up the machine. Aug 24, 2011 at 19:14
  • Sorry, one last thing to add... Even if the virtual hard drive was TRIM aware, that wouldn't prevent the VDI from increasing in size as much. Without TRIM, a hard drive will overwrite still closer "deleted" blocks before extending out. All TRIM does is tell the SSD controller which blocks it can use with garbage collection (to help prevent write amplification). Aug 24, 2011 at 19:18
  • 1
    @DaveLillethun yes, that's what I said in my answer. The original question was asking about turning this feature on while running the virtual machine off of a hard drive, not a solid state drive. Indeed it is worth turning this feature on if the image resides on a SSD. Aug 8, 2013 at 10:51
  • 2
    AFAIK Virtualbox can use TRIM command to shrink vdi files automatically. And no, no archiver can compress your virtual hard disk like vboxmanage compact because all the non-zero sectors on disk still need to be compressed even though they belong to deleted files. The only way to really shrink those image files are zeroing sectors by tools like zerofree
    – phuclv
    Nov 16, 2016 at 6:53
0

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 elevator scheduling is likely counter productive.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.