Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type ENTER to exit Windows 2012R2 #76

Open
darkedges opened this issue Jan 29, 2017 · 7 comments
Open

Type ENTER to exit Windows 2012R2 #76

darkedges opened this issue Jan 29, 2017 · 7 comments

Comments

@darkedges
Copy link

Morning
When I use

packer build -force -only virtualbox-iso .\vbox-2012r2.json

I get the following within the VirtualBox image.

C:\Windows\system32>Call PowerShell -NoProfile -ExecutionPolicy bypass -command
"Import-Module 'C:\Users\vagrant\AppData\Roaming\boxstarter\Boxstarter.Bootstrap
per\boxstarter.bootstrapper.psd1';Invoke-Boxstarter -RebootOk -NoPassword:$True"

Boxstarter Version 2.8.29
(c) 2016 Matt Wrock. http://boxstarter.org

Boxstarter: Disabling Automatic Updates from Windows Update
Attempting to build package from 'temp_BoxstarterPackage.nuspec'.
Successfully created package 'temp_BoxstarterPackage.1.0.0.nupkg'
Boxstarter: Created a temporary package temp_BoxstarterPackage from a:\package.p
s1 in C:\Users\vagrant\AppData\Roaming\boxstarter\BuildPackages
++ Boxstarter starting Calling Chocolatey to install temp_BoxstarterPackage. Thi
s may take several minutes to complete...
Installing the following packages:
temp_BoxstarterPackage
By installing you accept licenses for the packages.

temp_BoxstarterPackage v1.0.0 (forced)
 Boxstarter: Enabling Remote Desktop...
 Boxstarter: Enabling Remote Desktop NLA ...
 Ok.
 Boxstarter: Setting PowerShell execution context to Unrestricted
 Boxstarter: Removing unused features...
 Success Restart Needed Exit Code      Feature Result

 ------- -------------- ---------      --------------

 True    No             NoChangeNeeded {}

 True    No             NoChangeNeeded {}

 + Boxstarter starting Checking for updates...
 Restarting windows update service
 + Boxstarter finished Checking for updates... 00:01:31.6466989
 There is no update applicable to this machine
 Boxstarter: Removing page file
 Boxstarter: Setting up winrm
 Ok.
 Configured LocalAccountTokenFilterPolicy to grant administrative rights remotel
y to local users.
 cfg               : http://schemas.microsoft.com/wbem/wsman/1/config/service/au

                     th
 lang              : en-US
 Basic             : false
 Kerberos          : true
 Negotiate         : true
 Certificate       : false
 CredSSP           : true
 CbtHardeningLevel : Relaxed
 Auth
     Basic = true
     Digest = true
     Kerberos = true
     Negotiate = true
     Certificate = true
     CredSSP = false
 Auth
     Basic = true
     Kerberos = true
     Negotiate = true
     Certificate = false
     CredSSP = true
     CbtHardeningLevel = Relaxed
 Service
     RootSDDL = O:NSG:BAD:P(A;;GA;;;BA)(A;;GR;;;IU)S:P(AU;FA;GA;;;WD)(AU;SA;GXGW
;;;WD)
     MaxConcurrentOperations = 4294967295
     MaxConcurrentOperationsPerUser = 1500
     EnumerationTimeoutms = 240000
     MaxConnections = 300
     MaxPacketRetrievalTimeSeconds = 120
     AllowUnencrypted = true
     Auth
         Basic = true
         Kerberos = true
         Negotiate = true
         Certificate = false
         CredSSP = true
         CbtHardeningLevel = Relaxed
     DefaultPorts
         HTTP = 5985
         HTTPS = 5986
     IPv4Filter = *
     IPv6Filter = *
     EnableCompatibilityHttpListener = false
     EnableCompatibilityHttpsListener = false
     CertificateThumbprint
     AllowRemoteAccess = true
 Boxstarter: winrm setup complete
 The install of temp_boxstarterpackage was successful.

Chocolatey installed 1/1 package(s). 0 package(s) failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
++ Boxstarter finished Calling Chocolatey to install temp_BoxstarterPackage. Thi
s may take several minutes to complete... 00:02:00.2439570
True
Boxstarter: Restore Automatic Updates from Windows Update
Boxstarter: Enabling UAC
Type ENTER to exit:

Not sure what to do next, as pressing ENTER does not do anything other than closing the prompt.

Tried with the WMF5 version and it gets stuck at the same point.

Any ideas?

@darkedges darkedges changed the title Type ENTER to exit Windows 2012R1 Type ENTER to exit Windows 2012R2 Jan 29, 2017
@neilkidd
Copy link

I typed "ENTER" + return and it completed.

@mwrock
Copy link
Owner

mwrock commented Jan 30, 2017

While it does prompt you to press enter, this should not matter because the last thing the boxstarter script does is setup winrm. Normally, that alone should appow packer to connect to the box and sysprep it and complete the process.

Since that is not happening, this usually means something is misconfigured in the packer winrm settings. This has been tricky because depending on which version of packer you are using, different settings will break. The settings currently in this repo were set with v 0.12.1.

So the first thing I'd try is using that version of packer.

@neilkidd
Copy link

neilkidd commented Jan 30, 2017

Hi Matt,
First off - many thanks for your work, and taking the time to reply :)
I'm running 0.12.1:
neil@optimus:~$ packer -v
0.12.1

So I have no idea what the issue is. I'll try again at some point. It completed and I have a patched basebox (with UK settings) which is sufficient for me for another 179 days!

Regards,
Neil

@wilddev65
Copy link

I'm having the same problem but it's happening at the end of the temp_BoxstarterPackage install and I have to hit enter for it to proceed with turning on winrm. At this stage Packer isn't even connected, it's all Boxstarter and Chocolately.

@mwrock
Copy link
Owner

mwrock commented Mar 20, 2017

I may not fully uinderstand your scenario but it is expected for boxstarter to end prompting you to type enter before it closes the console. At the very end of the boxstarter package, it sets up winrm and at that point Packer is supposed to be able to connect and drive the rest of the image build.

Are you prompted after all the updates are installed and the entire package completes? Thats the expectation. If thats the case, it means Packer must not be able to make a winrm connection with the vm.

@wilddev65
Copy link

What I'm currently doing (as you can see in the other bug I opened #233) is running first a package which simply adds the box to the domain, then running an install of MSSQL 2014. It stops at the Enter prompt before the section that starts winrm and also prompts to enter when the winrm section completes. The temp_BoxstarterPackage install finishes successfully (I did several tests to verify it completely finishes) and once it gets handed back to the main script, it stops and requests me to hit enter. It seems to me in the testing I've done that if there is a reboot needed, things finish properly, but as the MSSQL install doesn't require a reboot, it just stops.

@wilddev65
Copy link

As a followup to this, I've discovered that if I have two lines doing 'Install-BoxstarterPackage' I get the Enter prompt, but if I make the script do this only once, it doesn't give me that prompt until after winrm is turned on. I'm going to try merging the two packages together and see if it will work successfully with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants