Install an OS that doesn't have TRIM on a VM on an SSD?

Discussion in 'Windows, Linux & Others on the Mac' started by Sven11, Feb 14, 2014.

  1. Sven11 macrumors 6502a

    Joined:
    Sep 25, 2010
    #1
    I'm planning on installing an OS that doesn't have TRIM support in a virtual machine on my Mac with an SSD. Now I know that doing this natively is a really bad idea since the SSD is going to slow down over time and its life spawn will be shorter. Now what about a virtual machine? Any solution if it is the case here as well?
     
  2. dyn macrumors 68030

    Joined:
    Aug 8, 2009
    Location:
    .nl
    #2
    The vm has a virtual hard disk. The guest OS will only see a hard disk, no ssd. Having TRIM or not doesn't matter (it doesn't really matter if you natively ran it on an ssd either btw).
     
  3. hfg macrumors 68040

    hfg

    Joined:
    Dec 1, 2006
    Location:
    Cedar Rapids, IA. USA
    #3
    The VM running on OS X is just a file (container of multiple files) to OS X which will trim the entire disk if trim is enabled. Thus, the VM will not suffer any speed degradation similar to any other program file.

    Even if the OS was installed natively on the SSD, modern SSDs have internal trim (garbage collection) to take care of this issue, even though not synchronized to OS deletion.
     
  4. Sven11 thread starter macrumors 6502a

    Joined:
    Sep 25, 2010
    #4
    OK, but then I'm wondering why Windows 8.1 sees an SSD and has TRIM enabled even though it is in a VM?

    I'm using a late 2013 iMac btw.
     
  5. Sven11 thread starter macrumors 6502a

    Joined:
    Sep 25, 2010
    #5
    I'm also wondering if it would make a difference having the VM file on my internal or external SSD?
     
  6. hfg macrumors 68040

    hfg

    Joined:
    Dec 1, 2006
    Location:
    Cedar Rapids, IA. USA
    #6
    I'm not sure what you mean here ... I can only "see" the VM disk from within Windows (7) using the Windows disk management tools provided (this is on my Mac Pro). I cannot access the actual physical host disk from within the VM environment.

    I will go fire up my iMac which has a Windows 8.1 VM (VMware Fusion) on it and see what happens there.


    -howard

    ----------

    The popular "TrimEnabler" for non-oem SSDs shows my external SSDs having trim enabled over a Thunderbolt interface. It is my understanding that using a USB 3.0 interface will not allow OS trim to be applied.
     
  7. Sven11 thread starter macrumors 6502a

    Joined:
    Sep 25, 2010
    #7
    When I open the command prompt on Windows 8.1 running in a VM on my iMac and type in a command that checks if TRIM is enabled or not, it says it is enabled. Therefore it knows that it's running on an SSD.
     
  8. hfg macrumors 68040

    hfg

    Joined:
    Dec 1, 2006
    Location:
    Cedar Rapids, IA. USA
    #8
    What Windows command are you using ... and what VM are you using?

    Possibly the VM host passes that disk information to the Windows VM such that Windows thinks it is in a standard "pure" environment rather than on a virtual disk created by the VM in OS X.
     
  9. Sven11 thread starter macrumors 6502a

    Joined:
    Sep 25, 2010
    #9
    This one: fsutil behavior query DisableDeleteNotify and the result is 0.

    What VM? You mean Windows 8.1, VMWare Fusion?
     
  10. ayeying macrumors 601

    ayeying

    Joined:
    Dec 5, 2007
    Location:
    Yay Area, CA
    #10
    VM sees it as a SSD because some VM software like Parallels shows the actual drive information, like the model number and type. But it still doesn't have full access to the drive so having TRIM or not doesn't matter.
     
  11. Sven11 thread starter macrumors 6502a

    Joined:
    Sep 25, 2010
    #11
    I still doubt it if it is good for my SSD to have an non-TRIM OS in a VM.
     
  12. MagicBoy macrumors 68040

    MagicBoy

    Joined:
    May 28, 2006
    Location:
    Manchester, UK
    #12
    It's not a problem. The VM doesn't get access to the physical disk. OS X deals with that.

    Older versions of Parallels (I'm going back to 2006 here!) tended to have issues with slack space in the virtual machine. Parallels is most likely leveraging TRIM in the VM to keep the size of the file down.
     
  13. Sven11 thread starter macrumors 6502a

    Joined:
    Sep 25, 2010
    #13
    I'm using VMWare. Is anyone here running a non-TRIM OS in a VM as well on an SSD? Are there any problems you experienced? What's the health status of your SSD?
     
  14. hwojtek macrumors 6502a

    hwojtek

    Joined:
    Jan 26, 2008
    Location:
    A small rural village in western Poland
    #14
    It is because the Virtual Machine application (VMWare, Parallels, whatever) checks the specs of the actual hardware and then reports to the guest OS "this virtual computer that does not exist in reality uses a fantasy SSD with TRIM support". Since the actual "Virtual Computer" is just a file on the disk, this file is managed by the host OS. And this OS supports TRIM, so all writes will be TRIM-med accordingly. It is because this "other" system is "virtual" - it does not access the hardware directly (as opposed to host OS). So you can install whatever non-TRIM OS in your virtual machines, it will have zero impact on your SSD's life.
     
  15. ayeying macrumors 601

    ayeying

    Joined:
    Dec 5, 2007
    Location:
    Yay Area, CA
    #15
    Even if you could TRIM in a VM, you only trimmed that xxGB amount of space out of your entire drive. So it would be pointless. Secondly, the VM might see your SSD but it DOES NOT have any physical/firmware access to your SSD so what can it change? In fact, the VM file itself is no different then an MP3 or AVI. There's really no need to worry about the health of the SSD. Unless you're writing hundreds of GB of data per day, it will last several years. (Unless there's a defect then any amount of TRIM will NOT help)
     
  16. Sven11 thread starter macrumors 6502a

    Joined:
    Sep 25, 2010
    #16
    OK, but then I'm a bit concerned after reading this on the internet:

    http://social.technet.microsoft.com...88-3f88b8aaa167/win-xp-virtual-machine-on-ssd

    Are .vmwarevm files better than .vhd files in this aspect?
     
  17. hwojtek, Feb 16, 2014
    Last edited: Feb 16, 2014

    hwojtek macrumors 6502a

    hwojtek

    Joined:
    Jan 26, 2008
    Location:
    A small rural village in western Poland
    #17
    The XP VM is a subsystem of Windows7 (or was it Vista?). If you run the XP VM within a Vista/7 "computer" that by itself is running in a VMWare/Parallels virtual machine, all activity will be contained to a single file that represents the (top) VM. Think of a VM in a VM - nothing is changed here, the actual writes and reads are performed on the physical disk by the physical computer you have on your desk and this computer runs a TRIM-enabled OS X. Everything virtualized is just a file on the disk and there is no technical possibility for a virtual machine (this being a host-OS independent rule) to override the way the actual physical disk is accessed. It needs to be addressed by the host OS. If the host OS supports TRIM, the data will be trimmed. The guest OS does not see a physical disk. What it does see, is a virtual disk that does not exist physically. This virtual disk is represented on the physical disk as a file. The host OS takes care of this disk and files on it and TRIMs it accordingly.

    If, however, you intend to boot your computer straight to Windows Vista/7 (or whatever it may be, that has an XP Virtual Machine) you are in the same boat - because the whole idea of a "virtual machine" is for it to be virtual. It does not access the hardware directly. The VMWare or Parallels or even the "XP VM" application serves as a layer between the OS that the computer was been booted into (the host operating system - one that resides physically on the hard drive) and the virtual appliances, be it also guest operating systems. This layer must obey all the rules of the host operating system - in this case, all disk activity will be making use of the SATA TRIM command when necessary. Exactly in the same way your iTunes copy, move, delete and modify data within mp3 files. You do not ask if iTunes is TRIM-enabled. The system is.

    And no, if the host OS supports TRIM there is no way to tell whether some files are better or worse. The idea of the virtual computing (the "layer" above) makes them all equal. They all will make use of whatever the host OS offers, because the actual writes are performed by the host OS itself.
     
  18. Sven11 thread starter macrumors 6502a

    Joined:
    Sep 25, 2010
    #18
    Yeah OK, I was a bit concerned about the fact that a virtual machine generates far more activity than let's say iTunes. I gonna run it then...
     
  19. hwojtek macrumors 6502a

    hwojtek

    Joined:
    Jan 26, 2008
    Location:
    A small rural village in western Poland
    #19
    You really do not have to. Even something as complicated as a virtual machine is at the end of the day a file on your SSD, which is TRIM-med by the host OS and you do not need to worry any further.
     
  20. MagicBoy macrumors 68040

    MagicBoy

    Joined:
    May 28, 2006
    Location:
    Manchester, UK
    #20
    SSDs don't work contiguously like spinny disks, what appears to be the next logical block to the OS might physically be the other end of the drive. As the access time is virtually nil on an SSD performance is unaffected.

    What on a spinny disk to be repeated writes to one sector isn't on an SSD as the drive firmware spreads them around as part of a process called wear levelling.
     
  21. dyn macrumors 68030

    Joined:
    Aug 8, 2009
    Location:
    .nl
    #21
    No it is not. It is nothing but an ordinary vm with Windows XP installed in it. It requires you to install VirtualPC but you can use the same image to run in Virtualbox or VMware Player. I have switched to using Player on 1 machine because it ran much more stable and it had no issues with the usb whatsoever (the vm ran an old utility that only works on XP; the utility drives some kind of device which is hooked up via usb).

    It does it like any other vm software. The vm itself is not more than just a file with some settings and the virtual disk (which holds the data and can be either 1 file or a couple of files) as you and many others here have already explained.

    The other way around ;) The OS in the vm sees ordinary hardware as if it was installed on a physical machine and thus it will see a physical disk. However, as explained earlier this is not real, it is fake, the virtualisation software makes it think that way. In reality the disk is a virtual disk which is nothing but a file (or a bunch of files). In that regard it is no different than say a Word document. This is also why both Parallels and VMware Fusion have placed the folder containing all the vm's inside the users Documents folder (at least in the past they did).

    In this case it usually adds very little. Part of the operations will happen in memory and part will be written to disk. TRIM only comes into play when you actually delete data (this can either be done by an application, the OS or the user).

    I have been using ssd's as of 2009 and never enabled TRIM on them. The reason why I bought an ssd in the first place was to speed up the vm's I was running and the ssd has a very big impact on that. I have never experienced slowdowns of any of my ssd's. Something like TRIM and all those other tweaks are usually a bit overhyped. TRIM and GC do serve a purpose but it isn't as mission critical as quite a lot of people want you to believe. Nearly all of them forget that TRIM and GC only apply to deleted data, not to data that will stay on your disk.

    Or in short: don't worry, just use it and be happy!
     
  22. MagicBoy macrumors 68040

    MagicBoy

    Joined:
    May 28, 2006
    Location:
    Manchester, UK
    #22
    Just to add - this won't work. XP Mode as provided with Windows 7 Pro/Ultimate requires VT (hardware virtualisation featues) on the CPU. Parallels/VMWare can't provide this as it requires direct access to the hardware.
     
  23. hwojtek macrumors 6502a

    hwojtek

    Joined:
    Jan 26, 2008
    Location:
    A small rural village in western Poland
    #23
    dyn & magicboy - thanks for your clarifications. You are both apparently pros regarding the VMs (good point with the VT on the processor, magic boy!), I am just a lousy Parallels user :)
     
  24. dyn macrumors 68030

    Joined:
    Aug 8, 2009
    Location:
    .nl
    #24
    Not quite. VMware's products do support virtualisation inside a vm. You can run Hyper-V, ESXi and XenServer without problems inside a vm on Fusion, Workstation and ESXi. That my not sound very useful but it actually is. You can now give great demos to your customers but you can also use it in your teaching. And yes, obviously you can also mess around if you are a hobbyist :)

    I was able to testdrive the Hyper-V role in Windows 8 this way (used VMware Fusion 5 for this) as well as XenServer 6.2 and ESXi 5.0. However, you need to enable the support for it in Fusion. Luckily there are several articles on the internet on how to do that exactly.
     
  25. MagicBoy macrumors 68040

    MagicBoy

    Joined:
    May 28, 2006
    Location:
    Manchester, UK
    #25
    Cheers dyn, good to know that.

    Another correction of my own - the VT requirement was removed from XP mode with Windows 7 SP1. I wouldn't fancy the performance though!
     

Share This Page