VBox & hard disks folder target

172 views
Skip to first unread message

Nic'

unread,
Mar 16, 2014, 9:39:11 PM3/16/14
to vagra...@googlegroups.com
Hi , 

after few deployments with Vagrant either with a base box or with a new packaged one , I face to a problem with the hard disk location within VBox.
Actually , each time I Vagrant up a new machine ,  even if i renamed it , the new hard disk (vmdk) wil take place in the same original folder define in the base box.
e.g.  ~\myvms\basebox\xxxx.vmdk 
and all my next VMs based on a specific basebox will put the .vmdk in the above folder .

Wich is logical because it's defined in the .OVF file but it's not really handy and I don't really like to mix all hard drive together.

Work around :  I manage the hard disk afterward with VBoxmanage and move it in a specific VM folder

But where is the automate way to do that ?

If anyone has an idea ?

thank you.
Nic"

Alvaro Miranda Aguilera

unread,
Mar 16, 2014, 9:53:57 PM3/16/14
to vagra...@googlegroups.com
uhmmmm,

from where are you getting those boxes or how are you creating them?

I don't face that problem.

I have seen that when you create a new disk as part of the vagrant file

for that situation (create a new disk)

What you may want to do, is set a specific name to the vm, so the path to the folder in the virtualbox default path will be known, then you can create the file in that known path

config.vm.hostname  is the hostname inside the vm
config.vm.name is the name of the vm in the VirtualBox space


can you share a Vagrantfile and one of those base box ???



--
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.
For more options, visit https://groups.google.com/d/optout.

Nic'

unread,
Mar 16, 2014, 10:26:18 PM3/16/14
to vagra...@googlegroups.com
yes , it happens with both vm downloaded from vagrantbox.es or build by myself.
I rename the VM in the vagrantfile with the config.vm.name command.
so it create a folder named as wished but the vmdk doesnt follow and stay in the original folder used by the basebox.

I join a vbox file and a vagrant file , in the .VBOX file line 12 is the location(../Template_test/*.vmdk) of  the harddisk even if i have rename my VM in the VagranFile (vb.name=002)

thank you .
002.vbox
Vagrantfile.txt

Alvaro Miranda Aguilera

unread,
Mar 16, 2014, 10:56:48 PM3/16/14
to vagra...@googlegroups.com
perhaps one of the variables is causing issues.

can you paste the output of:

env | egrep -i 'v*box|vagrant'   



if you have some time, can you try with this vm:

https://vagrantcloud.com/kikitux/oracle65-2disk


Nicolas Houillon

unread,
Mar 16, 2014, 11:12:05 PM3/16/14
to vagra...@googlegroups.com
humm looks we dont have these env variables on Windows OS , sorry 
what the result of this ENV grep would you expect ? , i could try to search it on windows .

I will try the machine asap too .


--
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/kaJ47GMayao/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

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



--


Nicolas Houillon - houil...@gmail.com
022 392 8131

Nic'

unread,
Mar 17, 2014, 6:34:11 PM3/17/14
to vagra...@googlegroups.com
HI ,

so do you think Alvaro, harddisks should automatically stored within an independent VM folder and in a normal way , shouldnt share the same harddisk folder across all VMs ?
Even in the case we deploy several VM from one same  basebox.

cheers,


Le lundi 17 mars 2014 16:12:05 UTC+13, Nic' a écrit :
humm looks we dont have these env variables on Windows OS , sorry 
what the result of this ENV grep would you expect ? , i could try to search it on windows .

I will try the machine asap too .
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.

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

--
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/kaJ47GMayao/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+unsubscribe@googlegroups.com.

Alvaro Miranda Aguilera

unread,
Mar 17, 2014, 8:24:52 PM3/17/14
to vagra...@googlegroups.com
by default, you should end with something like this.

in windows 7 and 8

c:\Users\<username>\VirtualBox Vm's\

c:\Users\<username>\.vagrant.d\boxes\

perhaps you are doing something manually?

let's start from scratch, no assumptions.

vagrant box list

should list the machines you have imported

go to any directory, and create a vagrant file

cd
mkdir test1
cd test1
vagrant init <any_box_name>
vagrant up

that, should create a vm inside the default path, with disks and everything.

how went your test with my boxes? oracle65-2disk ?

Nic'

unread,
Mar 18, 2014, 5:32:55 PM3/18/14
to vagra...@googlegroups.com
Alvaro, 
here is the result with oracle65-2disks box

Dir  c:/VirtualMachines/

# oracle65-2_default_1395176227474_1539

Logs
oracle65-2_default_1395176227474_1539.vbox
oracle65-2_default_1395176227474_1539.vbox-prev

--------------------------------------------
#oracle65_default_1395141543827_50889

Logs
oracle65_default_1395141543827_50889.vbox
oracle65_default_1395141543827_50889.vbox-prev

---------------------------------------------
#packer-vagrant-oracle65

packer-vagrant-oracle65-disk1.vmdk
packer-vagrant-oracle65-disk1_1.vmdk
packer-vagrant-oracle65-disk4.vmdk
packer-vagrant-oracle65-disk4_1.vmdk


So yes we get an new folder for any new machines (oracle65-2_default_1395176227474_1539 and oracle65_default_1395141543827_50889 ) but all Disks are mixed up in one same folder packer-vagrant-oracle65 .

Because it's tied to the template, I assume it's same for you as well. Just looking for best practices...is it better to let it in the same folder or manage manually afterward.?
cheers,

--
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/kaJ47GMayao/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

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

Alvaro Miranda Aguilera

unread,
Mar 18, 2014, 6:33:33 PM3/18/14
to vagra...@googlegroups.com
Hello,

I can't comment on best practices, since that can start a flamewar and feelings get hurts easily on what work good for one, or what works best/better/awesome

From my point of view, the life cycle of the machines is short, and you are at 1 Vagrant destroy, vagrant up away of getting something again

so, if I had to say what are the best practices, i will say:

- be clean and tidy on the base boxes, if you get a new base box, be sure you are always using the last one
- try to automate any change you require and make the scripts idempotent, that is, if they run twice do no harm.

here, I have i been doing my scripts to check first and do after the check, and so far, pretty cool, i can do  vagrant provision andi am 100% sure my hard disks won't be overwritten, my apps installation first check if the component is installed, it it's alreadym skip, if not install.

so far I can instal an Oracle Rac with Virtualbox, totally hands free, and it's awesome for my job

:)


For developers, i think the best practice is setup a git for Vagrantfiles, and keep everything always clean.. not a developer, so I can't comment much here

hope this helps!

Alvaro.

Reply all
Reply to author
Forward
0 new messages