Vagrant.configure("2") do |config| config.vm.box = "centos/7" (1..5).each do |hd| config.vm.provider :virtualbox do |v| puts "harddrive #{hd}" v.customize ['createmedium', '--filename', "./disk#{hd}.vdi",'--variant', 'Fixed', '--size', 20 * 1024]
v.customize ['storageattach', :id, '--storagectl', 'IDE', '--device', hd, '--type', 'hdd', '--medium', "./disk#{hd}.vdi"] end endend
$vagrant up
harddrive 1harddrive 2harddrive 3harddrive 4harddrive 5harddrive 1harddrive 2harddrive 3harddrive 4harddrive 5harddrive 1harddrive 2harddrive 3harddrive 4harddrive 5Bringing machine 'default' up with 'virtualbox' provider...==> default: Checking if box 'centos/7' version '1905.1' is up to date...==> default: Clearing any previously set forwarded ports...==> default: Clearing any previously set network interfaces...==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat==> default: Forwarding ports... default: 22 (guest) => 2222 (host) (adapter 1)==> default: Running 'pre-boot' VM customizations...A customization command failed:
["createmedium", "--filename", "./disk1.vdi", "--variant", "Fixed", "--size", 20480]
The following error was experienced:
#<Vagrant::Errors::VBoxManageError: There was an error while executing `VBoxManage`, a CLI used by Vagrantfor controlling VirtualBox. The command and stderr is shown below.
Command: ["createmedium", "--filename", "./disk1.vdi", "--variant", "Fixed", "--size", "20480"]
Stderr: 0%...Progress state: VBOX_E_FILE_ERRORVBoxManage: error: Failed to create mediumVBoxManage: error: Could not create the medium storage unit '/home/brian/projects/centos/disk1.vdi'.VBoxManage: error: VDI: cannot create image '/home/brian/projects/centos/disk1.vdi' (VERR_ALREADY_EXISTS)VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMediumVBoxManage: error: Context: "RTEXITCODE handleCreateMedium(HandlerArg*)" at line 462 of file VBoxManageDisk.cpp>
Please fix this customization and try again.
My guess would be that the default/system drive is created as disk1.vdi. Try starting at disk2.
--
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 vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/126acb4c-ad09-40bf-bc11-8e15c84a091a%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/yoheUgqb5TE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/5DC3E3F9-3A6B-4EBB-884A-98A2FBB4683A%40gmail.com.
Brian Carpenter
Information Systems Specialist
Western Oklahoma State College
2801 N. Main St. | Altus, OK 73521
(580) 477-7919 | Office: HLC 126
![]()
The mission of Western Oklahoma State College is to provide high quality education, support student success, and empower individuals to become productive members of local, regional, and global communities.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CADwO3JMcN4StbG1TL9M_z6n3U%3DXYQ4eaCHBMbyhEDVecVxBNzg%40mail.gmail.com.
I had to resort to a Google search. Look at https://coderwall.com/p/8m--dq/purge-deleted-hard-disks-from-virtual-box This shows how to purge deleted disks. vagrant destroy does not purge custom disks and simply deleting the vdi does not correctly manage virtual box metadata.
You still have an issue with storageattach; you need to specify device and port. I don’t have time to research this at the moment but I’m sure Google will provide.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CADwO3JMcN4StbG1TL9M_z6n3U%3DXYQ4eaCHBMbyhEDVecVxBNzg%40mail.gmail.com.
cat Vagrantfile && vagrant destroy -f &&echo "files before up"&& ls -a1 &&vagrant up; echo "files after up"; ls -a1# -*- mode: ruby -*-# vi: set ft=ruby :
Vagrant.configure("2") do |config| config.vm.box = "centos/7" config.vm.provider "virtualbox" do |vb| vb.customize ['storagectl', :id, '--name', 'SATA Controller', '--add', 'sata', '--controller', 'IntelAhci', '--portcount', 8]
(1..5).each do |hd| unless File.exist?("./disk#{hd}.vdi") vb.customize ['createhd', '--filename', "./disk#{hd}.vdi", '--size', 1024] end vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', "#{hd}" ,'--device', 0, '--type', 'hdd', '--medium', "./disk#{hd}.vdi"] end endend==> default: Forcing shutdown of VM...==> default: Destroying VM and associated drives...files before up....vagrantVagrantfileBringing machine 'default' up with 'virtualbox' provider...==> default: Importing base box 'centos/7'...==> default: Matching MAC address for NAT networking...==> default: Checking if box 'centos/7' version '1905.1' is up to date...==> default: Setting the name of the VM: centos_default_1571172546672_17886==> default: Fixed port collision for 22 => 2222. Now on port 2200.==> default: Clearing any previously set network interfaces...==> default: Preparing network interfaces based on configuration... default: Adapter 1: nat==> default: Forwarding ports... default: 22 (guest) => 2200 (host) (adapter 1)==> default: Running 'pre-boot' VM customizations...==> default: Booting VM...==> default: Waiting for machine to boot. This may take a few minutes... default: SSH address: 127.0.0.1:2200 default: SSH username: vagrant default: SSH auth method: private key default: default: Vagrant insecure key detected. Vagrant will automatically replace default: this with a newly generated keypair for better security. default: default: Inserting generated public key within guest... default: Removing insecure key from the guest if it's present... default: Key inserted! Disconnecting and reconnecting using new SSH key...==> default: Machine booted and ready!==> default: Checking for guest additions in VM... default: No guest additions were detected on the base box for this VM! Guest default: additions are required for forwarded ports, shared folders, host only default: networking, and more. If SSH fails on this machine, please install default: the guest additions and repackage the box to continue. default: default: This is not an error message; everything may continue to work properly, default: in which case you may ignore this message.==> default: Rsyncing folder: /home/brian/projects/centos/ => /vagrantfiles after up...disk1.vdidisk2.vdidisk3.vdidisk4.vdidisk5.vdi.vagrantVagrantfile
To unsubscribe from this group and stop receiving emails from it, send an email to vagra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/126acb4c-ad09-40bf-bc11-8e15c84a091a%40googlegroups.com.
--
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 a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/yoheUgqb5TE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/5DC3E3F9-3A6B-4EBB-884A-98A2FBB4683A%40gmail.com.
----
Brian Carpenter
Information Systems Specialist
Western Oklahoma State College
2801 N. Main St. | Altus, OK 73521
(580) 477-7919 | Office: HLC 126![]()
![]()
![]()
The mission of Western Oklahoma State College is to provide high quality education, support student success, and empower individuals to become productive members of local, regional, and global communities.
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 vagra...@googlegroups.com.
--
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 vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/794e8dde-f244-4676-8aa6-412974405967%40googlegroups.com.