Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 7 down vote accepted

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

share|improve this answer
2  
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 '11 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. –  Breakthrough Aug 24 '11 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). –  Breakthrough Aug 24 '11 at 19:18
    
Well, it sounds to me like you do want to turn on this feature if your drive image file resides on an SSD... Admittedly you don't need to block defragging; just don't run defrag on the guest OS (make sure no automatic defrag or scheduled defrag is set up either), but why not have the extra check to prevent mistakes? TRIM may also help provide the device with additional information it can use to optimize itself better. This may not create any appreciable performance benefit, but I think it may help extend the life of the device. And FWIW, I don't see any reason not to... –  Dave Lillethun Aug 8 '13 at 0:59
    
@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. –  Breakthrough Aug 8 '13 at 10:51

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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