Commit c47a99b6 authored by Patrick Lang's avatar Patrick Lang

Starting Gen2 example for Windows Server Insider

parent 9ffb77b1
......@@ -122,7 +122,7 @@ These boxes use WinRM. There is no OpenSSH installed.
### Hyper-V Support
If you are running Windows 10, then you can also use these packerfiles to build
If you are running Windows 10, Windows Server 2016 or later, then you can also use these packerfiles to build
a Hyper-V virtual machine. I have the ISO already downloaded to save time, and
only have Hyper-V installed on my laptop, so I run:
......@@ -130,23 +130,27 @@ only have Hyper-V installed on my laptop, so I run:
packer build --only hyperv-iso -var 'hyperv_switchname=Ethernet' -var 'iso_url=./server2016.iso' .\windows_2016_docker.json
```
You then can use this box with Vagrant to spin up a Hyper-V VM. Vagrant
currently needs some patches as well, see the script
[install-vagrant.ps1](hyperv/scripts/install-vagrant.ps1) how to patch Vagrant
1.8.4 to fix these issues.
You then can use this box with Vagrant to spin up a Hyper-V VM.
#### Generation 2 VMs
Some of these images use Hyper-V "Generation 2" VMs to enable the latest features and faster booting. However, an extra manual step is needed to put the needed files into ISOs because Gen2 VMs don't support virtual floppy disks.
- `windows_server_insider.json`
Before running `packer build`, be sure to run `./make_unattend_iso.ps1` first. Otherwise the build will fail on a missing ISO file
```none
TODO: error example here
```
### Using .box Files With Vagrant
The generated box files include a Vagrantfile template that is suitable for use
with Vagrant 1.7.4+, which includes native support for Windows and uses WinRM to
communicate with the box.
Vagrant 1.8.4 does need some workarounds though:
with Vagrant 1.7.4+, but the latest ersion is always recommended.
* There is a bug in get_vm_status.ps1
* winrm-fs needs an update as well See:
https://github.com/PatrickLang/packer-windows/issues/1#issuecomment-230151622
These are fixed in 1.8.5, so upgrading is easiest.
Example Steps for Hyper-V:
......
This diff is collapsed.
# This builds the unattend ISOs needed for Generation 2 VMs with Hyper-V
$isoList = {
@{
FileName="windows_server_insider.iso";
Files={
"./answer_files/server_insider_uefi/autounattend.xml",
"./scripts/disable-screensaver.ps1",
"./scripts/disable-winrm.ps1",
"./scripts/enable-winrm.ps1"
}
}
}
#"{{user `autounattend`}}",
"./scripts/disable-screensaver.ps1",
"./scripts/disable-winrm.ps1",
"./scripts/enable-winrm.ps1"
\ No newline at end of file
......@@ -7,11 +7,9 @@
"disk_size": "{{user `disk_size`}}",
"enable_secure_boot": true,
"enable_virtualization_extensions": true,
"floppy_files": [
"{{user `autounattend`}}",
"./scripts/disable-screensaver.ps1",
"./scripts/disable-winrm.ps1",
"./scripts/enable-winrm.ps1"
"generation": 2,
"secondary_iso_images": [
"./iso/windows_server_insider.iso"
],
"guest_additions_mode": "disable",
"iso_checksum": "{{user `iso_checksum`}}",
......@@ -143,5 +141,4 @@
"vhv_enable": "false",
"winrm_timeout": "2h"
}
}
}
\ No newline at end of file
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