Vagrant provisioning

37 views
Skip to first unread message

PoodleBytes

unread,
Aug 24, 2017, 8:08:31 AM8/24/17
to Vagrant
Hi all - new to Vagrant and really like the idea but darn what a nightmare w/WinBlows 10.  After several days of Googling I finally got the Vagrantfile (attached) to run through.  MUCH of the problem was with Guest extensions not syncing but got that working (vbguest)

The problem now is everytime I "vagrant up" I get the following error:
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => C:/Users/John/Documents/fullstack/vagrant
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.

and the machine does not start.  Running vagrant provision doesn't help.  I check VlBox log and they're empty(?).

I've tried vagrant destroy the up and runs fine - I then try both vagrant halt / up and vagrant reload right after and still have same provisioning problem (two PCs Win10)

I tried commenting out 'provisioning' parts of Vagrantfile but no help - prob cuz I have no idea what I'm doing!

Off-topic but on one PC when I shell to GIT Bash and type "vagrant xx" it simply returns me to the prompt - as if it sees vagrant (in path) but doesn't run.  Likely nothing to do w/issues because another PC GIT Bash works fine but see same problem.

Thanks in advance!
 - JR -
 
VirtualBox 5.1.26
Vagrant 1.9.8
Windows 10 who knows what iteration....


Vagrantfile

Alvaro Miranda Aguilera

unread,
Aug 24, 2017, 8:53:14 AM8/24/17
to vagra...@googlegroups.com
Hello

The Vagrantfile and the scripts looks pretty good.

can you open Virtualbox, poweroff/poweron the box and see the console for any error?

I am trying to provision your Vagrantfile, just taking long for the box on slow connection where I am now.

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/ba03c717-3979-44a7-85a8-020053a32726%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

John Robitaille

unread,
Aug 24, 2017, 9:09:36 AM8/24/17
to vagra...@googlegroups.com
Hi Alvaro - thanks for your prompt response!  

Very strange - the plot thickens.....

On my Laptop (LT) I did a destroy/up this AM and am currently logged into the VM BUT Oracle doesn't show the VM!!!  I did a halt and re-opened VBox - nothing there!!

My desktop (DT) it does show up and as running after the provisioning error - I guess the script doesn't finish. 

If it's any consolation it is right after the 'share' gets mounted - which has been a BIG issue (guest extensions) since day one.

Virus-free. www.avast.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/4enkJL5Ejhk/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAHqq0ewfuc2KBY-ta6Ui_XsUNgKqq%3DDBSVnML-CWNR8Kfi%2Byrw%40mail.gmail.com.

Alvaro Miranda Aguilera

unread,
Aug 24, 2017, 9:33:11 AM8/24/17
to vagra...@googlegroups.com
Was able to start and reload the vm no issues.

Reading your email, I think you are having a different issue.

If you are on windows, and you open a shell you may have more than one HOME

So lets step back a bit.

say you have a windows laptop, your user is john, by default your home will be:

c:\Users\john

From there, vagrant home will be c:\Users\john\.vagrant.d
Virtualbox home will be c:\Users\john\VirtualBox VMs

now the funny part.

If you are in a domain, and maybe when you login where the domain is there or not, you may end with a different home
if you open cmd.exe vs msys vs cygwin you may end with a different home

That can explain the boxes dissapearing.

check the home in cmd.exe and mssysgit (or cygwin if you use that)

you can set VBOX_USER_HOME to the directory you want to use.

ie VBOX_USER_HOME=c:\Users\john\.VirtualBox

In this directory should be a file called VirtualBox.xml

So if you have multiple of thoses, then you got a HOME folder issue between the environment.

The "fix" or workaround is just set those variables for your shell

export VBOX_USER_HOME=c:\Users\john\.VirtualBox (check proper path name as may be needed /c/Users/.
export VAGRANT_HOME=c:\Users\john\.vagrant.d (check proper path name as may be needed /c/Users/.

Hope this helps.



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



--
Alvaro

Alvaro Miranda Aguilera

unread,
Aug 24, 2017, 9:34:25 AM8/24/17
to vagra...@googlegroups.com
Also

==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`

==> default: flag to force provisioning. Provisioners marked to run always will still run.


That is not an error.


If you get the prompt back the VM is up and running


try to use the ports fwd or vagrant ssh to login to the VM

--
Alvaro

PoodleBytes

unread,
Aug 24, 2017, 11:01:05 AM8/24/17
to Vagrant
Wow Alvaro - your knowledge is #Amazing!!  

I didn't see the environmental variables so went ahead and SET them - thanks.

I destroyed & up'd the VM and it shows in VBox!

When you ran the VM the second time did you also get the 'provisioning' error?  Yes, I've been able to SSH despite this 'error' - is this just telling me there's nothing else in Vagrantfile to process?  

Moving forward do anything to avoid this or just don't worry?

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



--
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 a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/4enkJL5Ejhk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@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.



--
Alvaro




--
Alvaro

Alvaro Miranda Aguilera

unread,
Aug 24, 2017, 4:12:53 PM8/24/17
to vagra...@googlegroups.com
So you need to learn what that means, but happy to explain.

By default, vagrant will run each provisioner only one time, when the guest is created.

So on the second time the message is not an error is telling you "this VM was already provisioned, if you want to provision again, provision manually"

So in term of commands, 2 options.

vagrant reload
vagrant provision

OR

vagrant reload --provision


BUT, lets say you want to run the provisioning script always, well vagrant can do that, just add     , run: "always"

You can read more here:

But!!!!!

not every script should run always, specially if you are installing software or configuring db, if you run the same script twice, bad things can happen or you will get an error and vagrant will fail the provision

If you got questions, please feel free to ask, very welcome!

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/33b51ca3-9fff-42a8-9cb9-96c013cc62c9%40googlegroups.com.

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



--
Alvaro

Reply all
Reply to author
Forward
0 new messages