{"action":"created","issue":{"url":"https://api.github.com/repos/joefitzgerald/packer-windows/issues/180","labels_url":"https://api.github.com/repos/joefitzgerald/packer-windows/issues/180/labels{/name}","comments_url":"https://api.github.com/repos/joefitzgerald/packer-windows/issues/180/comments","events_url":"https://api.github.com/repos/joefitzgerald/packer-windows/issues/180/events","html_url":"https://github.com/joefitzgerald/packer-windows/issues/180","id":109492572,"number":180,"title":"Packer build hangs on SSH when building Win 2012 Server + Virtualbox","user":{"login":"tommasodargenio","id":1016665,"avatar_url":"https://avatars.githubusercontent.com/u/1016665?v=3","gravatar_id":"","url":"https://api.github.com/users/tommasodargenio","html_url":"https://github.com/tommasodargenio","followers_url":"https://api.github.com/users/tommasodargenio/followers","following_url":"https://api.github.com/users/tommasodargenio/following{/other_user}","gists_url":"https://api.github.com/users/tommasodargenio/gists{/gist_id}","starred_url":"https://api.github.com/users/tommasodargenio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tommasodargenio/subscriptions","organizations_url":"https://api.github.com/users/tommasodargenio/orgs","repos_url":"https://api.github.com/users/tommasodargenio/repos","events_url":"https://api.github.com/users/tommasodargenio/events{/privacy}","received_events_url":"https://api.github.com/users/tommasodargenio/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-02T13:39:10Z","updated_at":"2015-10-02T13:44:56Z","closed_at":null,"body":"I'm trying to use virtualbox+packer+vagrant to automate the provisioning of VMs.\r\n\r\nI've got the json template setup to show the VM UI (so headless=false), and configured the autounattend.xml with my ISO key and the OpenSSH Server option to be installed as first.\r\n\r\nThe issue is that the vm creation get stuck on the \"Waiting for SSH\" log entry, I can see the VM running and the prompt for entering the Windows Key but nothing else happen.\r\n\r\nAny help is appreciated\r\n\r\nthis is the output up to that point from packer build, at which point I've aborted the installation\r\n\r\n```\r\nPS C:\\Users\\xxxxxxx\\Documents\\DevVM> packer build .\\windows_2012_r2.json \r\nvirtualbox-iso output will be in this color.\r\n==> virtualbox-iso: Downloading or copying Guest additions\r\n    virtualbox-iso: Downloading or copying: file:///C:/Program%20Files/Oracle/VirtualBox/VBoxGuestAdditions.iso\r\n==> virtualbox-iso: Downloading or copying ISO\r\n    virtualbox-iso: Downloading or copying: file:///C:/Users/xxxxxxx/Documents/Work/VMs/ISOs/en_windows_server_2012_r2_x64_dvd_2707946.iso\r\n==> virtualbox-iso: Creating floppy disk...\r\n    virtualbox-iso: Copying: C:/Users/xxxxxxx/Documents/DevVM/Autounattend.xml\r\n    virtualbox-iso: Copying: C:/Users/xxxxxxx/Documents/DevVM/GitHub/packer-windows/scripts/microsoft-updates.bat\r\n    virtualbox-iso: Copying: C:/Users/xxxxxxx/Documents/DevVM/GitHub/packer-windows/scripts/win-updates.ps1\r\n    virtualbox-iso: Copying: C:/Users/xxxxxxx/Documents/DevVM/GitHub/packer-windows/scripts/openssh.ps1\r\n    virtualbox-iso: Copying: C:/Users/xxxxxxx/Documents/DevVM/GitHub/packer-windows/scripts/oracle-cert.cer\r\n==> virtualbox-iso: Creating virtual machine...\r\n==> virtualbox-iso: Creating hard drive...\r\n==> virtualbox-iso: Attaching floppy disk...\r\n==> virtualbox-iso: Creating forwarded port mapping for SSH (host port 4430)\r\n==> virtualbox-iso: Executing custom VBoxManage commands...\r\n    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1443107958 --memory 2048\r\n    virtualbox-iso: Executing: modifyvm packer-virtualbox-iso-1443107958 --cpus 2\r\n==> virtualbox-iso: Starting the virtual machine...\r\n==> virtualbox-iso: Waiting 2m0s for boot...\r\n==> virtualbox-iso: Typing the boot command...\r\n==> virtualbox-iso: Waiting for SSH to become available...\r\n==> virtualbox-iso: Unregistering and deleting virtual machine...\r\n==> virtualbox-iso: Deleting output directory...\r\nBuild 'virtualbox-iso' errored: Build was cancelled.\r\nCleanly cancelled builds after being interrupted.\r\n```\r\n\r\nThis is the autounattend.xml part with the openssh entry\r\n```\r\n <FirstLogonCommands>\r\n            <SynchronousCommand wcm:action=\"add\">\r\n                <CommandLine>cmd.exe /c C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -File a:\\openssh.ps1 -AutoStart</CommandLine>\r\n                <Description>Install OpenSSH</Description>\r\n                <Order>1</Order>\r\n                <RequiresUserInput>true</RequiresUserInput>\r\n            </SynchronousCommand>        \r\n```\r\nI've also tried to change the order of the above as last command (order=23) but with no effect.\r\n\r\nThis is a part of the json template\r\n```\r\n \"type\": \"virtualbox-iso\",\r\n  \"iso_url\": \"C:/Users/xxxxxx/Documents/Work/VMs/ISOs/en_windows_server_2012_r2_x64_dvd_2707946.iso\",\r\n  \"iso_checksum_type\": \"md5\",\r\n  \"iso_checksum\": \"0e7c09aab20dec3cd7eab236dab90e78\",\r\n  \"headless\": false,\r\n  \"boot_wait\": \"2m\",\r\n  \"ssh_username\": \"vagrant\",\r\n  \"ssh_password\": \"vagrant\",\r\n  \"ssh_wait_timeout\": \"10m\",\r\n  \"shutdown_command\": \"shutdown /s /t 10 /f /d p:4:1 /c \\\"Packer Shutdown\\\"\",\r\n  \"guest_os_type\": \"Windows2012_64\",\r\n  \"disk_size\": 61440,\r\n  \"floppy_files\": [\r\n    \"C:/Users/xxxxxx/Documents/DevVM/Autounattend.xml\",\r\n    \"C:/Users/xxxxxx/Documents/DevVM/GitHub/packer-windows/scripts/microsoft-updates.bat\",\r\n    \"C:/Users/xxxxxx/Documents/DevVM/GitHub/packer-windows/scripts/win-updates.ps1\",\r\n    \"C:/Users/xxxxxx/Documents/DevVM/GitHub/packer-windows/scripts/openssh.ps1\",\r\n    \"C:/Users/xxxxxx/Documents/DevVM/GitHub/packer-windows/scripts/oracle-cert.cer\"\r\n  ],\r\n```"},"comment":{"url":"https://api.github.com/repos/joefitzgerald/packer-windows/issues/comments/145025126","html_url":"https://github.com/joefitzgerald/packer-windows/issues/180#issuecomment-145025126","issue_url":"https://api.github.com/repos/joefitzgerald/packer-windows/issues/180","id":145025126,"user":{"login":"StefanScherer","id":207759,"avatar_url":"https://avatars.githubusercontent.com/u/207759?v=3","gravatar_id":"","url":"https://api.github.com/users/StefanScherer","html_url":"https://github.com/StefanScherer","followers_url":"https://api.github.com/users/StefanScherer/followers","following_url":"https://api.github.com/users/StefanScherer/following{/other_user}","gists_url":"https://api.github.com/users/StefanScherer/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanScherer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanScherer/subscriptions","organizations_url":"https://api.github.com/users/StefanScherer/orgs","repos_url":"https://api.github.com/users/StefanScherer/repos","events_url":"https://api.github.com/users/StefanScherer/events{/privacy}","received_events_url":"https://api.github.com/users/StefanScherer/received_events","type":"User","site_admin":false},"created_at":"2015-10-02T13:44:56Z","updated_at":"2015-10-02T13:44:56Z","body":"If the VM hangs and Windows requests to enter the key, there is something wrong in Autounattend.xml with your key.\r\nThe OpenSSH will be installed a long way after your problem.\r\nJust your ISO and key and the xml tags for the key in the Autounattend.xml to get it run. The headless=false mode really helps here.\r\n"}}