Commit 40ad7d8d authored by Stefan Scherer's avatar Stefan Scherer

Add hyperv build environment when working on OSX

parent 149e036d
# hyperv
This Vagrant environment can be used to spin up a Windows 10 VM to create the 2016 Hyper-V Vagrant boxes.
The VM needs about 6GByte RAM and 100 GByte disk.
Tested with VMware Fusion.
## On your OSX host
### Build the Windows 10 VMware base box
Build the Windows 10 base box for VMware Fusion with 100GByte disk size.
cd ..
packer build --only=vmware-iso -var disk_size=102400 windows_10.json
vagrant box add windows_10
### Build the Windows 10 Hyper-V environment
Now build the Vagrant environment with Hyper-V and packer in a Windows 10 VM.
cd hyperv
vagrant up --provider vmware_fusion
## In the Windows 10 VM
### Build the Windows Server 2016 TP5 Hyper-V base box
Now inside the Windows 10 VM run packer with this command
cd C:\vagrant
packer build --only=hyperv-iso -var 'hyperv_switchname=Wifi' windows_2016_docker.iso
### Run the Hyper-V VM in Windows 10
If using Vagrant 1.8.4 make sure you have patched it to make it work with Hyper-V as described in
vagrant box add windows_2016_tp5_docker
cd C:\Users\vagrant
git clone
cd docker-windows-box
vagrant up
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| = "windows_10" :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
config.vm.communicator = "winrm"
config.winrm.username = "vagrant"
config.winrm.password = "vagrant"
config.vm.guest = :windows = 15
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder "..", "/vagrant"
config.vm.provision "shell", path: "scripts/install-chocolatey.ps1", privileged: false
config.vm.provision "shell", path: "scripts/install-hyperv.ps1", privileged: false
config.vm.provision "reload"
config.vm.provision "shell", path: "scripts/install-packer.ps1", privileged: false
config.vm.provision "shell", path: "scripts/install-vagrant.ps1", privileged: false
["vmware_fusion", "vmware_workstation"].each do |provider|
config.vm.provider provider do |v, override|
v.gui = true
config.vm.provider "vmware_fusion" do |v|
v.vmx["gui.fitguestusingnativedisplayresolution"] = "TRUE"
v.vmx["mks.enable3d"] = "TRUE"
v.vmx["mks.forceDiscreteGPU"] = "TRUE"
v.vmx["gui.fullscreenatpoweron"] = "TRUE"
v.vmx["gui.viewmodeatpoweron"] = "fullscreen"
v.vmx["gui.lastPoweredViewMode"] = "fullscreen"
v.vmx["sound.startconnected"] = "TRUE"
v.vmx["sound.present"] = "TRUE"
v.vmx["sound.autodetect"] = "TRUE"
v.enable_vmrun_ip_lookup = false
v.vmx["memsize"] = "6048"
v.vmx["numvcpus"] = "2"
v.vmx["vhv.enable"] = "TRUE"
# install chocolatey
iex (wget '' -UseBasicParsing)
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All -NoRestart
wget -outfile $env:TEMP\ -uri -UseBasicParsing
Expand-Archive $env:TEMP\
choco install -y vagrant
# TODO patch Vagrant 1.8.4 as described in
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment