It looks like you're using Virtualbox, so the following plugin may help 
solve your problem. It allows you to specify a new disk size when you run 
"vagrant up".

   https://github.com/sprotheroe/vagrant-disksize

As a general statement, the provider may have facilities to change the size 
of the disk when it creates it the VM, but the instructions you add to your 
Vagrantfile will be specific to the provider. Aside from that plugin, I 
don't see that the vbox provider has such a facility, but - as an example - 
the libvirt provider has a parameter "machine_virtual_size".

=====

If you want to resize the disk later, after the VM has been created with 
Vagrant, you would need to use whatever facilities, if any, are provided by 
the target environment for enlarging virtual disks. In most cases, this 
increases the size of the virtual disk without modifying the filesystem to 
_use_ the extra space. The steps you followed appear to be a standard way 
(from the command line) to modify the virtual size of a VMDK; this 
operation is common enough that the GUI for the virtual environment usually 
has a resize operation somewhere. For Virtualbox, it's 
under File->VirtualMediaManager. Select the disk, select properties and 
move the slider to the new size - but it only works for VDI not VMDK, and 
only while the VM is halted.

I said "while the VM is halted", but the usual way to handle this for VMs 
is to boot the VM from a virtual ISO image containing a live or rescue 
image. The VM isn't halted, but the root disk of the vagrant-created 
machine is not in use and can be manipulated by the tools.

=====

After the disk is resized, either at creation or afterwards, the partition 
and filesystem have to be extended to use the additional space. Windows 
NTFS can be extended live with DISKPART. Linux systems generally use a tool 
like gparted and it's not advisable to try to apply it to a running 
system's root disk. Gparted can extend or shrink partitions and, for file 
systems it knows about, move the contents of the partition to their new 
size and location. But you can also change the partitions with a tool like 
fdisk.

But extending a partition is not the same operation as extending a file 
system to make use of the new space. For ext234 partitions, there is a 
command resizefs and for xfs file systems there is a command xfs_growfs 
that can perform this third step.

=====

Resources:
 - using Gparted 
- https://gparted.org/display-doc.php%3Fname%3Dmoving-space-between-partitions
 - more Gparted 
- 
https://www.howtogeek.com/124622/how-to-enlarge-a-virtual-machines-disk-in-virtualbox-or-vmware/
 - a box with LVM offers other solutions 
- 
https://unix.stackexchange.com/questions/176687/set-storage-size-on-creation-of-vm-virtualbox

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/7e63a617-1d7c-490a-9490-3638600b9801%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to