Created
July 16, 2014 21:09
-
-
Save dublado/9309673aae5cf0fa5305 to your computer and use it in GitHub Desktop.
Vagrantfile. Set memory and CPU
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To set virtual machine memory size use: | |
config.vm.customize ["modifyvm", :id, "--memory", 2048] | |
To set virtual machine CPU's count use: | |
config.vm.customize ["modifyvm", :id, "--cpus", 2] | |
or to set half of available CPU's count: | |
config.vm.customize ["modifyvm", :id, "--cpus", `awk "/^processor/ {++n} END {print n}" /proc/cpuinfo 2> /dev/null || sh -c 'sysctl hw.logicalcpu 2> /dev/null || echo ": 2"' | awk \'{print \$2}\' `.chomp ] | |
-=-=-= | |
Here is how i had setup my VagrantFile: | |
vb.customize ["modifyvm", :id, "--memory", "8192", "--cpus", "2"] | |
Seems good, but it does not work on 64bits systems. | |
~ sudo cat /proc/cpuinfo | grep 'processor' | |
processor : 0 # CPU1 | |
You need another option to be enabled, called ioapic | |
vb.customize ["modifyvm", :id, "--memory", "8192", "--cpus", "2", "--ioapic", "on"] | |
Now, with this option, start you VM and… | |
~ sudo cat /proc/cpuinfo | grep 'processor' | |
processor : 0 # CPU1 | |
processor : 1 # CPU2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment