How do I access the ID of the current virtual machine inside a trigger? The following works, but there must be a better way:
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider "virtualbox" do |vb, override|
# Use VBoxManage to customize the VM. For example to change memory:
vb.customize ["modifyvm", :id, "--memory", "1536"]
override.trigger.after :halt, :append_to_path => ENV["VBOX_INSTALL_PATH"] do
run "VBoxManage storageattach " +
File.read(".vagrant/machines/default/virtualbox/id") +
" --storagectl SATA --port 1 --medium none"
end
end
end
How do I access the ID of the current virtual machine inside a trigger? The following works, but there must be a better way:
Also on SO: http://stackoverflow.com/q/26985575/946850.