mwrock / packer-templates

Templates for creating vagrant boxes
Other
535 stars 250 forks source link

Create templates for Win2008 R2 #98

Open fzk-rec opened 6 years ago

fzk-rec commented 6 years ago

Hi @mwrock , I'm struggling to get your process running with an 2008 R2 iso. Boxstarter is always displaying two errors:

  1. error_1

  2. boxstarter_error

After the second error, the shell disappears and nothing else happens. Packer is waiting forever for WinRM to become available but no other scripts get executed, especially not your PACKAGE.ps1

When I try to execute the PACKAGE.ps1 on the machine, I run into errors about "Enable-RemoteDesktop" and "Update-ExecutionPolicy -Policy Unrestricted" . So I thought that might be because the Powershell version of the machine is too old. I tried invoking a ps1 that installs powershell 5 through chocolatey, but that didn't work either.

Now I'm stuck. Can you please help me out by adding working templates and scripts for 2008 R2?

fzk-rec commented 6 years ago

Update: I got the installation to work by invoking the chocolatey installation for powershell5 + rebooting the machine in the boxstarter.ps1: Install-BoxstarterPackage -PackageName a:\install_powershell.ps1 -Credential $cred Install-BoxstarterPackage -PackageName a:\package.ps1 -Credential $cred

The install_powershell.ps1:

# Install latest powershell, so that the package.ps1 can be executed
C:\ProgramData\Chocolatey\choco.exe install powershell -y

However, now the PackerShutdown.bat fails, or rather the sysprep command within it: image

A quick google search concluded that maybe the image has been activated too many times: https://support.microsoft.com/en-us/help/929828/an-error-message-occurs-when-you-run-sysprep-generalize-in-windows-vis

Could this come from my additional reboot?

Help is greatly appreciated! :)

Check out https://github.com/fzk-rec/packer-templates/commit/c166bb62c2825928455c15f486e38ddb0916fe55 for more details