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?
Right-click the virtual machine. Click Edit Settings. Select Virtual Disk. Increase the size of the disk.
The primary commands to get started are vagrant init and vagrant up . Open a command line and change directories to your test project folder. Run vagrant init and a new vagrant file will be created in the current directory called “Vagrantfile” (no extension) which holds a basic starter configuration.
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
Install Vagrant plugin vagrant-disksize
vagrant plugin install vagrant-disksize
If you want to make sure user has the plugin installed, when starting vagrant, you can add this in the beginning of Vagrantfile
# Install vagrant-disksize to allow resizing the vagrant box disk. unless Vagrant.has_plugin?("vagrant-disksize") raise Vagrant::Errors::VagrantError.new, "vagrant-disksize plugin is missing. Please install it using 'vagrant plugin install vagrant-disksize' and rerun 'vagrant up'" end
Set desired disk size in Vagrantfile
vagrant.configure('2') do |config| config.disksize.size = '50GB' end
Updating existing vagrant box
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With