Lost connection between Vagrant and the VirtualBox VM

497 views
Skip to first unread message

b.ha...@bbk.ac.uk

unread,
Mar 19, 2015, 8:28:48 AM3/19/15
to vagra...@googlegroups.com
I lose the connection between Vagrant and the VirtualBox VM if I forget to open Oracle VM VirtualBox Manager before running vagrant resume or up. The contents of the folder at .vagrant\machines\<machine name> are deleted.  I have re-established the connection by recreating the id file using the uuid from the VirtualBox .vbox file and everything seems to be working without the other files that were in this folder i.e. action_provision, action_set_name and synced_folders and index_uuid. 

Can anyone point me to documentation on the function of these files, or advise on the consequences of them no longer being available?

Is there any way of re-creating these files, other than destroying the machine and rebuilding it? 

Can anyone advise me on the source of the reference in the index_uuid file?

If necessary, I believe I can derive the contents of the action_provision, action_set_name and synced_folders from the Vagrantfile and VirtualBox but I can't find the source of the reference in the index_uuid file.  As far as I can see, the only function that uses index_uuid is the global-status command.

I've obviously implemented back-up routines now I've identified the consequences of this issue but I have to do quite a lot of additional configuration once a machine is built and so I'd rather not destroy the current machine to rebuild these files if they're just inventory. I haven't been able to track down any documentation on these files.

FYI I am running Vagrant version 1.6.3 Universal (32 and 64-bit) for Windows on Windows 7 professional with VirtualBox 4.3.12 for Windows hosts (x86/amd64).  My Vagrantfile is configured for 3 machines using the  PloneDev.Vagrant provisioner that creates a guest running Ubuntu (Trusty) 14.04.

Any advice or references to appropriate documentation would be appreciated.

Barbara Harris

Alvaro Miranda Aguilera

unread,
Mar 19, 2015, 6:14:47 PM3/19/15
to vagra...@googlegroups.com
hello,

long story short.

Check your home folder and where the virtualbox machines are being created.

I have seen this kind of issues when over the gui you have HOME
folder, and by command line you have a different one

Alvaro.
> --
> 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.
Message has been deleted

b.ha...@bbk.ac.uk

unread,
Mar 20, 2015, 8:51:10 AM3/20/15
to vagra...@googlegroups.com
Thanks Alvaro,

Before I created any VMs I set the Default Machine Folder to:  C:\VirtualBoxVMs\, via the Oracle VM VirtualBox Manager GUI (using  File/Preferences). This is the same in both the GUI and via the command line interface e.g., from showvminfo:

Config file:     C:\VirtualBoxVMs\
plonedevvagrant-master_prospectus_1423837872845_89017\plonedevvagrant-master_prospectus_1423837872845_89017.vbox.  

I have used the UUID in this file to recreate the Vagrant id file (at C:\plonedev.vagrant-master\.vagrant\machines\prospectus\virtualbox\id) and successfully reconnect to the machine.

Do you think my changing the location of the VirtualBox home folder is causing the problem that destroys the content at C:\plonedev.vagrant-master\.vagrant\etc. ?

Do you know from where the value in the Vagrant file: C:\plonedev.vagrant-master\.vagrant\machines\prospectus\virtualbox\ index_uuid is derive?

I think index_uuid contains Vagrant, rather than VirtualBox,  information. I'm trying to find out what it is, how it is used and (depending upon its significance) if I can restore or re-create it, without re-building the machine from scratch.  
Barbara Harris

Alvaro Miranda Aguilera

unread,
Mar 20, 2015, 5:49:03 PM3/20/15
to vagra...@googlegroups.com
Hello,

there is no problem moving the default path of the virtualbox machines

This issue happen when you are on the same location? I mean, when you
are at home/vpn/office ? or happen when you move change locations?

I ask because the windows HOME folder may change depending on domain,
vpn, location, etc.. (some admin are very creative people)

so, the process goes like this.

your HOME is usually c:\users\alvaro

inside this home Virtualbox create 2 folder, one for virtualbox
configuration, and other for virtualbox VM

vagrant in the home, create a folder too .vagrant.d

so, if your HOME folder change, the whole thing gets unconsistent


Say you use C:\VirtualBoxVMs\ for virtualbox
and C:\Hashicorp\Vagrant_home for vagrant

you should be able to do this

cd c:\project\folder

