Skip to content

Instantly share code, notes, and snippets.

@machixian
Created June 4, 2013 09:52
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save machixian/5704863 to your computer and use it in GitHub Desktop.
Save machixian/5704863 to your computer and use it in GitHub Desktop.
Add additional disk to Vagrant host
Vagrant.configure("2") do |config|
config.vm.box = "base"
# strat with Vagrant configuration v2 need specify VM provider
config.vm.provider :virtualbox do |vb|
file_to_disk = '/tmp/large_disk.vdi'
# disk size 50GB
vb.customize ['createhd', '--filename', file_to_disk, '--size', 50 * 1024]
vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', file_to_disk]
end
end
@smahi
Copy link

smahi commented Feb 21, 2014

Thank you for this useful gist, but i have changed the controller name from 'SATA Controller' to 'SATA' to get it working with my new version of VirtualBox (version 4.3.4).
To check the correct controller name type in the command line :
VBoxManage showvminfo the_vm_name | grep 'Storage Controller Name'

Enjoy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment