Vagrant ignores default machine folder and creates VMs and virtualbox config files elsewhere

581 views
Skip to first unread message

Simon Ward

unread,
Oct 23, 2014, 9:46:51 AM10/23/14
to vagra...@googlegroups.com
Hi all,
The computers on our network each have a user network drive attached to Z, which windows considers to be the home drive.
I am having trouble with vagrant ignoring the VM directory set in virtualbox ("D:\Virtualbox VMs") and creating new VMs in "Z:\Virtualbox VMs" and a new ".VirtualBox" config folder in Z: drive. The original config folder is in "C:\Users\[username]\".
Whenever I start vagrant, it seems to MOSTLY start the one in Z but ocasionally starts the one in D, causing me confusion about which one I'm using. I only noticed because I was sure I had installed a program on a VM, but when I next started it, it didn't exist.

Here’s what I did to investigate:

Uninstalled VB. Deleted conf folders from both Z and user folder
Installed and started VB. Changed VM folder to D. Created test VM. Closed and reopened several times. VB correctly used VM in D and created conf folder only in user folder.
Started vagrant. VB created new conf folder in Z and created VMs in Z.

Uninstalled both VB and Vagrant. Deleted all conf folders for both.
Installed and started VB. Changed VM folder to D. Created test VM. Closed and reopened several times. VB correctly used VM in D and created conf folder only in user folder.
Started vagrant. VB created new conf folder in Z and created VMs in Z.

Vagrant seems to make some kind of assumption no matter what the settings are. I cannot find anything in any vagrant file that tells it to use the Z path. There may be some way to set up but I can’t see it.

Update 1: I deleted my Z drive and restarted everything. It has not created any new VB config folders and it has put the VMs in the correct place on D.

VB behaves differently depending on what started it up. If I start the GUI up myself, it's using the conf from my home folder. If vagrant is already running a vm and I start the GUI, it is using the Z conf folder.

Update 2: I restarted my machine and restored the Z: drive. I started up vagrant and it again created NEW duplicate VMs and conf folder in the Z drive. So I have two workarounds:
Remove the Z drive permanently
Set both conf files to use the Z drive location for VMs and hope it doesn't create further duplicates elsewhere

I have decided to remove the Z drive for now as it's not vital and I can assign it as a folder link rather than a lettered drive anyway.

Is anyone else experiencing this? Any ideas?
Thanks

Simon

PS: Windows 7, Vagrant 1.6.5, Virtualbox 4.3.18 r96516

Torben Knerr

unread,
Oct 23, 2014, 10:49:10 AM10/23/14
to vagra...@googlegroups.com

Hi Simon,

Have you tried setting VBOX_USER_HOME to D:\VirtualBox?

HTH, Torben

--
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.

Umair Chagani

unread,
Oct 23, 2014, 11:04:19 AM10/23/14
to vagra...@googlegroups.com
This isn't a vagrant problem but rather a VirtualBox bug that pops up every now and then.  I had to do a reboot to get everything in a stable state before doing the following:

- Set VBOX_USER_HOME as Torben suggested
- Set the default machine location:  VBoxManage.exe setproperty machinefolder "Z:\Virtualbox VMs"




Tricia Jenkins

unread,
Oct 23, 2014, 11:08:10 AM10/23/14
to vagra...@googlegroups.com
  1. The 'Default Machine Folder' for Virtualbox is 'VirtualBox VMs' in your user directory. Since, at our place of work, our user directory is on a shared drive that is synced on startup/shutdown this is a less than ideal to be storing files associated with our VMs. If you notice disk space warnings or really slow logins this could be the problem. To set the 'Default Machine Folder' open a command line terminal (i.e. go to the Start menu and enter 'cmd'. Cygwin works well for this purpose as well. Use whichever you're using to run vagrant)  At the prompt enter where C:\VMs is wherever you want the VM files to live.
'c:\Program Files\Oracle\VirtualBox\VBoxManage.exe setproperty machinefolder C:\VMs'

Simon Ward

unread,
Oct 23, 2014, 11:35:47 AM10/23/14
to vagra...@googlegroups.com
Thanks. I have done what Umair suggested and added the VBOX_USER_HOME
environment variable and set it to the .VirtualBox folder in my user
profile, then ran the command for VBoxManage.exe. It seems to be
bahving properly. Thanks all of you for the help.
> --
> 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/l9EXrPh9uGA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
Reply all
Reply to author
Forward
0 new messages