set VBOX_USER_HOME="C:\VirtualBoxVMs"
"C:\program files\oracle\virtualbox\VBoxManage.exe" setproperty
machinefolder C:\VirtualBoxVMs

set VAGRANT_HOME="C:\Hashicorp\Vagrant_home"

and test

in that way you will be forcing the virtualbox configuration folder,
virtualbox machine folder, vagrant home folder

so will be always the same

Alvaro



On Sat, Mar 21, 2015 at 1:43 AM, Barbara Harris <b.ha...@bbk.ac.uk> wrote:
> Thanks Alvaro,
>
> Before I created any VMs I set the Default Machine Folder to: C:\VirtualBoxVMs\, via the Oracle VM VirtualBox Manager GUI (using File/Preferences). This is the same in both the GUI and via the command line interface e.g., from showvminfo:
>
> Config file: C:\VirtualBoxVMs\plonedevvagrant-master_prospectus_1423837872845_89017\plonedevvagrant-master_prospectus_1423837872845_89017.vbox.
>
> I have used the UUID in this file to recreate the Vagrant id file (at C:\plonedev.vagrant-master\.vagrant\machines\prospectus\virtualbox\id) and successfully reconnect to the machine.
>
> Do you think my changing the location of the VirtualBox home folder is causing the problem that destroys the content at C:\plonedev.vagrant-master\.vagrant\etc. ?
>
> Do you know from where the value in the Vagrant file: C:\plonedev.vagrant-master\.vagrant\machines\prospectus\virtualbox\ index_uuid is derive?
>
> I think index_uuid contains Vagrant, rather than VirtualBox, information. I'm trying to find out what it is, how it is used and (depending upon its significance) if I can restore or re-create it, without re-building the machine from scratch.
>
> Regards,
> Barbara Harris
> ITS Web Team
> Birkbeck, University of London
> Tel: 020 7380 3186
> Email: b.ha...@bbk.ac.uk
> 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/-Ky73Bev2W0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

Barbara Harris

unread,
Mar 24, 2015, 10:17:02 AM3/24/15
to vagra...@googlegroups.com
Hello Alvaro

I only ever work on these systems from the one location i.e. my workstation in my office but, thanks to the insight your information has provided, I now see that my configuration is, quite literally, 'all over the place'. In short, I have a roaming 'network' profile, to which I have no admin access and a local profile with admin rights. I had to use my local admin rights to installed VirtualBox and Vagrant on my C drive but then installed my vagrant projects (with the plonedev.vagrant provisioner) using my (default working) network profile. There are different .vagrant.d and .VirtualBox configuration folders in both my local and network user folders.

Having set the machinefolder and located the correct VAGRANT_HOME, I then tried running vagrant up with VBOX_USER_HOME and VAGRANT_HOME variables set: first as my network user and then still logged in as my network user but with local user admin privileges in the cmd window. In each case, if the Oracle VM VirtualBox Manager GUI was not open, the existing VM was ignored (not found) and a new one was built.

I now believe this is a permissions /environment problem I created by installing the software with a more privileged user that that with which I created and VMs. As long as the Oracle VM VirtualBox Manager GUI is open, the correct privileges / environment variables are in play but I haven't yet been able to reproduce this environment correctly in the cmd window.

When I have more time - and now (thanks to your help) I know where to look - I'll rebuild the development environment in a more coherent fashion but, for the moment, as long as I keep backups of the machine ids and associated files, I can keep on working with what I've got.

Thank you for your help.

Barbara Harris
>> name> recreating

Alvaro Miranda Aguilera

unread,
Mar 24, 2015, 4:36:18 PM3/24/15
to vagra...@googlegroups.com
Hello Barbara.

Just one last piece of information.

Windows does have a command called runas, that allow you run a program
as other user.

So, if you have the right to use that local user account, then what
you can do is create a shortcut for cmd or bash with run as.

Example, if from my windows user in the domain I run this:

C:\Windows\system32>runas /user:alvarom "cmd"
Enter the password for alvarom:
Attempting to start cmd as user "ALVAROMW7LT\alvarom" ...

I get a new window open as my local account.

Hope this helps somehow..

Alvaro.

Barbara Harris

unread,
Mar 25, 2015, 6:56:41 AM3/25/15
to vagra...@googlegroups.com
Thanks Alvaro.
Reply all
Reply to author
Forward
0 new messages