File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ Vagrant.configure("2") do |config|
4141 # Display the VirtualBox GUI when booting the machine
4242 vb . gui = false
4343 # Customize the amount of memory on the VM:
44- vb . memory = "768 "
44+ vb . memory = "1024 "
4545 end
4646
4747 # Provision
@@ -56,6 +56,22 @@ Vagrant.configure("2") do |config|
5656
5757 grep -q "127.0.0.1 ${VIRTUALHOST}" /etc/hosts || echo "127.0.0.1 ${VIRTUALHOST}" >> /etc/hosts
5858
59+ # Creates a swap file if necessary
60+ RAM=`awk '/MemTotal/ {print $2}' /proc/meminfo`
61+ if [ $RAM -lt 1000000 ] && [ ! -f /swap/swapfile ]; then
62+ echo "================================================================================"
63+ echo "Adding swap"
64+ echo "================================================================================"
65+ echo "This process may take a few minutes. Please wait..."
66+ mkdir /swap
67+ dd if=/dev/zero of=/swap/swapfile bs=1024 count=1000000
68+ chmod 600 /swap/swapfile
69+ mkswap /swap/swapfile
70+ swapon /swap/swapfile
71+ echo "/swap/swapfile swap swap defaults 0 0" >> /etc/fstab
72+ echo "Done."
73+ fi
74+
5975 # Prepare to use APT Proxy
6076 if [ ! -z $APT_PROXY ]; then
6177 if [ ! -f /etc/apt/sources.list-origin ]; then
You can’t perform that action at this time.
0 commit comments