# Setting RAM and the CPU cores with Vagrant

In 
RAM
Published 2022-12-03

This tutorial explains to you how to setup the RAM and the CPU cores in Vagrant environment.

In order to create your first virtual machine CentOS 7 based and with a specific RAM & CPU size, first of all you have to create the folder for the project ( ram-cpu directory in my case ) :

As you can see the folder is empty.

Go under the project folder and run the command vagrant init centos/7 :

The command download the Vagrantfile of the project from the Vagrant Cloud. In order to see all the available Vagrant Boxes you can go to the https://app.vagrantup.com/boxes/search.

Now you can edit the Vangrantfile and add the following lines in order to set up the RAM and CPUs:

If you want to be sure that the Vagrant version is 2, you can use:

Vagrant.configure("2") do |vb1|
# ...
end

Run the vagrant up command to start the new Virtual Box machine:

As you can see in the image above, Vagrant download all it needs and create the new Virtual Box machine with the configuration you have set up.

Now you can go to the Virtual Box and see the CPU and RAM: