Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

build stops at or after UltraDefrag #280

Open
ngrigoriev opened this issue May 9, 2019 · 1 comment
Open

build stops at or after UltraDefrag #280

ngrigoriev opened this issue May 9, 2019 · 1 comment

Comments

@ngrigoriev
Copy link

Building off the latest version on Mac using the following command:

packer build --only=virtualbox-iso windows_2019_docker.json

The build seems to stop and not advancing even after several hours.

    virtualbox-iso: 2019-05-09T10:44:55 There are no applicable updates
    virtualbox-iso: 2019-05-09T10:44:55 Done Installing Windows Updates
    virtualbox-iso: End of Windows Updates log file C:\Windows\Temp\win-updates.log
    virtualbox-iso: C:\Users\vagrant>if "virtua" == "hyperv" (
    virtualbox-iso: echo "Skip compact steps in Hyper-V build."
    virtualbox-iso:  goto :eof
    virtualbox-iso: )
    virtualbox-iso: C:\Users\vagrant>if not exist "C:\Windows\Temp\7z1900-x64.msi" (powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.7-zip.org/a/7z1900-x64.msi', 'C:\Windows\Temp\7z1900-x64.msi')"  0<NUL )
    virtualbox-iso: C:\Users\vagrant>msiexec /qb /i C:\Windows\Temp\7z1900-x64.msi
    virtualbox-iso: C:\Users\vagrant>if not exist "C:\Windows\Temp\ultradefrag.zip" (powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://downloads.sourceforge.net/project/ultradefrag/stable-release/6.1.0/ultradefrag-portable-6.1.0.bin.amd64.zip', 'C:\Windows\Temp\ultradefrag.zip')"  0<NUL )
    virtualbox-iso: C:\Users\vagrant>if not exist "C:\Windows\Temp\ultradefrag-portable-6.1.0.amd64\udefrag.exe" (cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\ultradefrag.zip -oC:\Windows\Temp" )
    virtualbox-iso: 7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21
    virtualbox-iso: Scanning the drive for archives:
    virtualbox-iso: 1 file, 768893 bytes (751 KiB)
    virtualbox-iso: Extracting archive: C:\Windows\Temp\ultradefrag.zip
    virtualbox-iso: --
    virtualbox-iso: Path = C:\Windows\Temp\ultradefrag.zip
    virtualbox-iso: Type = zip
    virtualbox-iso: Physical Size = 768893
    virtualbox-iso: Everything is Ok
    virtualbox-iso: Folders: 5
    virtualbox-iso: Files: 166
    virtualbox-iso: Size:       2433004
    virtualbox-iso: Compressed: 768893
    virtualbox-iso: C:\Users\vagrant>if not exist "C:\Windows\Temp\SDelete.zip" (
    virtualbox-iso: powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://download.sysinternals.com/files/SDelete.zip', 'C:\Windows\Temp\SDelete.zip')"  0<NUL
    virtualbox-iso:  powershell -Command "(New-Object System.Net.WebClient).DownloadFile('https://vagrantboxes.blob.core.windows.net/box/sdelete/v1.6.1/sdelete.exe', 'C:\Windows\Temp\sdelete.exe')"  0<NUL
    virtualbox-iso: )
    virtualbox-iso: C:\Users\vagrant>if not exist "C:\Windows\Temp\sdelete.exe" (cmd /c ""C:\Program Files\7-Zip\7z.exe" x C:\Windows\Temp\SDelete.zip -oC:\Windows\Temp" )
    virtualbox-iso: C:\Users\vagrant>msiexec /qb /x C:\Windows\Temp\7z1900-x64.msi
    virtualbox-iso: C:\Users\vagrant>net stop wuauserv
==> virtualbox-iso: The Windows Update service is not started.
==> virtualbox-iso: More help is available by typing NET HELPMSG 3521.
    virtualbox-iso: C:\Users\vagrant>rmdir /S /Q C:\Windows\SoftwareDistribution\Download
    virtualbox-iso: C:\Users\vagrant>mkdir C:\Windows\SoftwareDistribution\Download
    virtualbox-iso: C:\Users\vagrant>net start wuauserv
    virtualbox-iso: The Windows Update service is starting.
    virtualbox-iso: The Windows Update service was started successfully.
    virtualbox-iso: C:\Users\vagrant>if "virtualbox-iso" NEQ "hyperv-iso" (
    virtualbox-iso: cmd /c C:\Windows\Temp\ultradefrag-portable-6.1.0.amd64\udefrag.exe --optimize --repeat C:
    virtualbox-iso:  cmd /c C:\Windows\System32\reg.exe ADD HKCU\Software\Sysinternals\SDelete /v EulaAccepted /t REG_DWORD /d 1 /f
    virtualbox-iso:  cmd /c C:\Windows\Temp\sdelete.exe -q -z C:
    virtualbox-iso: )
    virtualbox-iso: UltraDefrag 6.1.0, Copyright (c) UltraDefrag Development Team, 2007-2013.
    virtualbox-iso: UltraDefrag comes with ABSOLUTELY NO WARRANTY. This is free software,
    virtualbox-iso: and you are welcome to redistribute it under certain conditions.

I see the VM screen and the shell prompt there. I ran "tasklist" in that VM and here is what I see:

image

@clong
Copy link

clong commented May 20, 2019

Looks to be the same issue as this one: clong/DetectionLab#259

Some behavior in Packer 1.4.0 seems to have changed such that this hangs. Folks in that thread mentioned using start /wait in place of cmd /c which fixed it in my personal test, but I'm not sure how reliable that fix is. I wonder if there's a reason UltraDefrag is used in this repo over Windows' native defrag utility?

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

No branches or pull requests

2 participants