hashicorp / packer

Packer is a tool for creating identical machine images for multiple platforms from a single source configuration.
http://www.packer.io
Other
15.12k stars 3.33k forks source link

windows-restart provisioner does not respect restart_check_command when using SSH communicator #6055

Closed leonyu closed 6 years ago

leonyu commented 6 years ago

windows-restart provisioner does not respect restart_check_command when using SSH communicator.

Instead of trying to execute provided restart_check_command in a loop, it would attempt to execute the default command, and flooded the console with its infinite attempts to execute shutdown.exe .

Sample JSON

{
    "builders": [
        {
            "type": "null",
            "ssh_host": "YOUR_HOST_WITH_SSH",
            "ssh_username": "YOUR_USERNAME",
            "ssh_password": "YOUR_PASSWORD"
        }
    ],
    "provisioners": [
        {
            "type": "windows-restart",
            "restart_command": "echo restart",
            "restart_check_command": "echo check"
        }
    ]
}

Context:

Due to command escape bug in the current Win32-OpenSSH server implementation (https://github.com/PowerShell/Win32-OpenSSH/issues/1082), I have to override the built-in windows-restart commands when using SSH communicator on a guest with Win32-OpenSSH; however, this Packer bug is preventing me from doing so.

SwampDragons commented 6 years ago

I'm not sure if this is a bug or unclear documentation -- If you provide your own restart check command, the provisioner runs both yours and our default one; this is because we've found that if we don't run our default, we run into an issue where windows will restart and start running the next provisioner before powershell modules are fully loaded. Can you please provide your debug logs (set PACKER_LOG=1 in your environment) and show me what you're seeing?

leonyu commented 6 years ago

My JSON is pretty much what I pasted above.

{
  "builders": [
    {
      "type": "virtualbox-ovf",
      "source_path": "output-stage2/output-stage2.ovf",
      "shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c Packer_Provisioning_Shutdown",
      "guest_additions_mode": "disable",
      "output_directory": "output-stage3",
      "vm_name": "output-stage3",
      "ssh_timeout": "10m",
      "ssh_username": "owner",
      "ssh_password": "owner"
    }
  ],
  "provisioners": [
    {
      "type": "windows-restart",
      "restart_command": "echo restart",
      "restart_check_command": "echo check"
    }
  ]
}
Here's the first part of the log, the rest are just repetition of the "shutdown help" from default shutdown.exe command because of escape issue ```text virtualbox-ovf output will be in this color. ==> virtualbox-ovf: Downloading or copying OVF/OVA virtualbox-ovf: Downloading or copying: file:///C:/Users/lyu/Desktop/win2k8/output-stage2/output-stage2.ovf ==> virtualbox-ovf: Importing VM: C:/Users/lyu/Desktop/win2k8/output-stage2/output-stage2.ovf ==> virtualbox-ovf: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 2822) ==> virtualbox-ovf: Starting the virtual machine... ==> virtualbox-ovf: Waiting 10s for boot... ==> virtualbox-ovf: Typing the boot command... ==> virtualbox-ovf: Waiting for SSH to become available... ==> virtualbox-ovf: Connected to SSH! ==> virtualbox-ovf: Uploading VirtualBox version info (5.2.8) ==> virtualbox-ovf: Restarting Machine virtualbox-ovf: restart ==> virtualbox-ovf: Waiting for machine to restart... virtualbox-ovf: Usage: shutdown.exe [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f] virtualbox-ovf: [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]] virtualbox-ovf: virtualbox-ovf: No args Display help. This is the same as typing /?. virtualbox-ovf: /? Display help. This is the same as not typing any options. virtualbox-ovf: /i Display the graphical user interface (GUI). virtualbox-ovf: This must be the first option. virtualbox-ovf: /l Log off. This cannot be used with /m or /d options. virtualbox-ovf: /s Shutdown the computer. virtualbox-ovf: /r Shutdown and restart the computer. virtualbox-ovf: /g Shutdown and restart the computer. After the system is virtualbox-ovf: rebooted, restart any registered applications. virtualbox-ovf: /a Abort a system shutdown. virtualbox-ovf: This can only be used during the time-out period. virtualbox-ovf: /p Turn off the local computer with no time-out or warning. virtualbox-ovf: Can be used with /d and /f options. virtualbox-ovf: /h Hibernate the local computer. virtualbox-ovf: Can be used with the /f option. virtualbox-ovf: /e Document the reason for an unexpected shutdown of a computer. virtualbox-ovf: /m \\computer Specify the target computer. virtualbox-ovf: /t xxx Set the time-out period before shutdown to xxx seconds. virtualbox-ovf: The valid range is 0-315360000 (10 years), with a default of 30. virtualbox-ovf: If the timeout period is greater than 0, the /f parameter is virtualbox-ovf: implied. virtualbox-ovf: /c "comment" Comment on the reason for the restart or shutdown. virtualbox-ovf: Maximum of 512 characters allowed. virtualbox-ovf: /f Force running applications to close without forewarning users. virtualbox-ovf: The /f parameter is implied when a value greater than 0 is virtualbox-ovf: specified for the /t parameter. virtualbox-ovf: /d [p|u:]xx:yy Provide the reason for the restart or shutdown. virtualbox-ovf: p indicates that the restart or shutdown is planned. virtualbox-ovf: u indicates that the reason is user defined. virtualbox-ovf: If neither p nor u is specified the restart or shutdown is virtualbox-ovf: unplanned. virtualbox-ovf: xx is the major reason number (positive integer less than 256). virtualbox-ovf: yy is the minor reason number (positive integer less than 65536). virtualbox-ovf: virtualbox-ovf: Reasons on this computer: virtualbox-ovf: (E = Expected U = Unexpected P = planned, C = customer defined) virtualbox-ovf: Type Major Minor Title virtualbox-ovf: virtualbox-ovf: U 0 0 Other (Unplanned) virtualbox-ovf: E 0 0 Other (Unplanned) virtualbox-ovf: E P 0 0 Other (Planned) virtualbox-ovf: U 0 5 Other Failure: System Unresponsive virtualbox-ovf: E 1 1 Hardware: Maintenance (Unplanned) virtualbox-ovf: E P 1 1 Hardware: Maintenance (Planned) virtualbox-ovf: E 1 2 Hardware: Installation (Unplanned) virtualbox-ovf: E P 1 2 Hardware: Installation (Planned) virtualbox-ovf: E 2 2 Operating System: Recovery (Planned) virtualbox-ovf: E P 2 2 Operating System: Recovery (Planned) virtualbox-ovf: P 2 3 Operating System: Upgrade (Planned) virtualbox-ovf: E 2 4 Operating System: Reconfiguration (Unplanned) virtualbox-ovf: E P 2 4 Operating System: Reconfiguration (Planned) virtualbox-ovf: P 2 16 Operating System: Service pack (Planned) virtualbox-ovf: 2 17 Operating System: Hot fix (Unplanned) virtualbox-ovf: P 2 17 Operating System: Hot fix (Planned) virtualbox-ovf: 2 18 Operating System: Security fix (Unplanned) virtualbox-ovf: P 2 18 Operating System: Security fix (Planned) virtualbox-ovf: E 4 1 Application: Maintenance (Unplanned) virtualbox-ovf: E P 4 1 Application: Maintenance (Planned) virtualbox-ovf: E P 4 2 Application: Installation (Planned) virtualbox-ovf: E 4 5 Application: Unresponsive virtualbox-ovf: E 4 6 Application: Unstable virtualbox-ovf: U 5 15 System Failure: Stop error virtualbox-ovf: U 5 19 Security issue virtualbox-ovf: E 5 19 Security issue virtualbox-ovf: E P 5 19 Security issue virtualbox-ovf: E 5 20 Loss of network connectivity (Unplanned) virtualbox-ovf: U 6 11 Power Failure: Cord Unplugged virtualbox-ovf: U 6 12 Power Failure: Environment virtualbox-ovf: P 7 0 Legacy API shutdown virtualbox-ovf: Usage: shutdown.exe [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f] virtualbox-ovf: [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]] virtualbox-ovf: virtualbox-ovf: No args Display help. This is the same as typing /?. virtualbox-ovf: /? Display help. This is the same as not typing any options. virtualbox-ovf: /i Display the graphical user interface (GUI). virtualbox-ovf: This must be the first option. virtualbox-ovf: /l Log off. This cannot be used with /m or /d options. virtualbox-ovf: /s Shutdown the computer. virtualbox-ovf: /r Shutdown and restart the computer. virtualbox-ovf: /g Shutdown and restart the computer. After the system is virtualbox-ovf: rebooted, restart any registered applications. virtualbox-ovf: /a Abort a system shutdown. virtualbox-ovf: This can only be used during the time-out period. virtualbox-ovf: /p Turn off the local computer with no time-out or warning. virtualbox-ovf: Can be used with /d and /f options. virtualbox-ovf: /h Hibernate the local computer. virtualbox-ovf: Can be used with the /f option. virtualbox-ovf: /e Document the reason for an unexpected shutdown of a computer. virtualbox-ovf: /m \\computer Specify the target computer. virtualbox-ovf: /t xxx Set the time-out period before shutdown to xxx seconds. virtualbox-ovf: The valid range is 0-315360000 (10 years), with a default of 30. virtualbox-ovf: If the timeout period is greater than 0, the /f parameter is virtualbox-ovf: implied. virtualbox-ovf: /c "comment" Comment on the reason for the restart or shutdown. virtualbox-ovf: Maximum of 512 characters allowed. virtualbox-ovf: /f Force running applications to close without forewarning users. virtualbox-ovf: The /f parameter is implied when a value greater than 0 is virtualbox-ovf: specified for the /t parameter. virtualbox-ovf: /d [p|u:]xx:yy Provide the reason for the restart or shutdown. virtualbox-ovf: p indicates that the restart or shutdown is planned. virtualbox-ovf: u indicates that the reason is user defined. virtualbox-ovf: If neither p nor u is specified the restart or shutdown is virtualbox-ovf: unplanned. virtualbox-ovf: xx is the major reason number (positive integer less than 256). virtualbox-ovf: yy is the minor reason number (positive integer less than 65536). virtualbox-ovf: virtualbox-ovf: Reasons on this computer: virtualbox-ovf: (E = Expected U = Unexpected P = planned, C = customer defined) virtualbox-ovf: Type Major Minor Title virtualbox-ovf: virtualbox-ovf: U 0 0 Other (Unplanned) virtualbox-ovf: E 0 0 Other (Unplanned) virtualbox-ovf: E P 0 0 Other (Planned) virtualbox-ovf: U 0 5 Other Failure: System Unresponsive virtualbox-ovf: E 1 1 Hardware: Maintenance (Unplanned) virtualbox-ovf: E P 1 1 Hardware: Maintenance (Planned) virtualbox-ovf: E 1 2 Hardware: Installation (Unplanned) virtualbox-ovf: E P 1 2 Hardware: Installation (Planned) virtualbox-ovf: E 2 2 Operating System: Recovery (Planned) virtualbox-ovf: E P 2 2 Operating System: Recovery (Planned) virtualbox-ovf: P 2 3 Operating System: Upgrade (Planned) virtualbox-ovf: E 2 4 Operating System: Reconfiguration (Unplanned) virtualbox-ovf: E P 2 4 Operating System: Reconfiguration (Planned) virtualbox-ovf: P 2 16 Operating System: Service pack (Planned) virtualbox-ovf: 2 17 Operating System: Hot fix (Unplanned) virtualbox-ovf: P 2 17 Operating System: Hot fix (Planned) virtualbox-ovf: 2 18 Operating System: Security fix (Unplanned) virtualbox-ovf: P 2 18 Operating System: Security fix (Planned) virtualbox-ovf: E 4 1 Application: Maintenance (Unplanned) virtualbox-ovf: E P 4 1 Application: Maintenance (Planned) virtualbox-ovf: E P 4 2 Application: Installation (Planned) virtualbox-ovf: E 4 5 Application: Unresponsive virtualbox-ovf: E 4 6 Application: Unstable virtualbox-ovf: U 5 15 System Failure: Stop error virtualbox-ovf: U 5 19 Security issue virtualbox-ovf: E 5 19 Security issue virtualbox-ovf: E P 5 19 Security issue virtualbox-ovf: E 5 20 Loss of network connectivity (Unplanned) virtualbox-ovf: U 6 11 Power Failure: Cord Unplugged virtualbox-ovf: U 6 12 Power Failure: Environment virtualbox-ovf: P 7 0 Legacy API shutdown virtualbox-ovf: Usage: shutdown.exe [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f] virtualbox-ovf: [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]] virtualbox-ovf: virtualbox-ovf: No args Display help. This is the same as typing /?. virtualbox-ovf: /? Display help. This is the same as not typing any options. virtualbox-ovf: /i Display the graphical user interface (GUI). virtualbox-ovf: This must be the first option. virtualbox-ovf: /l Log off. This cannot be used with /m or /d options. virtualbox-ovf: /s Shutdown the computer. virtualbox-ovf: /r Shutdown and restart the computer. virtualbox-ovf: /g Shutdown and restart the computer. After the system is virtualbox-ovf: rebooted, restart any registered applications. virtualbox-ovf: /a Abort a system shutdown. virtualbox-ovf: This can only be used during the time-out period. virtualbox-ovf: /p Turn off the local computer with no time-out or warning. virtualbox-ovf: Can be used with /d and /f options. virtualbox-ovf: /h Hibernate the local computer. virtualbox-ovf: Can be used with the /f option. virtualbox-ovf: /e Document the reason for an unexpected shutdown of a computer. virtualbox-ovf: /m \\computer Specify the target computer. virtualbox-ovf: /t xxx Set the time-out period before shutdown to xxx seconds. virtualbox-ovf: The valid range is 0-315360000 (10 years), with a default of 30. virtualbox-ovf: If the timeout period is greater than 0, the /f parameter is virtualbox-ovf: implied. virtualbox-ovf: /c "comment" Comment on the reason for the restart or shutdown. virtualbox-ovf: Maximum of 512 characters allowed. virtualbox-ovf: /f Force running applications to close without forewarning users. virtualbox-ovf: The /f parameter is implied when a value greater than 0 is virtualbox-ovf: specified for the /t parameter. virtualbox-ovf: /d [p|u:]xx:yy Provide the reason for the restart or shutdown. virtualbox-ovf: p indicates that the restart or shutdown is planned. virtualbox-ovf: u indicates that the reason is user defined. virtualbox-ovf: If neither p nor u is specified the restart or shutdown is virtualbox-ovf: unplanned. virtualbox-ovf: xx is the major reason number (positive integer less than 256). virtualbox-ovf: yy is the minor reason number (positive integer less than 65536). virtualbox-ovf: virtualbox-ovf: Reasons on this computer: virtualbox-ovf: (E = Expected U = Unexpected P = planned, C = customer defined) virtualbox-ovf: Type Major Minor Title virtualbox-ovf: virtualbox-ovf: U 0 0 Other (Unplanned) virtualbox-ovf: E 0 0 Other (Unplanned) virtualbox-ovf: E P 0 0 Other (Planned) virtualbox-ovf: U 0 5 Other Failure: System Unresponsive virtualbox-ovf: E 1 1 Hardware: Maintenance (Unplanned) virtualbox-ovf: E P 1 1 Hardware: Maintenance (Planned) virtualbox-ovf: E 1 2 Hardware: Installation (Unplanned) virtualbox-ovf: E P 1 2 Hardware: Installation (Planned) virtualbox-ovf: E 2 2 Operating System: Recovery (Planned) virtualbox-ovf: E P 2 2 Operating System: Recovery (Planned) virtualbox-ovf: P 2 3 Operating System: Upgrade (Planned) virtualbox-ovf: E 2 4 Operating System: Reconfiguration (Unplanned) virtualbox-ovf: E P 2 4 Operating System: Reconfiguration (Planned) virtualbox-ovf: P 2 16 Operating System: Service pack (Planned) virtualbox-ovf: 2 17 Operating System: Hot fix (Unplanned) virtualbox-ovf: P 2 17 Operating System: Hot fix (Planned) virtualbox-ovf: 2 18 Operating System: Security fix (Unplanned) virtualbox-ovf: P 2 18 Operating System: Security fix (Planned) virtualbox-ovf: E 4 1 Application: Maintenance (Unplanned) virtualbox-ovf: E P 4 1 Application: Maintenance (Planned) virtualbox-ovf: E P 4 2 Application: Installation (Planned) virtualbox-ovf: E 4 5 Application: Unresponsive virtualbox-ovf: E 4 6 Application: Unstable virtualbox-ovf: U 5 15 System Failure: Stop error virtualbox-ovf: U 5 19 Security issue virtualbox-ovf: E 5 19 Security issue virtualbox-ovf: E P 5 19 Security issue virtualbox-ovf: E 5 20 Loss of network connectivity (Unplanned) virtualbox-ovf: U 6 11 Power Failure: Cord Unplugged virtualbox-ovf: U 6 12 Power Failure: Environment virtualbox-ovf: P 7 0 Legacy API shutdown virtualbox-ovf: Usage: shutdown.exe [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f] virtualbox-ovf: [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]] virtualbox-ovf: virtualbox-ovf: No args Display help. This is the same as typing /?. virtualbox-ovf: /? Display help. This is the same as not typing any options. virtualbox-ovf: /i Display the graphical user interface (GUI). virtualbox-ovf: This must be the first option. virtualbox-ovf: /l Log off. This cannot be used with /m or /d options. virtualbox-ovf: /s Shutdown the computer. virtualbox-ovf: /r Shutdown and restart the computer. virtualbox-ovf: /g Shutdown and restart the computer. After the system is virtualbox-ovf: rebooted, restart any registered applications. virtualbox-ovf: /a Abort a system shutdown. virtualbox-ovf: This can only be used during the time-out period. virtualbox-ovf: /p Turn off the local computer with no time-out or warning. virtualbox-ovf: Can be used with /d and /f options. virtualbox-ovf: /h Hibernate the local computer. virtualbox-ovf: Can be used with the /f option. virtualbox-ovf: /e Document the reason for an unexpected shutdown of a computer. virtualbox-ovf: /m \\computer Specify the target computer. virtualbox-ovf: /t xxx Set the time-out period before shutdown to xxx seconds. virtualbox-ovf: The valid range is 0-315360000 (10 years), with a default of 30. virtualbox-ovf: If the timeout period is greater than 0, the /f parameter is virtualbox-ovf: implied. virtualbox-ovf: /c "comment" Comment on the reason for the restart or shutdown. virtualbox-ovf: Maximum of 512 characters allowed. virtualbox-ovf: /f Force running applications to close without forewarning users. virtualbox-ovf: The /f parameter is implied when a value greater than 0 is virtualbox-ovf: specified for the /t parameter. virtualbox-ovf: /d [p|u:]xx:yy Provide the reason for the restart or shutdown. virtualbox-ovf: p indicates that the restart or shutdown is planned. virtualbox-ovf: u indicates that the reason is user defined. virtualbox-ovf: If neither p nor u is specified the restart or shutdown is virtualbox-ovf: unplanned. virtualbox-ovf: xx is the major reason number (positive integer less than 256). virtualbox-ovf: yy is the minor reason number (positive integer less than 65536). virtualbox-ovf: virtualbox-ovf: Reasons on this computer: virtualbox-ovf: (E = Expected U = Unexpected P = planned, C = customer defined) virtualbox-ovf: Type Major Minor Title virtualbox-ovf: virtualbox-ovf: U 0 0 Other (Unplanned) virtualbox-ovf: E 0 0 Other (Unplanned) virtualbox-ovf: E P 0 0 Other (Planned) virtualbox-ovf: U 0 5 Other Failure: System Unresponsive virtualbox-ovf: E 1 1 Hardware: Maintenance (Unplanned) virtualbox-ovf: E P 1 1 Hardware: Maintenance (Planned) virtualbox-ovf: E 1 2 Hardware: Installation (Unplanned) virtualbox-ovf: E P 1 2 Hardware: Installation (Planned) virtualbox-ovf: E 2 2 Operating System: Recovery (Planned) virtualbox-ovf: E P 2 2 Operating System: Recovery (Planned) virtualbox-ovf: P 2 3 Operating System: Upgrade (Planned) virtualbox-ovf: E 2 4 Operating System: Reconfiguration (Unplanned) virtualbox-ovf: E P 2 4 Operating System: Reconfiguration (Planned) virtualbox-ovf: P 2 16 Operating System: Service pack (Planned) virtualbox-ovf: 2 17 Operating System: Hot fix (Unplanned) virtualbox-ovf: P 2 17 Operating System: Hot fix (Planned) virtualbox-ovf: 2 18 Operating System: Security fix (Unplanned) virtualbox-ovf: P 2 18 Operating System: Security fix (Planned) virtualbox-ovf: E 4 1 Application: Maintenance (Unplanned) virtualbox-ovf: E P 4 1 Application: Maintenance (Planned) virtualbox-ovf: E P 4 2 Application: Installation (Planned) virtualbox-ovf: E 4 5 Application: Unresponsive virtualbox-ovf: E 4 6 Application: Unstable virtualbox-ovf: U 5 15 System Failure: Stop error virtualbox-ovf: U 5 19 Security issue virtualbox-ovf: E 5 19 Security issue virtualbox-ovf: E P 5 19 Security issue virtualbox-ovf: E 5 20 Loss of network connectivity (Unplanned) virtualbox-ovf: U 6 11 Power Failure: Cord Unplugged virtualbox-ovf: U 6 12 Power Failure: Environment virtualbox-ovf: P 7 0 Legacy API shutdown ```
SwampDragons commented 6 years ago

This looks like the normal logs, not the debug logs. Did you set the env var PACKER_LOG=1?

leonyu commented 6 years ago

Oops, sorry. Had to jump thru hoops to get Windows to pipe both stdout and stderr to the same file, Didn't realize the context I was running from didn't inherit it.

500 lines ``` 2018/03/26 21:02:28 [INFO] Packer version: 1.2.1 2018/03/26 21:02:28 Packer Target OS/Arch: windows amd64 2018/03/26 21:02:28 Built with Go Version: go1.10 2018/03/26 21:02:28 Using internal plugin for cloudstack 2018/03/26 21:02:28 Using internal plugin for lxd 2018/03/26 21:02:28 Using internal plugin for null 2018/03/26 21:02:28 Using internal plugin for virtualbox-iso 2018/03/26 21:02:28 Using internal plugin for digitalocean 2018/03/26 21:02:28 Using internal plugin for oracle-oci 2018/03/26 21:02:28 Using internal plugin for amazon-ebsvolume 2018/03/26 21:02:28 Using internal plugin for amazon-instance 2018/03/26 21:02:28 Using internal plugin for azure-arm 2018/03/26 21:02:28 Using internal plugin for googlecompute 2018/03/26 21:02:28 Using internal plugin for lxc 2018/03/26 21:02:28 Using internal plugin for amazon-chroot 2018/03/26 21:02:28 Using internal plugin for docker 2018/03/26 21:02:28 Using internal plugin for hyperv-iso 2018/03/26 21:02:28 Using internal plugin for vmware-iso 2018/03/26 21:02:28 Using internal plugin for amazon-ebssurrogate 2018/03/26 21:02:28 Using internal plugin for vmware-vmx 2018/03/26 21:02:28 Using internal plugin for alicloud-ecs 2018/03/26 21:02:28 Using internal plugin for amazon-ebs 2018/03/26 21:02:28 Using internal plugin for oracle-classic 2018/03/26 21:02:28 Using internal plugin for qemu 2018/03/26 21:02:28 Using internal plugin for scaleway 2018/03/26 21:02:28 Using internal plugin for triton 2018/03/26 21:02:28 Using internal plugin for hyperv-vmcx 2018/03/26 21:02:28 Using internal plugin for oneandone 2018/03/26 21:02:28 Using internal plugin for parallels-iso 2018/03/26 21:02:28 Using internal plugin for profitbricks 2018/03/26 21:02:28 Using internal plugin for file 2018/03/26 21:02:28 Using internal plugin for ncloud 2018/03/26 21:02:28 Using internal plugin for openstack 2018/03/26 21:02:28 Using internal plugin for parallels-pvm 2018/03/26 21:02:28 Using internal plugin for virtualbox-ovf 2018/03/26 21:02:28 Using internal plugin for chef-solo 2018/03/26 21:02:28 Using internal plugin for shell-local 2018/03/26 21:02:28 Using internal plugin for salt-masterless 2018/03/26 21:02:28 Using internal plugin for shell 2018/03/26 21:02:28 Using internal plugin for windows-shell 2018/03/26 21:02:28 Using internal plugin for chef-client 2018/03/26 21:02:28 Using internal plugin for converge 2018/03/26 21:02:28 Using internal plugin for file 2018/03/26 21:02:28 Using internal plugin for powershell 2018/03/26 21:02:28 Using internal plugin for puppet-masterless 2018/03/26 21:02:28 Using internal plugin for ansible 2018/03/26 21:02:28 Using internal plugin for ansible-local 2018/03/26 21:02:28 Using internal plugin for puppet-server 2018/03/26 21:02:28 Using internal plugin for windows-restart 2018/03/26 21:02:28 Using internal plugin for atlas 2018/03/26 21:02:28 Using internal plugin for vsphere-template 2018/03/26 21:02:28 Using internal plugin for artifice 2018/03/26 21:02:28 Using internal plugin for docker-tag 2018/03/26 21:02:28 Using internal plugin for vagrant-cloud 2018/03/26 21:02:28 Using internal plugin for docker-save 2018/03/26 21:02:28 Using internal plugin for amazon-import 2018/03/26 21:02:28 Using internal plugin for compress 2018/03/26 21:02:28 Using internal plugin for docker-push 2018/03/26 21:02:28 Using internal plugin for manifest 2018/03/26 21:02:28 Using internal plugin for shell-local 2018/03/26 21:02:28 Using internal plugin for vsphere 2018/03/26 21:02:28 Using internal plugin for alicloud-import 2018/03/26 21:02:28 Using internal plugin for docker-import 2018/03/26 21:02:28 Using internal plugin for googlecompute-export 2018/03/26 21:02:28 Using internal plugin for vagrant 2018/03/26 21:02:28 Using internal plugin for checksum 2018/03/26 21:02:28 Attempting to open config file: C:\Users\lyu\AppData\Roaming\packer.config 2018/03/26 21:02:28 [WARN] Config file doesn't exist: C:\Users\lyu\AppData\Roaming\packer.config 2018/03/26 21:02:28 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[oracle-classic:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oracle-classic ncloud:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-ncloud oracle-oci:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oracle-oci lxc:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-lxc oneandone:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oneandone virtualbox-ovf:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-ovf amazon-ebsvolume:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebsvolume parallels-iso:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-iso file:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-file virtualbox-iso:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso amazon-chroot:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-chroot docker:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-docker vmware-vmx:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-vmx triton:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-triton hyperv-vmcx:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-vmcx amazon-ebssurrogate:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebssurrogate qemu:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu lxd:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-lxd googlecompute:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-googlecompute hyperv-iso:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-iso alicloud-ecs:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-alicloud-ecs scaleway:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-scaleway profitbricks:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-profitbricks digitalocean:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-digitalocean amazon-instance:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-instance azure-arm:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-azure-arm vmware-iso:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-iso amazon-ebs:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebs openstack:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-openstack cloudstack:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-cloudstack null:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-null parallels-pvm:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-pvm] PostProcessors:map[docker-push:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-push checksum:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-checksum docker-tag:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-tag amazon-import:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-amazon-import artifice:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-artifice vsphere:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere docker-save:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-save compress:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-compress manifest:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-manifest shell-local:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-shell-local docker-import:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-import googlecompute-export:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-export atlas:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-atlas vagrant-cloud:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant-cloud vagrant:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant vsphere-template:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere-template alicloud-import:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-alicloud-import] Provisioners:map[shell-local:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell-local converge:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-converge file:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-file ansible:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible puppet-server:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-server chef-solo:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-solo chef-client:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-client puppet-masterless:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-masterless windows-restart:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-restart salt-masterless:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-salt-masterless windows-shell:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-shell ansible-local:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible-local shell:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell powershell:C:\Users\lyu\scoop\apps\packer\current\packer.exe-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-powershell]} 2018/03/26 21:02:28 Setting cache directory: C:\Users\lyu\Desktop\win2k8\packer_cache 2018/03/26 21:02:28 Loading builder: virtualbox-ovf 2018/03/26 21:02:28 Plugin could not be found. Checking same directory as executable. 2018/03/26 21:02:28 Current exe path: C:\Users\lyu\scoop\apps\packer\current\packer.exe 2018/03/26 21:02:28 Creating plugin client for path: C:\Users\lyu\scoop\apps\packer\current\packer.exe 2018/03/26 21:02:28 Starting plugin: C:\Users\lyu\scoop\apps\packer\current\packer.exe []string{"C:\\Users\\lyu\\scoop\\apps\\packer\\current\\packer.exe", "plugin", "packer-builder-virtualbox-ovf"} 2018/03/26 21:02:28 Waiting for RPC address for: C:\Users\lyu\scoop\apps\packer\current\packer.exe 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 [INFO] Packer version: 1.2.1 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Packer Target OS/Arch: windows amd64 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Built with Go Version: go1.10 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Attempting to open config file: C:\Users\lyu\AppData\Roaming\packer.config 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 [WARN] Config file doesn't exist: C:\Users\lyu\AppData\Roaming\packer.config 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]} 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Setting cache directory: C:\Users\lyu\Desktop\win2k8\packer_cache 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 args: []string{"packer-builder-virtualbox-ovf"} 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Plugin minimum port: 10000 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Plugin maximum port: 25000 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Plugin address: tcp 127.0.0.1:10000 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Waiting for connection... 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Serving a plugin connection... 2018/03/26 21:02:28 Loading provisioner: windows-restart 2018/03/26 21:02:28 Plugin could not be found. Checking same directory as executable. 2018/03/26 21:02:28 Current exe path: C:\Users\lyu\scoop\apps\packer\current\packer.exe 2018/03/26 21:02:28 Creating plugin client for path: C:\Users\lyu\scoop\apps\packer\current\packer.exe 2018/03/26 21:02:28 Starting plugin: C:\Users\lyu\scoop\apps\packer\current\packer.exe []string{"C:\\Users\\lyu\\scoop\\apps\\packer\\current\\packer.exe", "plugin", "packer-provisioner-windows-restart"} 2018/03/26 21:02:28 Waiting for RPC address for: C:\Users\lyu\scoop\apps\packer\current\packer.exe 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 [INFO] Packer version: 1.2.1 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Packer Target OS/Arch: windows amd64 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Built with Go Version: go1.10 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Attempting to open config file: C:\Users\lyu\AppData\Roaming\packer.config 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 [WARN] Config file doesn't exist: C:\Users\lyu\AppData\Roaming\packer.config 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]} 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Setting cache directory: C:\Users\lyu\Desktop\win2k8\packer_cache 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 args: []string{"packer-provisioner-windows-restart"} 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Plugin minimum port: 10000 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Plugin maximum port: 25000 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Plugin address: tcp 127.0.0.1:10000 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Waiting for connection... 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Serving a plugin connection... 2018/03/26 21:02:28 ui: virtualbox-ovf output will be in this color. 2018/03/26 21:02:28 ui: 2018/03/26 21:02:28 Build debug mode: false 2018/03/26 21:02:28 Force build: false virtualbox-ovf output will be in this color. 2018/03/26 21:02:28 On error: 2018/03/26 21:02:28 Preparing build: virtualbox-ovf 2018/03/26 21:02:28 Waiting on builds to complete... 2018/03/26 21:02:28 Starting build run: virtualbox-ovf 2018/03/26 21:02:28 Running builder: virtualbox-ovf 2018/03/26 21:02:28 [INFO] (telemetry) Starting builder virtualbox-ovf 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 [DEBUG] builder/virtualbox: VBOX_MSI_INSTALL_PATH = C:\Program Files\Oracle\VirtualBox\ 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 VBoxManage path: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Suppressing annoying messages in VirtualBox 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Executing VBoxManage: []string{"setextradata", "global", "GUI/UpdateCheckCount", "60"} 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 stdout: 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 stderr: 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Executing VBoxManage: []string{"setextradata", "global", "GUI/UpdateDate", "1 d, 2019-01-01, stable"} 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 stdout: 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 stderr: 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Executing VBoxManage: []string{"setextradata", "global", "GUI/RegistrationData", "triesLeft=0"} 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 stdout: 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 stderr: 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Executing VBoxManage: []string{"setextradata", "global", "GUI/SuppressMessages", "confirmInputCapture,remindAboutAutoCapture,remindAboutMouseIntegrationOff,remindAboutMouseIntegrationOn,remindAboutWrongColorDepth"} 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 stdout: 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 stderr: 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 No floppy files specified. Floppy disk will not be made. 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Not downloading guest additions since it is disabled. 2018/03/26 21:02:28 ui: ==> virtualbox-ovf: Downloading or copying OVF/OVA ==> virtualbox-ovf: Downloading or copying OVF/OVA 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Acquiring lock to download: file:///C:/Users/lyu/Desktop/win2k8/output-stage2/output-stage2.ovf 2018/03/26 21:02:28 ui: virtualbox-ovf: Downloading or copying: file:///C:/Users/lyu/Desktop/win2k8/output-stage2/output-stage2.ovf 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Parsed URL: &url.URL{Scheme:"file", Opaque:"", User:(*url.Userinfo)(nil), Host:"", Path:"/C:/Users/lyu/Desktop/win2k8/output-stage2/output-stage2.ovf", RawPath:"", ForceQuery:false, RawQuery:"", Fragment:""} virtualbox-ovf: Downloading or copying: file:///C:/Users/lyu/Desktop/win2k8/output-stage2/output-stage2.ovf 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 [DEBUG] Using local file: C:/Users/lyu/Desktop/win2k8/output-stage2/output-stage2.ovf 2018/03/26 21:02:28 ui: ==> virtualbox-ovf: Importing VM: C:/Users/lyu/Desktop/win2k8/output-stage2/output-stage2.ovf 2018/03/26 21:02:28 packer.exe: 2018/03/26 21:02:28 Executing VBoxManage: []string{"import", "C:/Users/lyu/Desktop/win2k8/output-stage2/output-stage2.ovf", "--vsys", "0", "--vmname", "output-stage3"} ==> virtualbox-ovf: Importing VM: C:/Users/lyu/Desktop/win2k8/output-stage2/output-stage2.ovf 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 stdout: Disks: 2018/03/26 21:03:27 packer.exe: vmdisk1 41943040000 -1 http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized output-stage2-disk001.vmdk -1 -1 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 packer.exe: Virtual system 0: 2018/03/26 21:03:27 packer.exe: 0: Suggested OS type: "Windows2008_64" 2018/03/26 21:03:27 packer.exe: (change with "--vsys 0 --ostype "; use "list ostypes" to list all possible values) 2018/03/26 21:03:27 packer.exe: 1: VM name specified with --vmname: "output-stage3" 2018/03/26 21:03:27 packer.exe: 2: Number of CPUs: 1 2018/03/26 21:03:27 packer.exe: (change with "--vsys 0 --cpus ") 2018/03/26 21:03:27 packer.exe: 3: Guest memory: 512 MB 2018/03/26 21:03:27 packer.exe: (change with "--vsys 0 --memory ") 2018/03/26 21:03:27 packer.exe: 4: Sound card (appliance expects "", can change on import) 2018/03/26 21:03:27 packer.exe: (disable with "--vsys 0 --unit 4 --ignore") 2018/03/26 21:03:27 packer.exe: 5: Network adapter: orig NAT, config 3, extra slot=0;type=NAT 2018/03/26 21:03:27 packer.exe: 6: IDE controller, type PIIX4 2018/03/26 21:03:27 packer.exe: (disable with "--vsys 0 --unit 6 --ignore") 2018/03/26 21:03:27 packer.exe: 7: IDE controller, type PIIX4 2018/03/26 21:03:27 packer.exe: (disable with "--vsys 0 --unit 7 --ignore") 2018/03/26 21:03:27 packer.exe: 8: Hard disk image: source image=output-stage2-disk001.vmdk, target path=C:\Users\lyu\VirtualBox VMs\output-stage2\output-stage2-disk001.vmdk, controller=6;channel=0 2018/03/26 21:03:27 packer.exe: (change target path with "--vsys 0 --unit 8 --disk path"; 2018/03/26 21:03:27 packer.exe: disable with "--vsys 0 --unit 8 --ignore") 2018/03/26 21:03:27 packer.exe: Successfully imported the appliance. 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 stderr: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% 2018/03/26 21:03:27 packer.exe: Interpreting C:\Users\lyu\Desktop\win2k8\output-stage2\output-stage2.ovf... 2018/03/26 21:03:27 packer.exe: OK. 2018/03/26 21:03:27 packer.exe: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 Not attaching guest additions since we're uploading. 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 Looking for available port between 5900 and 6000 on 127.0.0.1 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 Trying port: 5989 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 Executing VBoxManage: []string{"modifyvm", "output-stage3", "--vrdeaddress", "127.0.0.1", "--vrdeauthtype", "null", "--vrde", "on", "--vrdeport", "5989"} 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 stdout: 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 stderr: 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 No floppy disk, not attaching. 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 Looking for available communicator (SSH, WinRM, etc) port between 2222 and 4444 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 Trying port: 4178 2018/03/26 21:03:27 ui: ==> virtualbox-ovf: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 4178) 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 Executing VBoxManage: []string{"modifyvm", "output-stage3", "--natpf1", "packercomm,tcp,127.0.0.1,4178,,22"} ==> virtualbox-ovf: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 4178) 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 stdout: 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 stderr: 2018/03/26 21:03:27 ui: ==> virtualbox-ovf: Starting the virtual machine... ==> virtualbox-ovf: Starting the virtual machine... 2018/03/26 21:03:27 packer.exe: 2018/03/26 21:03:27 Executing VBoxManage: []string{"startvm", "output-stage3", "--type", "gui"} 2018/03/26 21:03:31 packer.exe: 2018/03/26 21:03:31 stdout: Waiting for VM "output-stage3" to power on... 2018/03/26 21:03:31 packer.exe: VM "output-stage3" has been successfully started. 2018/03/26 21:03:31 packer.exe: 2018/03/26 21:03:31 stderr: 2018/03/26 21:03:31 ui: ==> virtualbox-ovf: Waiting 10s for boot... ==> virtualbox-ovf: Waiting 10s for boot... 2018/03/26 21:03:41 ui: ==> virtualbox-ovf: Typing the boot command... ==> virtualbox-ovf: Typing the boot command... 2018/03/26 21:03:41 packer.exe: 2018/03/26 21:03:41 [INFO] Waiting for SSH, up to timeout: 10m0s 2018/03/26 21:03:41 ui: ==> virtualbox-ovf: Waiting for SSH to become available... ==> virtualbox-ovf: Waiting for SSH to become available... 2018/03/26 21:03:41 packer.exe: 2018/03/26 21:03:41 [INFO] Attempting SSH connection... 2018/03/26 21:03:41 packer.exe: 2018/03/26 21:03:41 reconnecting to TCP connection for SSH 2018/03/26 21:03:41 packer.exe: 2018/03/26 21:03:41 handshaking with SSH 2018/03/26 21:03:49 packer.exe: 2018/03/26 21:03:49 handshake complete! 2018/03/26 21:03:49 packer.exe: 2018/03/26 21:03:49 [INFO] no local agent socket, will not connect agent 2018/03/26 21:03:49 ui: ==> virtualbox-ovf: Connected to SSH! ==> virtualbox-ovf: Connected to SSH! 2018/03/26 21:03:49 packer.exe: 2018/03/26 21:03:49 VBoxManage --version output: 5.2.8r121009 2018/03/26 21:03:49 packer.exe: 2018/03/26 21:03:49 VirtualBox version: 5.2.8 2018/03/26 21:03:49 ui: ==> virtualbox-ovf: Uploading VirtualBox version info (5.2.8) 2018/03/26 21:03:49 packer.exe: 2018/03/26 21:03:49 opening new ssh session ==> virtualbox-ovf: Uploading VirtualBox version info (5.2.8) 2018/03/26 21:03:49 packer.exe: 2018/03/26 21:03:49 starting remote command: test -d ".vbox_version" 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 Remote command exited with '1': test -d ".vbox_version" 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 opening new ssh session 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 Starting remote scp process: scp -vt . 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 Started SCP session, beginning transfers... 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 Copying input data into temporary file so we can read the length 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 [DEBUG] scp: Uploading .vbox_version: perms=C0644 size=5 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 SCP session complete, closing stdin pipe. 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 Waiting for SSH session to complete. 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 scp stderr (length 29): Sink: C0644 5 .vbox_version 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 Not uploading guest additions since mode is not upload 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 Running the provision hook 2018/03/26 21:03:50 [INFO] (telemetry) Starting provisioner windows-restart 2018/03/26 21:03:50 ui: ==> virtualbox-ovf: Restarting Machine ==> virtualbox-ovf: Restarting Machine 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 opening new ssh session 2018/03/26 21:03:50 packer.exe: 2018/03/26 21:03:50 starting remote command: echo restart 2018/03/26 21:03:51 ui: virtualbox-ovf: restart virtualbox-ovf: restart 2018/03/26 21:03:51 packer.exe: 2018/03/26 21:03:51 [INFO] RPC endpoint: Communicator ended with: 0 2018/03/26 21:03:51 [INFO] 0 bytes written for 'stderr' 2018/03/26 21:03:51 [INFO] 9 bytes written for 'stdout' 2018/03/26 21:03:51 [INFO] RPC client: Communicator ended with: 0 2018/03/26 21:03:51 [INFO] RPC endpoint: Communicator ended with: 0 2018/03/26 21:03:51 packer.exe: 2018/03/26 21:03:51 [INFO] 0 bytes written for 'stderr' 2018/03/26 21:03:51 packer.exe: 2018/03/26 21:03:51 [INFO] 9 bytes written for 'stdout' 2018/03/26 21:03:51 packer.exe: 2018/03/26 21:03:51 [INFO] RPC client: Communicator ended with: 0 2018/03/26 21:03:51 ui: ==> virtualbox-ovf: Waiting for machine to restart... ==> virtualbox-ovf: Waiting for machine to restart... 2018/03/26 21:03:52 packer.exe: 2018/03/26 21:03:52 Check if machine is rebooting... 2018/03/26 21:03:52 packer.exe: 2018/03/26 21:03:52 opening new ssh session 2018/03/26 21:03:52 packer.exe: 2018/03/26 21:03:52 starting remote command: shutdown.exe -f -r -t 60 2018/03/26 21:03:52 ui: virtualbox-ovf: Usage: shutdown.exe [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f] virtualbox-ovf: Usage: shutdown.exe [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f] 2018/03/26 21:03:52 ui: virtualbox-ovf: [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]] virtualbox-ovf: [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]] 2018/03/26 21:03:52 ui: virtualbox-ovf: virtualbox-ovf: 2018/03/26 21:03:52 ui: virtualbox-ovf: No args Display help. This is the same as typing /?. virtualbox-ovf: No args Display help. This is the same as typing /?. 2018/03/26 21:03:52 ui: virtualbox-ovf: /? Display help. This is the same as not typing any options. virtualbox-ovf: /? Display help. This is the same as not typing any options. 2018/03/26 21:03:52 ui: virtualbox-ovf: /i Display the graphical user interface (GUI). virtualbox-ovf: /i Display the graphical user interface (GUI). 2018/03/26 21:03:52 ui: virtualbox-ovf: This must be the first option. virtualbox-ovf: This must be the first option. 2018/03/26 21:03:52 ui: virtualbox-ovf: /l Log off. This cannot be used with /m or /d options. virtualbox-ovf: /l Log off. This cannot be used with /m or /d options. 2018/03/26 21:03:52 ui: virtualbox-ovf: /s Shutdown the computer. virtualbox-ovf: /s Shutdown the computer. 2018/03/26 21:03:52 ui: virtualbox-ovf: /r Shutdown and restart the computer. virtualbox-ovf: /r Shutdown and restart the computer. 2018/03/26 21:03:52 ui: virtualbox-ovf: /g Shutdown and restart the computer. After the system is virtualbox-ovf: /g Shutdown and restart the computer. After the system is 2018/03/26 21:03:52 ui: virtualbox-ovf: rebooted, restart any registered applications. 2018/03/26 21:03:52 ui: virtualbox-ovf: /a Abort a system shutdown. virtualbox-ovf: rebooted, restart any registered applications. virtualbox-ovf: /a Abort a system shutdown. 2018/03/26 21:03:52 ui: virtualbox-ovf: This can only be used during the time-out period. virtualbox-ovf: This can only be used during the time-out period. 2018/03/26 21:03:52 ui: virtualbox-ovf: /p Turn off the local computer with no time-out or warning. virtualbox-ovf: /p Turn off the local computer with no time-out or warning. 2018/03/26 21:03:52 ui: virtualbox-ovf: Can be used with /d and /f options. virtualbox-ovf: Can be used with /d and /f options. 2018/03/26 21:03:52 ui: virtualbox-ovf: /h Hibernate the local computer. virtualbox-ovf: /h Hibernate the local computer. 2018/03/26 21:03:52 ui: virtualbox-ovf: Can be used with the /f option. virtualbox-ovf: Can be used with the /f option. 2018/03/26 21:03:52 ui: virtualbox-ovf: /e Document the reason for an unexpected shutdown of a computer. virtualbox-ovf: /e Document the reason for an unexpected shutdown of a computer. 2018/03/26 21:03:52 ui: virtualbox-ovf: /m \\computer Specify the target computer. virtualbox-ovf: /m \\computer Specify the target computer. 2018/03/26 21:03:52 ui: virtualbox-ovf: /t xxx Set the time-out period before shutdown to xxx seconds. virtualbox-ovf: /t xxx Set the time-out period before shutdown to xxx seconds. 2018/03/26 21:03:52 ui: virtualbox-ovf: The valid range is 0-315360000 (10 years), with a default of 30. virtualbox-ovf: The valid range is 0-315360000 (10 years), with a default of 30. 2018/03/26 21:03:52 ui: virtualbox-ovf: If the timeout period is greater than 0, the /f parameter is virtualbox-ovf: If the timeout period is greater than 0, the /f parameter is 2018/03/26 21:03:52 ui: virtualbox-ovf: implied. virtualbox-ovf: implied. 2018/03/26 21:03:52 ui: virtualbox-ovf: /c "comment" Comment on the reason for the restart or shutdown. virtualbox-ovf: /c "comment" Comment on the reason for the restart or shutdown. 2018/03/26 21:03:52 ui: virtualbox-ovf: Maximum of 512 characters allowed. virtualbox-ovf: Maximum of 512 characters allowed. 2018/03/26 21:03:52 ui: virtualbox-ovf: /f Force running applications to close without forewarning users. virtualbox-ovf: /f Force running applications to close without forewarning users. 2018/03/26 21:03:52 ui: virtualbox-ovf: The /f parameter is implied when a value greater than 0 is virtualbox-ovf: The /f parameter is implied when a value greater than 0 is 2018/03/26 21:03:52 ui: virtualbox-ovf: specified for the /t parameter. virtualbox-ovf: specified for the /t parameter. 2018/03/26 21:03:52 ui: virtualbox-ovf: /d [p|u:]xx:yy Provide the reason for the restart or shutdown. virtualbox-ovf: /d [p|u:]xx:yy Provide the reason for the restart or shutdown. 2018/03/26 21:03:52 ui: virtualbox-ovf: p indicates that the restart or shutdown is planned. virtualbox-ovf: p indicates that the restart or shutdown is planned. 2018/03/26 21:03:52 ui: virtualbox-ovf: u indicates that the reason is user defined. virtualbox-ovf: u indicates that the reason is user defined. 2018/03/26 21:03:52 ui: virtualbox-ovf: If neither p nor u is specified the restart or shutdown is virtualbox-ovf: If neither p nor u is specified the restart or shutdown is 2018/03/26 21:03:52 ui: virtualbox-ovf: unplanned. virtualbox-ovf: unplanned. 2018/03/26 21:03:52 ui: virtualbox-ovf: xx is the major reason number (positive integer less than 256). virtualbox-ovf: xx is the major reason number (positive integer less than 256). 2018/03/26 21:03:52 ui: virtualbox-ovf: yy is the minor reason number (positive integer less than 65536). virtualbox-ovf: yy is the minor reason number (positive integer less than 65536). 2018/03/26 21:03:52 ui: virtualbox-ovf: virtualbox-ovf: 2018/03/26 21:03:52 ui: virtualbox-ovf: Reasons on this computer: virtualbox-ovf: Reasons on this computer: 2018/03/26 21:03:52 ui: virtualbox-ovf: (E = Expected U = Unexpected P = planned, C = customer defined) virtualbox-ovf: (E = Expected U = Unexpected P = planned, C = customer defined) 2018/03/26 21:03:52 ui: virtualbox-ovf: Type Major Minor Title virtualbox-ovf: Type Major Minor Title 2018/03/26 21:03:52 ui: virtualbox-ovf: virtualbox-ovf: 2018/03/26 21:03:52 ui: virtualbox-ovf: U 0 0 Other (Unplanned) virtualbox-ovf: U 0 0 Other (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E 0 0 Other (Unplanned) virtualbox-ovf: E 0 0 Other (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E P 0 0 Other (Planned) virtualbox-ovf: E P 0 0 Other (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: U 0 5 Other Failure: System Unresponsive virtualbox-ovf: U 0 5 Other Failure: System Unresponsive 2018/03/26 21:03:52 ui: virtualbox-ovf: E 1 1 Hardware: Maintenance (Unplanned) virtualbox-ovf: E 1 1 Hardware: Maintenance (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E P 1 1 Hardware: Maintenance (Planned) virtualbox-ovf: E P 1 1 Hardware: Maintenance (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E 1 2 Hardware: Installation (Unplanned) virtualbox-ovf: E 1 2 Hardware: Installation (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E P 1 2 Hardware: Installation (Planned) virtualbox-ovf: E P 1 2 Hardware: Installation (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E 2 2 Operating System: Recovery (Planned) virtualbox-ovf: E 2 2 Operating System: Recovery (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E P 2 2 Operating System: Recovery (Planned) virtualbox-ovf: E P 2 2 Operating System: Recovery (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: P 2 3 Operating System: Upgrade (Planned) virtualbox-ovf: P 2 3 Operating System: Upgrade (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E 2 4 Operating System: Reconfiguration (Unplanned) virtualbox-ovf: E 2 4 Operating System: Reconfiguration (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E P 2 4 Operating System: Reconfiguration (Planned) virtualbox-ovf: E P 2 4 Operating System: Reconfiguration (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: P 2 16 Operating System: Service pack (Planned) virtualbox-ovf: P 2 16 Operating System: Service pack (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: 2 17 Operating System: Hot fix (Unplanned) virtualbox-ovf: 2 17 Operating System: Hot fix (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: P 2 17 Operating System: Hot fix (Planned) virtualbox-ovf: P 2 17 Operating System: Hot fix (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: 2 18 Operating System: Security fix (Unplanned) virtualbox-ovf: 2 18 Operating System: Security fix (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: P 2 18 Operating System: Security fix (Planned) virtualbox-ovf: P 2 18 Operating System: Security fix (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E 4 1 Application: Maintenance (Unplanned) virtualbox-ovf: E 4 1 Application: Maintenance (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E P 4 1 Application: Maintenance (Planned) virtualbox-ovf: E P 4 1 Application: Maintenance (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E P 4 2 Application: Installation (Planned) virtualbox-ovf: E P 4 2 Application: Installation (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E 4 5 Application: Unresponsive virtualbox-ovf: E 4 5 Application: Unresponsive 2018/03/26 21:03:52 ui: virtualbox-ovf: E 4 6 Application: Unstable virtualbox-ovf: E 4 6 Application: Unstable 2018/03/26 21:03:52 ui: virtualbox-ovf: U 5 15 System Failure: Stop error virtualbox-ovf: U 5 15 System Failure: Stop error 2018/03/26 21:03:52 ui: virtualbox-ovf: U 5 19 Security issue virtualbox-ovf: U 5 19 Security issue 2018/03/26 21:03:52 ui: virtualbox-ovf: E 5 19 Security issue virtualbox-ovf: E 5 19 Security issue 2018/03/26 21:03:52 ui: virtualbox-ovf: E P 5 19 Security issue virtualbox-ovf: E P 5 19 Security issue 2018/03/26 21:03:52 ui: virtualbox-ovf: E 5 20 Loss of network connectivity (Unplanned) virtualbox-ovf: E 5 20 Loss of network connectivity (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: U 6 11 Power Failure: Cord Unplugged virtualbox-ovf: U 6 11 Power Failure: Cord Unplugged 2018/03/26 21:03:52 ui: virtualbox-ovf: U 6 12 Power Failure: Environment virtualbox-ovf: U 6 12 Power Failure: Environment 2018/03/26 21:03:52 ui: virtualbox-ovf: P 7 0 Legacy API shutdown virtualbox-ovf: P 7 0 Legacy API shutdown 2018/03/26 21:03:52 packer.exe: 2018/03/26 21:03:52 Remote command exited with '1': shutdown.exe -f -r -t 60 2018/03/26 21:03:52 packer.exe: 2018/03/26 21:03:52 [INFO] RPC endpoint: Communicator ended with: 1 2018/03/26 21:03:52 [INFO] 0 bytes written for 'stderr' 2018/03/26 21:03:52 [INFO] 3495 bytes written for 'stdout' 2018/03/26 21:03:52 [INFO] RPC client: Communicator ended with: 1 2018/03/26 21:03:52 [INFO] RPC endpoint: Communicator ended with: 1 2018/03/26 21:03:52 packer.exe: 2018/03/26 21:03:52 [INFO] 0 bytes written for 'stderr' 2018/03/26 21:03:52 packer.exe: 2018/03/26 21:03:52 [INFO] 3495 bytes written for 'stdout' 2018/03/26 21:03:52 packer.exe: 2018/03/26 21:03:52 [INFO] RPC client: Communicator ended with: 1 2018/03/26 21:03:52 packer.exe: 2018/03/26 21:03:52 Check if machine is rebooting... 2018/03/26 21:03:52 packer.exe: 2018/03/26 21:03:52 opening new ssh session 2018/03/26 21:03:52 packer.exe: 2018/03/26 21:03:52 starting remote command: shutdown.exe -f -r -t 60 2018/03/26 21:03:52 ui: virtualbox-ovf: Usage: shutdown.exe [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f] virtualbox-ovf: Usage: shutdown.exe [/i | /l | /s | /r | /g | /a | /p | /h | /e] [/f] 2018/03/26 21:03:52 ui: virtualbox-ovf: [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]] virtualbox-ovf: [/m \\computer][/t xxx][/d [p|u:]xx:yy [/c "comment"]] 2018/03/26 21:03:52 ui: virtualbox-ovf: virtualbox-ovf: 2018/03/26 21:03:52 ui: virtualbox-ovf: No args Display help. This is the same as typing /?. virtualbox-ovf: No args Display help. This is the same as typing /?. 2018/03/26 21:03:52 ui: virtualbox-ovf: /? Display help. This is the same as not typing any options. virtualbox-ovf: /? Display help. This is the same as not typing any options. 2018/03/26 21:03:52 ui: virtualbox-ovf: /i Display the graphical user interface (GUI). virtualbox-ovf: /i Display the graphical user interface (GUI). 2018/03/26 21:03:52 ui: virtualbox-ovf: This must be the first option. virtualbox-ovf: This must be the first option. 2018/03/26 21:03:52 ui: virtualbox-ovf: /l Log off. This cannot be used with /m or /d options. virtualbox-ovf: /l Log off. This cannot be used with /m or /d options. 2018/03/26 21:03:52 ui: virtualbox-ovf: /s Shutdown the computer. virtualbox-ovf: /s Shutdown the computer. 2018/03/26 21:03:52 ui: virtualbox-ovf: /r Shutdown and restart the computer. virtualbox-ovf: /r Shutdown and restart the computer. 2018/03/26 21:03:52 ui: virtualbox-ovf: /g Shutdown and restart the computer. After the system is virtualbox-ovf: /g Shutdown and restart the computer. After the system is 2018/03/26 21:03:52 ui: virtualbox-ovf: rebooted, restart any registered applications. virtualbox-ovf: rebooted, restart any registered applications. 2018/03/26 21:03:52 ui: virtualbox-ovf: /a Abort a system shutdown. virtualbox-ovf: /a Abort a system shutdown. 2018/03/26 21:03:52 ui: virtualbox-ovf: This can only be used during the time-out period. virtualbox-ovf: This can only be used during the time-out period. 2018/03/26 21:03:52 ui: virtualbox-ovf: /p Turn off the local computer with no time-out or warning. virtualbox-ovf: /p Turn off the local computer with no time-out or warning. 2018/03/26 21:03:52 ui: virtualbox-ovf: Can be used with /d and /f options. virtualbox-ovf: Can be used with /d and /f options. 2018/03/26 21:03:52 ui: virtualbox-ovf: /h Hibernate the local computer. virtualbox-ovf: /h Hibernate the local computer. 2018/03/26 21:03:52 ui: virtualbox-ovf: Can be used with the /f option. virtualbox-ovf: Can be used with the /f option. 2018/03/26 21:03:52 ui: virtualbox-ovf: /e Document the reason for an unexpected shutdown of a computer. virtualbox-ovf: /e Document the reason for an unexpected shutdown of a computer. 2018/03/26 21:03:52 ui: virtualbox-ovf: /m \\computer Specify the target computer. virtualbox-ovf: /m \\computer Specify the target computer. 2018/03/26 21:03:52 ui: virtualbox-ovf: /t xxx Set the time-out period before shutdown to xxx seconds. virtualbox-ovf: /t xxx Set the time-out period before shutdown to xxx seconds. 2018/03/26 21:03:52 ui: virtualbox-ovf: The valid range is 0-315360000 (10 years), with a default of 30. virtualbox-ovf: The valid range is 0-315360000 (10 years), with a default of 30. 2018/03/26 21:03:52 ui: virtualbox-ovf: If the timeout period is greater than 0, the /f parameter is virtualbox-ovf: If the timeout period is greater than 0, the /f parameter is 2018/03/26 21:03:52 ui: virtualbox-ovf: implied. virtualbox-ovf: implied. 2018/03/26 21:03:52 ui: virtualbox-ovf: /c "comment" Comment on the reason for the restart or shutdown. virtualbox-ovf: /c "comment" Comment on the reason for the restart or shutdown. 2018/03/26 21:03:52 ui: virtualbox-ovf: Maximum of 512 characters allowed. virtualbox-ovf: Maximum of 512 characters allowed. 2018/03/26 21:03:52 ui: virtualbox-ovf: /f Force running applications to close without forewarning users. virtualbox-ovf: /f Force running applications to close without forewarning users. 2018/03/26 21:03:52 ui: virtualbox-ovf: The /f parameter is implied when a value greater than 0 is virtualbox-ovf: The /f parameter is implied when a value greater than 0 is 2018/03/26 21:03:52 ui: virtualbox-ovf: specified for the /t parameter. virtualbox-ovf: specified for the /t parameter. 2018/03/26 21:03:52 ui: virtualbox-ovf: /d [p|u:]xx:yy Provide the reason for the restart or shutdown. virtualbox-ovf: /d [p|u:]xx:yy Provide the reason for the restart or shutdown. 2018/03/26 21:03:52 ui: virtualbox-ovf: p indicates that the restart or shutdown is planned. virtualbox-ovf: p indicates that the restart or shutdown is planned. 2018/03/26 21:03:52 ui: virtualbox-ovf: u indicates that the reason is user defined. virtualbox-ovf: u indicates that the reason is user defined. 2018/03/26 21:03:52 ui: virtualbox-ovf: If neither p nor u is specified the restart or shutdown is virtualbox-ovf: If neither p nor u is specified the restart or shutdown is 2018/03/26 21:03:52 ui: virtualbox-ovf: unplanned. virtualbox-ovf: unplanned. 2018/03/26 21:03:52 ui: virtualbox-ovf: xx is the major reason number (positive integer less than 256). virtualbox-ovf: xx is the major reason number (positive integer less than 256). 2018/03/26 21:03:52 ui: virtualbox-ovf: yy is the minor reason number (positive integer less than 65536). virtualbox-ovf: yy is the minor reason number (positive integer less than 65536). 2018/03/26 21:03:52 ui: virtualbox-ovf: virtualbox-ovf: 2018/03/26 21:03:52 ui: virtualbox-ovf: Reasons on this computer: virtualbox-ovf: Reasons on this computer: 2018/03/26 21:03:52 ui: virtualbox-ovf: (E = Expected U = Unexpected P = planned, C = customer defined) virtualbox-ovf: (E = Expected U = Unexpected P = planned, C = customer defined) 2018/03/26 21:03:52 ui: virtualbox-ovf: Type Major Minor Title virtualbox-ovf: Type Major Minor Title 2018/03/26 21:03:52 ui: virtualbox-ovf: virtualbox-ovf: virtualbox-ovf: U 0 0 Other (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: U 0 0 Other (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E 0 0 Other (Unplanned) virtualbox-ovf: E 0 0 Other (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E P 0 0 Other (Planned) virtualbox-ovf: E P 0 0 Other (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: U 0 5 Other Failure: System Unresponsive virtualbox-ovf: U 0 5 Other Failure: System Unresponsive 2018/03/26 21:03:52 ui: virtualbox-ovf: E 1 1 Hardware: Maintenance (Unplanned) virtualbox-ovf: E 1 1 Hardware: Maintenance (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E P 1 1 Hardware: Maintenance (Planned) virtualbox-ovf: E P 1 1 Hardware: Maintenance (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E 1 2 Hardware: Installation (Unplanned) virtualbox-ovf: E 1 2 Hardware: Installation (Unplanned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E P 1 2 Hardware: Installation (Planned) virtualbox-ovf: E P 1 2 Hardware: Installation (Planned) 2018/03/26 21:03:52 ui: virtualbox-ovf: E 2 2 Operating System: Recovery (Planned) virtualbox-ovf: E 2 2 Operating System: Recovery (Planned) ```
leonyu commented 6 years ago

Oddly the command (shutdown.exe -f -r -t 60) works if I invoke it via SSH manually:

capture

SwampDragons commented 6 years ago

Thanks for the updated logs!

SwampDragons commented 6 years ago

@leonyu upon revisiting this ticket, I'm confused... why are you trying to use the windows_restart provisioner on a linux guest? It's specifically for restarting windows guests.

SwampDragons commented 6 years ago

packer.zip Can you try this build for me? It's a build of https://github.com/hashicorp/packer/pull/6112

leonyu commented 6 years ago

The Linux target was solely for debugging to see what SSH command was being pass in. I will try the new build when I get home.

leonyu commented 6 years ago

It would appear 1.2.2 or the .zip build provided is unusable for my attempted configuration -- Using SSH instead of WinRM as communicator for Windows on VirtualBox

Build 'virtualbox-ovf' errored: Error uploading VirtualBox version: test : The term 'test' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:1
+ test -d .vbox_version
+ ~~~~
    + CategoryInfo          : ObjectNotFound: (test:String) [], CommandNotFoun
   dException
    + FullyQualifiedErrorId : CommandNotFoundException

I assume test -d .vbox_version is a bash/Linux command looking for Vbox Guest additions. This was produce with a Windows 2008 Server JSON file with no provisioner and SSH communicator.

If I get a chance will try produce a JSON fie based on trial ISOs that I can publish publicly.

The reason I am trying to use SSH on Windows is because I need to transfer large files in latter steps of my build, which takes a long time in WinRM.

SwampDragons commented 6 years ago

Sorry, that's a known bug I've been meaning to fix. I'll prioritize it for the next release. Are you trying to upload .vbox_version into a directory? If so, you can work around it in the meantime by being explicit about ending the destination directory with a /. e.g. /path/to/my_directory/ instead of /path/to/my_directory

SwampDragons commented 6 years ago

oh, nevermind -- this is a bug specific to virtualbox. Fixing now.

SwampDragons commented 6 years ago

Okay, sorry about that. Can you try this one? packer.zip

leonyu commented 6 years ago

Doesn't appear to fix the issue of the "shutdown help" spam.

I have created a stripped down version of my build here: https://bitbucket.org/leonyu-net/packer-win2k8

You should be able to reproduce the problem with packer build stage1-packer.json then packer build stage2-packer.json. Stage 1 builds an OVF with OpenSSH, Stage 2 simply attempts to use the OVF with windows-restart, but will produce the described behavior (shutdown help spam).

Right now the default shell is set to PowerShell, but the error existed with CMD, at least in previous version.

NOTE: First stage takes half an hour to an hour to build. It also download the Windows 2008 evaluation ISO and a few big updates (.NET 4.7, WMF 5, Rollup update)

SwampDragons commented 6 years ago

Thanks.

SwampDragons commented 6 years ago

Hmm... I'm unable to get your repro case working because the openssh install fails:

2018/04/09 12:21:50 ui:     virtualbox-iso: Downloading OpenSSH Server (sshd)
    virtualbox-iso: Downloading OpenSSH Server (sshd)
2018/04/09 12:21:50 packer: 2018/04/09 12:21:50 [INFO] RPC client: Communicator ended with: 1
2018/04/09 12:21:50 ui:     virtualbox-iso: Exception setting "SecurityProtocol": "Cannot convert null to type "System.Net.
    virtualbox-iso: Exception setting "SecurityProtocol": "Cannot convert null to type "System.Net.
2018/04/09 12:21:50 ui:     virtualbox-iso: SecurityProtocolType" due to invalid enumeration values. Specify one of the fol
    virtualbox-iso: SecurityProtocolType" due to invalid enumeration values. Specify one of the fol
2018/04/09 12:21:50 ui:     virtualbox-iso: lowing enumeration values and try again. The possible enumeration values are "S
    virtualbox-iso: lowing enumeration values and try again. The possible enumeration values are "S
2018/04/09 12:21:50 ui:     virtualbox-iso: sl3, Tls"."
    virtualbox-iso: sl3, Tls"."
2018/04/09 12:21:50 ui:     virtualbox-iso: At C:\Windows\Temp\script-5acbb9e9-0418-9df3-b8fc-66b291ef5964.ps1:16 char:35
    virtualbox-iso: At C:\Windows\Temp\script-5acbb9e9-0418-9df3-b8fc-66b291ef5964.ps1:16 char:35
2018/04/09 12:21:50 ui:     virtualbox-iso: + [System.Net.ServicePointManager]:: <<<< SecurityProtocol = [System.Net.Securi
    virtualbox-iso: + [System.Net.ServicePointManager]:: <<<< SecurityProtocol = [System.Net.Securi
2018/04/09 12:21:50 ui:     virtualbox-iso: tyProtocolType]::Tls12;
    virtualbox-iso: tyProtocolType]::Tls12;
2018/04/09 12:21:50 ui:     virtualbox-iso:     + CategoryInfo          : InvalidOperation: (:) [], ParentContainsErrorRec
    virtualbox-iso:     + CategoryInfo          : InvalidOperation: (:) [], ParentContainsErrorRec
2018/04/09 12:21:50 ui:     virtualbox-iso:    ordException
    virtualbox-iso:    ordException
2018/04/09 12:21:50 ui:     virtualbox-iso:     + FullyQualifiedErrorId : PropertyAssignmentException
    virtualbox-iso:     + FullyQualifiedErrorId : PropertyAssignmentException
2018/04/09 12:21:50 ui:     virtualbox-iso:

In the meantime though, I'm wondering whether this is really the root issue. it isn't RestartCheckCommand that's failing, by the way -- it's an internal value, TryCheckReboot. TryCheckReboot is spammy by nature because it should eventually get cut off when the computer actually, successfully, reboots. In your example case above, this never happens because "echo restart" isn't a valid restart command. My guess is that the restart_command you're overwriting "for real" isn't valid either, though I can't vet it since you didn't share it.

leonyu commented 6 years ago

Looks like .NET 4.7 upgrade didn't go through, Windows 2008 R2 only comes with TLS 1.0 support for PowerShell/.NET. GitHub has disabled TLS 1.0 last year (minimum TLS 1.1).

I can upload my ovf to S3 when I get home today.

leonyu commented 6 years ago

Here's a prebuilt stage one http://www.voidvector.com/output-stage1.tar.gz

You can untar it in the same folder (should create a output-stage1 with ovf and vmdk under it) and run packer build stage2-packer.json build directly.

SwampDragons commented 6 years ago

Thanks, I can repro based on that.

Unfortunately, I also did some research and realized this is ultimately not going to work for you; the windows-restart provisioner was written specifically for winRM, in order to work around the fact that it can't handle disconnects.

However, Packer's ssh communicator, which you're using, can handle restarts. See this thread for context. Linked there is an example of how reboots are managed before OpenSSH is connected (though you've managed this with your stage-1 build). When you're connected via SSH, your best option is unfortunately the one outlined in https://github.com/hashicorp/packer/issues/1983#issuecomment-81978106

SwampDragons commented 6 years ago

I'm going to close this for now, since nothing's really changed since Mitchell closed #1983.

HOWEVER, if you're able to successfully work around the "restart_command" double-escaping madness and find something that actually works...

(a) I'd love to hear about it so I can implement it for the SSH communicator and make windows-restart more useful to SSH-sers, and

(b) it will make the spamminess from that "TryCheckReboot" command not actually an issue. It'll be annoying, but it isn't the root problem. The fact that the restart_command is generating the same help menu instead of actually restarting the computer is the problem.

All this said, I've built you a new Packer binary that'll reduce the spamminess from the TryCheckReboot command to make it easier for you to find and focus on the restart_check command. packer.zip

leonyu commented 6 years ago

Thank you for the investigation!! Really appreciate it.

I will try with suggestion in linked ticket.

On Tue, Apr 10, 2018, 2:14 PM M. Marsh notifications@github.com wrote:

I'm going to close this for now, since nothing's really changed since Mitchell closed #1983 https://github.com/hashicorp/packer/issues/1983.

HOWEVER, if you're able to successfully work around the "restart_command" double-escaping madness and find something that actually works...

(a) I'd love to hear about it so I can implement it for the SSH communicator and make windows-restart more useful to SSH-sers, and

(b) it will make the spamminess from that "TryCheckReboot" command not actually an issue. It'll be annoying, but it isn't the root problem. The fact that the restart_command is generating the same help menu instead of actually restarting the computer is the problem.

All this said, I've built you a new Packer binary that'll reduce the spamminess from the TryCheckReboot command to make it easier for you to find and focus on the restart_check command. packer.zip https://github.com/hashicorp/packer/files/1895854/packer.zip

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hashicorp/packer/issues/6055#issuecomment-380197416, or mute the thread https://github.com/notifications/unsubscribe-auth/AASnBs-vhxVV6aqRLK1CRgzF34W5v-opks5tnPaYgaJpZM4S6UAm .

SwampDragons commented 6 years ago

I've just made a PR I think may actually fix this. See the above link.

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.