wintriallab/vagrant/FreyjaA/Vagrantfile
2016-11-02 14:00:52 -05:00

57 lines
2.4 KiB
Ruby

# -*- mode: ruby -*-
# vi: set ft=ruby :
require "date"
Vagrant.require_version ">= 1.6.2"
# Resolve paths before passing them to config.vm.provision
# I do this because, when run from my buildlab.ps1 script, I set ENV:VAGRANT_CWD to this directory,
# but pushd away into a working directory on a bigger disk for actually keeping the VM
thisVagrantfileDir = File.dirname(__FILE__)
commonScriptsDir = "#{thisVagrantfileDir}/../../scripts"
Vagrant.configure("2") do |config|
config.vm.define "FreyjaA-2016-11-02"
config.vm.box = "wintriallab-windows_10_x86"
config.vm.communicator = "winrm"
# Admin user name and password
config.winrm.username = "vagrant"
config.winrm.password = "V@grant123"
config.vm.guest = :windows
config.windows.halt_timeout = 15
# One of the VPNs I have to use will only work with a bridged connection
# However, Vagrant apparently doesn't like this, so unless you do :adapter=>1 it will create a second adapter
# More investigation is required... the :adapter=>1 line hasn't been tested yet
# For now: require switching to bridged connection manually after 'vagrant up'
#config.vm.network :public_network
#config.vm.network :public_network, :adapter=>1, type:"dhcp", :bridge=>'Ethernet'
config.vm.provider :virtualbox do |v, override|
#v.gui = true
v.customize ["modifyvm", :id, "--memory", 3072]
v.customize ["modifyvm", :id, "--cpus", 1]
v.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
v.customize ["modifyvm", :id, "--accelerate2dvideo", "on"]
v.customize ["modifyvm", :id, "--vram", 128]
v.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
v.customize ["modifyvm", :id, "--draganddrop", "bidirectional"]
end
begin
Dir.mkdir('./synced')
rescue
puts "./synced is already created I guess idk"
end
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder "./synced", "/vagrant", create: true
config.vm.synced_folder "#{ENV['USERPROFILE']}\\Documents\\VMShare", "/VMShare", create: true
FileUtils.cp "#{commonScriptsDir}/wintriallab-postinstall.psm1", "./synced/wintriallab-postinstall.psm1"
FileUtils.cp "#{commonScriptsDir}/freyja-provisioner.ps1", "./synced/freyja-provisioner.ps1"
config.vm.provision "shell", inline: "C:/vagrant/freyja-provisioner.ps1"
end