I am not sure on what can be the root cause but some general comments (I am sure you would have done this but still...) - It looks like it failed to initialize the grabber. You might want to try running the script outside the packer to see if that works. - Are all external dependency satisfied to run the script? - Your path seems to be wrong *"C:Users\IEUser\Desktop\file.png*" shouldn't it be "*C:\U*sers\IEUser\Desktop\file.png". General recommendation is to use Public folders when you are running some automation tasks in windows.
Thanks Udbhav On Thu, Jun 20, 2019 at 11:43 AM Shubham Bansal <[email protected]> wrote: > *virtualbox-ovf output will be in this color.* > > > *==> virtualbox-ovf: Creating floppy disk...* > > virtualbox-ovf: Copying files flatly from floppy_files > > virtualbox-ovf: Copying file: ./scripts/win_auto.py > > virtualbox-ovf: Copying file: ./answer_files/Autounattend.xml > > virtualbox-ovf: Done copying files from floppy_files > > virtualbox-ovf: Collecting paths from floppy_dirs > > virtualbox-ovf: Resulting paths from floppy_dirs : [] > > virtualbox-ovf: Done copying paths from floppy_dirs > > *==> virtualbox-ovf: Creating ephemeral key pair for SSH communicator...* > > *==> virtualbox-ovf: Created ephemeral SSH key pair for communicator* > > *==> virtualbox-ovf: Retrieving Guest additions* > > *==> virtualbox-ovf: Trying > /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso* > > *==> virtualbox-ovf: Trying > /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso* > > *==> virtualbox-ovf: > /Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso => > /Users/shubhambansal/rippling/rippling-hardware-client-tests/packer_cache/7784a55a71d48a1e9b5c487431438fef0f19d87f.iso* > > *==> virtualbox-ovf: leaving retrieve loop for Guest additions* > > *==> virtualbox-ovf: Retrieving OVF/OVA* > > *==> virtualbox-ovf: Trying ../../Documents/MSEdge-Win10.ovf* > > *==> virtualbox-ovf: Using ovf inplace* > > *==> virtualbox-ovf: leaving retrieve loop for OVF/OVA* > > *==> virtualbox-ovf: Importing VM: ../../Documents/MSEdge-Win10.ovf* > > *==> virtualbox-ovf: Attaching floppy disk...* > > *==> virtualbox-ovf: Creating forwarded port mapping for communicator > (SSH, WinRM, etc) (host port 3152)* > > *==> virtualbox-ovf: Executing custom VBoxManage commands...* > > virtualbox-ovf: Executing: modifyvm packer-virtualbox-ovf-1561034336 > --memory 4096 > > virtualbox-ovf: Executing: modifyvm packer-virtualbox-ovf-1561034336 > --cpus 2 > > virtualbox-ovf: Executing: modifyvm packer-virtualbox-ovf-1561034336 > --vrde on > > *==> virtualbox-ovf: Starting the virtual machine...* > > virtualbox-ovf: The VM will be run headless, without a GUI. If you > want to > > virtualbox-ovf: view the screen of the VM, connect via VRDP without a > password to > > virtualbox-ovf: rdp://127.0.0.1:5961 > > *==> virtualbox-ovf: Waiting 2m0s for boot...* > > *==> virtualbox-ovf: Typing the boot command...* > > *==> virtualbox-ovf: Using winrm communicator to connect: 127.0.0.1* > > *==> virtualbox-ovf: Waiting for WinRM to become available...* > > virtualbox-ovf: WinRM connected. > > *==> virtualbox-ovf: #< CLIXML* > > *==> virtualbox-ovf: <Objs Version="1.1.0.1" > xmlns="http://schemas.microsoft.com/powershell/2004/04 > <http://schemas.microsoft.com/powershell/2004/04>"><Obj S="progress" > RefId="0"><TN > RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 > N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first > use.</AV><AI>0</AI><Nil > /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> > </SD></PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" > /><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for > first use.</AV><AI>0</AI><Nil > /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> > </SD></PR></MS></Obj></Objs>* > > *==> virtualbox-ovf: Connected to WinRM!* > > *==> virtualbox-ovf: Uploading VirtualBox version info (6.0.8)* > > *==> virtualbox-ovf: Provisioning with Powershell...* > > *==> virtualbox-ovf: Provisioning with powershell script: > ./scripts/demo.ps1* > > virtualbox-ovf: Checking for elevation... > > virtualbox-ovf: in admin mode.. > > virtualbox-ovf: True > > *==> virtualbox-ovf: Traceback (most recent call last):* > > *==> virtualbox-ovf: File "A:/WIN_AUTO.PY", line 5, in <module>* > > *==> virtualbox-ovf: screenshot = > pyautogui.screenshot(r"C:Users\IEUser\Desktop\file.png")* > > *==> virtualbox-ovf: File > "C:\Users\IEUser\AppData\Local\Programs\Python\Python37\lib\site-packages\pyscreeze\__init__.py", > line 347, in _screenshot_win32* > > *==> virtualbox-ovf: im = ImageGrab.grab()* > > *==> virtualbox-ovf: File > "C:\Users\IEUser\AppData\Local\Programs\Python\Python37\lib\site-packages\PIL\ImageGrab.py", > line 41, in grab* > > *==> virtualbox-ovf: size, data = grabber()* > > *==> virtualbox-ovf: OSError: screen grab failed* > > *==> virtualbox-ovf: Script exited with non-zero exit status: 1.Allowed > exit codes are: [0]* > > *==> virtualbox-ovf: Step "StepProvision" failed* > > *==> virtualbox-ovf: [c] Clean up and exit, [a] abort without cleanup, or > [r] retry step (build may fail even if retry succeeds)?* c > > *==> virtualbox-ovf: Deregistering and deleting imported VM...* > > *==> virtualbox-ovf: Deleting output directory...* > > *Build 'virtualbox-ovf' errored: Build was cancelled.* > > Cleanly cancelled builds after being interrupted. > > On Friday, 21 June 2019 00:09:34 UTC+5:30, Udbhav wrote: >> >> Can you please provide the logs of the packer? >> >> >> On Thu, Jun 20, 2019 at 11:37 AM Shubham Bansal <[email protected]> >> wrote: >> >>> I tried this, but the logs are not very clear as of why the GUI cannot >>> be captured with packer. >>> Even with the headless set as false, virtual box opens but remains stuck >>> at login screen, while the scripts are running in the console of the host >>> machine. >>> >>> -- >>> This mailing list is governed under the HashiCorp Community Guidelines - >>> https://www.hashicorp.com/community-guidelines.html. Behavior in >>> violation of those guidelines may result in your removal from this mailing >>> list. >>> >>> GitHub Issues: https://github.com/mitchellh/packer/issues >>> IRC: #packer-tool on Freenode >>> --- >>> You received this message because you are subscribed to the Google >>> Groups "Packer" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/packer-tool/5a41eb71-fcf2-4c88-bfb3-aa24f5058d5c%40googlegroups.com >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > This mailing list is governed under the HashiCorp Community Guidelines - > https://www.hashicorp.com/community-guidelines.html. Behavior in > violation of those guidelines may result in your removal from this mailing > list. > > GitHub Issues: https://github.com/mitchellh/packer/issues > IRC: #packer-tool on Freenode > --- > You received this message because you are subscribed to the Google Groups > "Packer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/packer-tool/290b8dae-76f0-4ee5-af98-ce6e0a5a1452%40googlegroups.com > <https://groups.google.com/d/msgid/packer-tool/290b8dae-76f0-4ee5-af98-ce6e0a5a1452%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/mitchellh/packer/issues IRC: #packer-tool on Freenode --- You received this message because you are subscribed to the Google Groups "Packer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/CACjz45eO6KgqMH3vk-r-t_tek%3DPaTiWKQVenOUCfCt5UnCa-EQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
