From 4c0bfb80c1d58fa94bf3cd4adaac2a71bd2ae2e8 Mon Sep 17 00:00:00 2001 From: Andrew Eikum Date: Fri, 2 Nov 2018 12:36:24 -0500 Subject: [PATCH] Vagrantfile: Detect host resources automatically --- Vagrantfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index ce83ce8a..5fbd9df4 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,11 +6,11 @@ Vagrant.configure(2) do |config| config.vm.box = "generic/debian9" - # Uncomment to increase guest resources from the default - #config.vm.provider "virtualbox" do |v| - # v.memory = 2048 - # v.cpus = 4 - #end + config.vm.provider "virtualbox" do |v| + v.cpus = `nproc`.to_i + # meminfo shows KB and we need to convert to MB + v.memory = `grep 'MemTotal' /proc/meminfo | sed -e 's/MemTotal://' -e 's/ kB//'`.to_i / 1024 / 2 + end config.vm.synced_folder ".", "/home/vagrant/proton", type: "rsync", rsync__exclude: [".git/", "/output/"], rsync__args: ["--verbose", "--archive", "-z", "--links", "--update"]