Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
CH vagrantfile redacted
# -*- mode: ruby -*-
# vi: set ft=ruby :
vm_name = "asdf"
vswitch_name = "xxx"
data_disk_path = ""
new_password = "xxx"
mac_address = ""
cpu_cores = 2
ram_mb = 1536
Vagrant.configure("2") do |config|
config.vm.provision "Copy setup files to guest",
type: "file", source: "../Content", destination: "C:/Users/xxx/Vagrant"
# Standard initialization, nothing to see here. Do not modify this file.
config.vm.provision "Initialize the VM", type: "shell",
inline: "powershell -File C:/Users/xxx/Vagrant/Internal/Initialize-VM.ps1 -vmName \"#{vm_name}\"" = "xxx"
config.vm.box_url = "xxx"
config.vm.guest = :windows
config.vm.provider "hyperv" do |hyperv|
hyperv.vmname = vm_name
hyperv.cpus = cpu_cores
hyperv.memory = ram_mb
if mac_address != ""
hyperv.mac = mac_address
# First boot can take a while, as it does the post-sysprep initialization. Just chill for a bit.
hyperv.ip_address_timeout = 600
config.vm.communicator = "winrm"
# The transport we use provides encryption but not server authentication. No MITM protection, in other words.
config.winrm.transport = :ssl
config.winrm.ssl_peer_verification = false
config.winrm.basic_auth_only = true "public_network", bridge: vswitch_name
# Synced folders are not necessary and in fact, can be quite problematic.
# The images may or may not support them but disable them just to be safe.
config.vm.synced_folder ".", "/vagrant", disabled: true
config.winrm.username = "xxx"
config.winrm.password = "xxx"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment