diff --git a/Vagrantfile b/Vagrantfile index 71a71c1910b9..620dc186d674 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -41,7 +41,7 @@ Vagrant.configure("2") do |config| # Display the VirtualBox GUI when booting the machine vb.gui = false # Customize the amount of memory on the VM: - vb.memory = "768" + vb.memory = "1024" end # Provision @@ -181,5 +181,21 @@ Vagrant.configure("2") do |config| echo "================================================================================" service --status-all + # Creates a swap file if necessary + RAM=`awk '/MemTotal/ {print $2}' /proc/meminfo` + if [ $RAM -lt 1000000 ] && [ ! -f /swap/swapfile ]; then + echo "================================================================================" + echo "Adding swap" + echo "================================================================================" + echo "This process may take a few minutes. Please wait..." + mkdir /swap + dd if=/dev/zero of=/swap/swapfile bs=1024 count=1000000 + mkswap /swap/swapfile + chmod 600 /swap/swapfile + swapon /swap/swapfile + echo "/swap/swapfile swap swap defaults 0 0" >> /etc/fstab + echo "Done." + fi + SHELL end