I'm new to vagrant and have no experience with linux. Installed vagrant on windows 10 and successfully got a virtual windows 2012 server up and running on virtualbox. My vagrantfile looks like this:
#Vagrant 1.6+ natively supports Windows guests over WinRM.
Vagrant.require_version ">= 1.6"
Vagrant.configure("2") do |config|
config.vm.box = "testbox"
config.vm.communicator = "winrm"
config.vm.provider :virtualbox do |v|
v.cpus = 2
v.memory = 2048
end
$install = <<SCRIPT
choco install chocolatey -y -f
choco install powershell -y -f
choco install tomcat -y -f
SCRIPT
config.vm.provision "shell", inline: $install
config.vm.provision "file", source: "template.war", destination: "C:\Program Files\Apache Software Foundation\tomcat\apache-tomcat-8.5.12\webapps\tmt.war"
end
The file is in my vagrant root folder. The script finishes after a while but no VM created. When I remove the last line the VM is created succesfully again.
The outcome of this project must be a VM with powershell 5 and apache tomcat installed. Then I need to copy several files, including a powershell script that needs to run on the vm.
Any help would be appreciated.