Placing extra disk image next to rest of VirtualBox files?

17 views
Skip to first unread message

Thorbjørn Ravn Andersen

unread,
May 23, 2017, 9:45:57 AM5/23/17
to Vagrant
I have a situation where I need a very large root disk on a Ubuntu 14.04 image for some long running integration test scenarios, and we have switched to the official bento/ubuntu-14.04 image as it has a LVM root image which can be expanded.

I add an extra "disk" using

---

config.vm.provider "virtualbox" do |v|
v.memory = 8192
v.cpus = 2 # or more for heavy load
# https://stackoverflow.com/a/27878224/53897
v.customize ["createhd", "--filename", "m4_disk0", "--size", "1048576"] # 1 TB
v.customize ["storageattach", :id, "--storagectl", "SATA Controller", "--port", "1", "--type", "hdd", "--medium", "m4_disk0.vdi"]
end
--

(and do some Linux magic later to expand the root drive)

My problem is that right now the m4_disk0.vdi file is created next to the Vagrantfile and
not along the other files for the virtualbox vm.  This is important as my sources is on a fast but 
small SSD and the virtualbox images have been configured to be on a slower but much larger HDD.

I would like to be able to specify this!

Apparently Vagrant _knows_ where the files are placed as the commands shown with "VAGRANT_LOG=info vagrant up"
show the appropriate absolute paths, but (also apparently) the only parameter made available
to the Vagrantfile programmer is the ":id" identifier which is not much use here.

I have very little experience with Ruby so I might not read the documentation correctly.  Pointers and working snippets would be very helpful.

What is the current "correct approach" to what I want to do?

My host is running UBuntu 17.04 with Vagrant 1.9.1.

Thanks

/Thorbjørn

Alvaro Miranda Aguilera

unread,
May 24, 2017, 6:30:10 AM5/24/17
to vagra...@googlegroups.com
Hello

Way better you create your own box with the size and soft you require.

check packer.io tool create VM, and this repo for example:


Thanks
Alvaro.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a34a3d64-86c2-4651-8d40-4742579aad77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Thorbjørn Ravn Andersen

unread,
May 24, 2017, 9:44:43 AM5/24/17
to Vagrant
Why is this "way better"?

I'd really like to just use the official bento image and as it uses LVM it is very easy to work with.  Only problem is this.

To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

Alvaro Miranda Aguilera

unread,
May 25, 2017, 4:08:02 AM5/25/17
to vagra...@googlegroups.com
Hello

of course this is my personal opinion, but now there is the problem on how to find the directory where the VM is running.

I think the best will be run commands around VBoxManage ie list vms and showvminfo to find out the path of the current vm and disk.

I think is totally doable, but you can just copy the bento template and run packer locally and build on that have the size you need.

you can upload to atlas and have the same experience.


Alvaro

To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/7693bdb0-5134-4b4c-b61a-fce28844b7e6%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages