From b7494dad393b7fc0c8c4fb25fa24b98b9b401135 Mon Sep 17 00:00:00 2001 From: Joe Ferguson Date: Tue, 28 Feb 2017 13:57:08 -0600 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20Hyper-V=20Provider=20Support?= =?UTF-8?q?=20(#104)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add Support for Hyper-V Blocked by https://github.com/mitchellh/vagrant/issues/7068 * Finalize Powershell build script to support hyper-v --- Vagrantfile | 4 ++++ build_hyperv.ps1 | 13 +++++++++++++ templates/metadata.json | 3 +++ 3 files changed, 20 insertions(+) create mode 100644 build_hyperv.ps1 create mode 100644 templates/metadata.json diff --git a/Vagrantfile b/Vagrantfile index 16675b36..77a903b0 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -19,6 +19,10 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| v.cpus = 2 end + config.vm.provider :hyperv do |vb| + config.vm.box = 'kmm/ubuntu-xenial64' + end + # Configure Port Forwarding config.vm.network 'forwarded_port', guest: 80, host: 8000, auto_correct: true config.vm.network 'forwarded_port', guest: 3306, host: 33060, auto_correct: true diff --git a/build_hyperv.ps1 b/build_hyperv.ps1 new file mode 100644 index 00000000..22757ac0 --- /dev/null +++ b/build_hyperv.ps1 @@ -0,0 +1,13 @@ +$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition + +# install required vagrant plugin to handle reloads during provisioning +vagrant plugin install vagrant-reload + +# start with no machines +vagrant destroy -f +Remove-Item -Path .vagrant -Recurse + +vagrant up --provider hyperv +vagrant halt + +vagrant package --output hyperv.box \ No newline at end of file diff --git a/templates/metadata.json b/templates/metadata.json new file mode 100644 index 00000000..990f3888 --- /dev/null +++ b/templates/metadata.json @@ -0,0 +1,3 @@ +{ + "provider": "hyperv" +} \ No newline at end of file