Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Run this script before running 'vagrant up' to ensure everything is on a tmpfs aka a ramdisk (Linux-only)). #SaveYourSSD
#!/bin/bash
#lrwxrwxrwx 1 jesse jesse 22 Jan 17 13:00 .vagrant.d -> /dev/shm/vm/Vagrant.d/
#lrwxrwxrwx 1 jesse jesse 19 Jan 17 13:00 .vagrant -> /dev/shm/vm/Vagrant
#lrwxrwxrwx 1 jesse jesse 23 Jan 17 13:00 .VirtualBox -> /dev/shm/vm/VirtualBox/
[ -e /dev/shm/vm/Vagrant ] || mkdir -p /dev/shm/vm/Vagrant
[ -e /dev/shm/vm/Vagrant.d ] || mkdir -p /dev/shm/vm/Vagrant.d
[ -e /dev/shm/vm/VirtualBox ] || mkdir -p /dev/shm/vm/VirtualBox
[ -L ~/.vagrant.d ] || rm -rf ~/.vagrant.d; ln -s /dev/shm/vm/Vagrant.d ~/.vagrant.d
[ -L ~/.vagrant ] || rm -rf ~/.vagrant; ln -s /dev/shm/vm/Vagrant ~/.vagrant
[ -L ~/.VirtualBox ] || rm -rf ~/.VirtualBox; ln -s /dev/shm/vm/VirtualBox ~/.VirtualBox
@boldandbusted

This comment has been minimized.

Copy link
Owner Author

boldandbusted commented Mar 10, 2018

WARNING: This script will DELETE whatever you had in .VirtualBox, .vagrant and .vagrant.d!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.