commando-vm icon indicating copy to clipboard operation
commando-vm copied to clipboard

Installation bug - ERROR: Cannot bind argument to parameter 'Path' because it is null.

Open jallphin opened this issue 2 years ago • 1 comments

Describe the bug and expected behavior Installation fails on first reboot AFTER debloat.vm runs. Specific error is:

C:\Windows\system32>Call PowerShell -NoProfile -ExecutionPolicy bypass -command "Import-Module 'C:\ProgramData\boxstarter\Boxstarter.Bootstrapper\boxstarter.bootstrapper.psd1';Invoke-Boxstarter -RebootOk -NoPassword:$False"
Boxstarter Version 3.0.3.0
(c) 2018 Chocolatey Software, Inc, 2012 - 2018 Matt Wrock. https://boxstarter.org

Boxstarter: Disabling Automatic Updates from Windows Update
++ Boxstarter starting Calling Chocolatey to install installer.vm. This may take several minutes to complete...
Chocolatey v2.2.2
Installing the following packages:
installer.vm
By installing, you accept licenses for the packages.
Progress: Downloading installer.vm 0.0.0.20231009... 100%

installer.vm v0.0.0.20231009 (forced)
installer.vm package files install completed. Performing other installation steps.
 *** LOADING BOXSTARTER ***
Boxstarter: *** HELLO WORLD ***
Cannot find path 'C:\ProgramData\_VM\packages.xml' because it does not exist.
2023/10/13 19:06:34 [installer.vm] vm.common.psm1 [+] ERROR : [ERR] Cannot bind argument to parameter 'Path' because it is null.
At C:\ProgramData\chocolatey\lib\installer.vm\tools\chocolateyinstall.ps1:9 char:36
+     $configXml = [xml](Get-Content $configPath)
+                                    ~~~~~~~~~~~
ERROR: Cannot bind argument to parameter 'Path' because it is null.
The install of installer.vm was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\installer.vm\tools\chocolateyinstall.ps1'.
 See log for details.

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - installer.vm (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\installer.vm\tools\chocolateyinstall.ps1'.
 See log for details.
++ Boxstarter finished Calling Chocolatey to install installer.vm. This may take several minutes to complete... 00:00:15.0862313
True
Boxstarter: Restore Automatic Updates from Windows Update
Boxstarter: Enabling UAC
Type ENTER to exit:

To Reproduce Steps to reproduce the behavior:

  1. Install script using .\install.ps1 -cli <password> in an Administrator Powershell session.

Screenshots image

Version

  • OS: Windows 10 22H2 Build 19045.2965

Additional context To repeat, this happens right after the first reboot, AFTER debloat.vm runs. I believe this is due to this merge - https://github.com/mandiant/commando-vm/pull/306 which renamed packages.xml to config.xml which does exist in the C:\ProgramData\_VM\

jallphin avatar Oct 13 '23 19:10 jallphin

I've noticed the issue is that packages.xml is not present in _VM folder. Part of the script checks which profile you selected and copies proper config accordingly. After an error occurred, I've copied manually (in my case) .\Profiles\Default.xml to C:\ProgramData\_VM\packages.xml and that did the trick.

I might have missed setting ProfileName/ProfilePath when executing the script, hence the issue. Would have to go with fresh install to test that. (snapshot, eh?)

s0shell avatar Dec 16 '24 21:12 s0shell