Skip to content

Resizing a VM

Resize vagrant machine

To expand virtual machine's hard drive for testing of larger files. Once the VM has started, you'll need to halt the VM, download and run the script, tell it what size (in MB) and then start the VM. The last step vagrant ssh --command "sudo resize2fs /dev/sda1" is a check. It should return there was nothing to do. If you already provisioned you VM you can skip the 2 steps with provisioning in them.

# Skip this if you VM is already provisioned.
$ vagrant up --no-provision  <-- Exclude if already running and provisioned.

$ vagrant halt

# Download and run. This will default to the correct name (just press enter) then give the size.
# Example: `350000` is equal to 350GB

$ wget
$ chmod +x
$ python
$ vagrant up --no-provision

# This step isn't needed but acts as a check to verify it worked.
$ vagrant ssh --command "sudo resize2fs /dev/sda1"

# Skip this if you VM is already provisioned.
$ vagrant provision           <-- Exclude if already provisioned.


You may need to remove the "resized" version. Assuming your VM location is ~/VirtualBox\ VMs

$ rm -rf ~/VirtualBox\ VMs/Islandora\ CLAW\ Ansible_resized

Last update: June 19, 2024