Vagrant, how to specify the disk size?

geckos picture geckos · Apr 13, 2018 · Viewed 35k times · Source

I want to make sure that my development environment has enough free space to install tools and other stuff. I can't find any configuration option about telling to Vagrant the minimum disk size that I want. Is this possible or I need to create my own box?

Answer

Laurence Chen picture Laurence Chen · Jun 27, 2018

I have used the vagrant plugin vagrant-disksize to resize the disk.

It worked. It can also help to specify the initial disk size.

Run the following at the command line:

vagrant plugin install vagrant-disksize

and use the following in your Vagrantfile:

vagrant.configure('2') do |config|
    config.vm.box = 'ubuntu/xenial64'
    config.disksize.size = '50GB'
end