SuperUsers. I want to preserve the life of my laptop's SSD drive. I make heavy use of Vagrant, Chef, and Virtualbox. I'm using Test Kitchen w/ Vagrant to run my infrastructure code tests. I am creating and destroying VMs all day, several times a day, sometimes in parallel. I'd like all of this ephemeral activity to happen on a tmpfs, like /dev/shm/, rather than chewing away at my write-limited SSD. I'm running GNU/Linux. I have 32 GB RAM, so would like to make heavy use of it! :)

There are so many locations where these programs store their files, that I was hoping someone out there has a magic symlink, bind mount, or similar that will just magically make this problem easy to solve. :) Any takers? Thanks in advance.

  • "I want to preserve the life of my laptop's SSD drive." - No need. Really. – Daniel B Jan 20 '17 at 19:28
  • Have you checked the total writes available on your SSD and the number you've used so far? You may be surprised at how much life you've got left even without this. – music2myear Jan 31 '17 at 19:54
  • 3
    Hey, guys. I'm not really interested in being told don't bother. :) I'm looking for help with what I asked about. If I don't want to use a finite resource and use a practically infinite one, I should be able to do so. Ya feel me? – Jesse Adelman Feb 1 '17 at 21:09

OK, so I answered this myself, with help from https://www.virtualbox.org/manual/ch10.html .

$ cd ~/.VirtualBox/
$ mv Machines Machines.OFF
$ ln -s /dev/shm/ Machines

NOTE: If you are using a tool like Test Kitchen, and you find yourself faced with an error while purging a machine, undo this configuration and try again:

$ cd ~/.VirtualBox/
$ mv Machines Machines.LINK
$ mv Machines.OFF Machines

NOTE: Monitor available RAM closely. /dev/shm/ is a tmpfs mount on my system, with a default of half of the available physical RAM allocated. Make sure your virtual machines don't allocate more RAM than necessary. I'v'e got 32 GB real RAM, hence my interest in this. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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