config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Customize the amount of memory on the VM:
vb.memory = 4096
# Customize the amount of CPUs the VM will use:
vb.cpus = 2
vb.customize ["modifyvm", :id, "--vram", "128"]
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
# Customize additional Virtualbox settings
vb.customize ["sharedfolder", "add", :id, "--name", "VM_Share", "--hostpath", "path/to/share/folder/", "--automount"]
#below commented SATA customize will only work when the VM has already been created...on a fresh run this will error since the SATA controller does not exist
#vb.customize ["storagectl", :id, "--name", "SATA", "--remove" ]
vb.customize ["storagectl", :id, "--name", "SATA", "--add", "sata" ]
# Add an ISO file here
vb.customize ["storageattach", :id, "--storagectl", "SATA", "--port", "0", "--device", "0", "--type", "dvddrive", "--medium", "path/to/file.iso"]
# Add another ISO file here
vb.customize ["storageattach", :id, "--storagectl", "SATA", "--port", "1", "--device", "0", "--type", "dvddrive", "--medium", "path/to/file.iso"]
end--
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/890ada33-53a2-4950-bdf9-72c951193c32%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Vagrant.configure(2) do |config|
...
# =================================================================
# PROVISIONING
# Additional provisioners such as Puppet, Chef, Ansible, Salt, and Docker are also available.
# Please see the Vagrant documentation for more information about their specific syntax and use.
# =================================================================
config.vm.provision "file", source: "C:/Hashicorp/Vagrant/provisioners/install-visualstudio.ps1", destination: "C:/tmp/vagrant-shell/install-visualstudio.ps1"
# Provision Visual Studio
config.vm.provision "shell", inline: "C:/tmp/vagrant-shell/install-visualstudio.ps1", run: "always"
...
end$vspath = "C:\Program Files (x86)\Microsoft Visual Studio 12.0"
if (test-path $vspath)
{
Write-Host "Visual Studio is already installed...we can skip this step."
}
else {
Write-Host "Installing Visual Studio 2013 with Update 5..."
Write-Host "This will take a while so maybe grab some coffee or tea?"
Write-Host "Copying ISO file to local file system"
Copy-Item "\\VBOXSVR\ISO_Installers\Microsoft\Visual Studio\2013 with Update 5\en_visual_studio_ultimate_2013_with_update_5_x86_dvd_6815896.iso" -Destination "C:\tmp\"
Write-Host "Mounting the ISO file"
$iso = "C:/tmp/en_visual_studio_ultimate_2013_with_update_5_x86_dvd_6815896.iso"
Mount-DiskImage -verbose -ImagePath $iso -StorageType ISO
# Get the drive letter that the ISO was mounted to so that we can access the installer.
$image = Get-DiskImage -ImagePath $iso | Get-Volume
$drive = "$([string]$image.DriveLetter):"
$p = New-Object System.Diagnostics.Process
$pinfo = New-Object System.Diagnostics.ProcessStartInfo("$drive\vs_ultimate.exe", "/full /quiet /norestart");
$p.StartInfo = $pinfo;
$start = Get-Date -displayhint time
$p.Start();
$p.WaitForExit();
$end = Get-Date -displayhint time
$time = NEW-TIMESPAN -Start $start -End $end
Write-Host "Visual Studio 2013 with Update 5 installed. Time taken (minutes): " $time.TotalMinutes
Write-Host "Dismounting the Visual Studio ISO file..."
Dismount-DiskImage -ImagePath $iso
}
Write-Host "Deleting the Visual Studio 2013 with Update 5 ISO file..."
$file = "C:/tmp/en_visual_studio_ultimate_2013_with_update_5_x86_dvd_6815896.iso"
if (Test-Path $file){
Remove-Item $file
}
Write-Host "install-visualstudio.ps1 complete..."To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/05a6169c-a0ad-422e-bace-c030a1514cf3%40googlegroups.com.