Help with Installing Applications on the Guest OS

44 views
Skip to first unread message

VagrantUser1290

unread,
Jun 24, 2015, 9:20:12 AM6/24/15
to vagra...@googlegroups.com
Hi Everyone.
 
I have set up my virtual box to run Windows 2012 and it boots up fine with the Vagrant Up command. I would like to automatically install applications on this virtual machine through provisioning, however I am having a tough time. I want to start with a simple app, like Notepad ++. I have the installer (exe) file on my host machine and I have written a batch file and added the path to the vagrant file to run the batch file upon provisioning. Every time I do this, however, I get an error saying the path cannot be found on the host. I will post my codes below, but does anyone have any recommendations as to how to do this easily? Downloading from the Internet will be tough, too, as there is a tough corporate proxy. Thanks in advance for your help!
 
Codes:
 
In Vagrant File:
 
config.vm.provision :shell, :path => "C:\Vagrant - Copy\install.bat", :privileged => false
 
In Batch File:
 
start C:\Vagrant - Copy\NPP.exe

Chris Baldauf

unread,
Jun 24, 2015, 9:52:01 AM6/24/15
to vagra...@googlegroups.com
Hi,

Normally the path to a shell provisioner is described relative to the Vagrantfile on the host machine, so if you have an install.bat as a sibling of your Vagrantfile, I would expect that to read:

config.vm.provision :shell, path: "install.bat", ...

Would it be possible for you to post the output of running vagrant up or vagrant provision?

Chris

VagrantUser1290

unread,
Jun 24, 2015, 10:04:16 AM6/24/15
to vagra...@googlegroups.com
Oh, ok I am using different drives because of space issues, however I did try to use the same drive on the Guest and the Host and it still didn't cause anything to happen. My vagrant provision file is attached; it runs but doesn't do anything.
provision.txt

Fraser Goffin

unread,
Jun 24, 2015, 5:03:21 PM6/24/15
to vagra...@googlegroups.com
Take a look at Chocolatey. Much easier than writing you own installers and 3000+ packages that you can use off the shelf. When you need more configuration capability, I would recommend Puppet (a fairly simple DSL for automated provisioning that you can bootstrap directly from your Vagrant file (and you can use a Chocolatey provider so you get the best of both). See https://docs.puppetlabs.com/windows/ and https://chocolatey.org

HTH

Fraser.

Alan Frye

unread,
Apr 19, 2016, 12:17:47 PM4/19/16
to Vagrant

Did you this issue resolved? I am having a similar issue wit trying to install a custom software package that I have developed. 

Alvaro Miranda Aguilera

unread,
Apr 19, 2016, 9:30:33 PM4/19/16
to vagra...@googlegroups.com
Hello alan,

If you can explain your goal, and what issue you have we can help.

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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/6b796f4d-4b14-4162-9520-1c42b7492907%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alan Frye

unread,
Apr 20, 2016, 9:37:05 PM4/20/16
to vagra...@googlegroups.com
I am trying to install a piece of software by using the provisioning in vagrant. I have created a batch file that should run the installer. I have used the file mechanism in the provisioning to copy the file inside the vagrant vm

Thanks 

Alan 
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/eW4yjr1TCjQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ewVC6FOD133BrKMzONYzPy-PCXeN33T-TA_Zjsmnu3NRA%40mail.gmail.com.

Alvaro Miranda Aguilera

unread,
Apr 21, 2016, 1:28:17 AM4/21/16
to vagra...@googlegroups.com
Any errors?

If you can share the error you get when running this, and you can share the Vagrantfile and the provision script to have a look will be easier to help.

Thanks
Alvaro.

Alan Frye

unread,
Apr 21, 2016, 9:26:45 AM4/21/16
to vagra...@googlegroups.com
I am not seeing an error the application just does not get installed inside the vm.

I am attaching my batch file and vagrant file



Vagrantfile
install.batch

Alvaro Miranda Aguilera

unread,
Apr 21, 2016, 6:25:19 PM4/21/16
to vagra...@googlegroups.com
hello

Can you share the output of

vagrant provision

please note that installing software in windows using a remote CLI is not easy sometimes.

some application rely on the user session, and someother require non easy tricks like using 

start /minimized cmd.exe <some long command>

So, if you can see the echo of your script after vagrant provision

or you can do some other action, that will confirm that vagrant is uploading the file and running the script

If the installer is the one that is not working then the effort would be there, making the script to work.

thanks!
Alvaro.

Reply all
Reply to author
Forward
0 new messages